美文网首页
Material Demo (1) CircularProgre

Material Demo (1) CircularProgre

作者: 张知卓见 | 来源:发表于2017-06-06 18:40 被阅读42次

Custom CircularProgressDrawable

预览预览

styles.xml 自定义 style

    <style name="rainbow" parent="Material.Drawable.CircularProgress">
        <item name="cpd_strokeColors">@array/progress_colors_light</item>
    </style>

colors.xml 自定义 color array

<array name="progress_colors_light">
    <item>#FF03A9F4</item>
    <item>#FFD8433C</item>
    <item>#FFF2AF3A</item>
    <item>#FF279B5E</item>
</array>

布局文件

        <com.rey.material.widget.ProgressView
            android:layout_width="48dp"
            android:layout_height="48dp"
            app:pv_autostart="true"
            app:pv_circular="true"
            app:pv_progressStyle="@style/rainbow"
            app:cpd_strokeColors="@array/progress_colors_light"
            app:pv_progressMode="indeterminate"/>

Custom Button

Ripple 效果Ripple 效果

colors.xml 添加

    <color name="selected">#2338a9</color>
    <color name="unselected">#4d68ff</color>

drawable文件夹创建 XML 添加

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@color/selected" android:state_pressed="true" />
    <item android:drawable="@color/unselected" />
</selector>

Button 布局文件

    <com.rey.material.widget.Button
        style="@style/Material.Drawable.Ripple.Wave.Light"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColor="#fff"
        android:text="Ripple.Wave.Light"
        android:background="@drawable/my_button"
        app:rd_rippleColor="@color/selected"
        app:rd_enable="true"/>

大神插件地址

https://github.com/rey5137/material

相关文章

网友评论

      本文标题:Material Demo (1) CircularProgre

      本文链接:https://www.haomeiwen.com/subject/jwrnfxtx.html