Android渐变的圆形进度条与轻量横向进度条:MagicProgressWidget

jopen 9年前

Android渐变的圆形进度条与轻量横向进度条

使用说明:

build.gradle中配置:

compile 'com.liulishuo.magicprogresswidget:library:1.0.2'

建议参考github中的demo

<com.liulishuo.magicprogresswidget.MagicProgressCircle              android:id="@+id/demo_mpc"              android:layout_width="@dimen/mpc_size"              android:layout_height="@dimen/mpc_size"              app:mpc_percent="0.8"              app:mpc_start_color="@color/mpc_start_color"              app:mpc_end_color="@color/mpc_end_color"              app:mpc_stroke_width="@dimen/mpc_stroke_width"              app:mpc_default_color="@color/mpc_default_color"/>    <com.liulishuo.magicprogresswidget.MagicProgressBar                      android:id="@+id/demo_2_mpb"                      android:layout_width="match_parent"                      android:layout_height="@dimen/mpb_height"                      app:mpb_color="@color/mpb_color"                      app:mpb_default_color="@color/mpb_default_color"/>

1. Magic Progress Circle

参数

含义

默认值

mpc_percent

填充的百分比[0, 1]

0

mpc_stroke_width

描边宽度

18dp

mpc_start_color

渐变颜色起点颜色(percent=0)

#FF00FFED

mpc_end_color

渐变颜色终点颜色(percent=1)

#FFED00FF

mpc_default_color

未填充部分的描边的颜色

#1AFFFFFF

2. Magic Progress Bar

相比系统的ProgressBar更加轻量,如果你的ProgressBar要求不是很复杂,推荐使用


项目地址: https://github.com/lingochamp/MagicProgressWidget