ZzHorizontalProgressBar

by zhouzhuo810

水平进度条,支持渐变色和二级进度

138 Stars 28 Forks Last release: almost 3 years ago (1.0.3) Apache License 2.0 35 Commits 2 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

ZzHorizontalProgressBar

A Horizontal ProgressBar that is customized easily.

Github地址:https://github.com/zhouzhuo810/ZzHorizontalProgressBar

功能简介: - 1.支持自定义进度颜色; - 2.支持自定义背景颜色; - 3.支持自定义背景与进度之间的内间距大小; - 4.支持自定义最大值和默认进度值; - 5.支持渐变颜色进度; - 6.支持二级进度条。

与系统控件相比的优势:属性配置更简单、大小适配更方便。

Gradle:

    implementation 'me.zhouzhuo.zzhorizontalprogressbar:zz-horizontal-progressbar:1.1.0'

What does it look like?

这里写图片描述

How to use it ?

1.xml

    

2.java

        final ZzHorizontalProgressBar pb = (ZzHorizontalProgressBar) findViewById(R.id.pb);

    //set progress value
    pb.setProgress(progress);

    //set padding
    pb.setPadding(0);       

    //set bacground color
    pb.setBgColor(Color.RED);

    //set progress color
    pb.setProgressColor(Color.BLUE);

    //set max value
    pb.setMax(100);     

属性说明:

|属性|作用|类型| | --- | ---|---| |zpbpadding|背景与进度之间的内间距大小|dimension| |zpbsecondpbcolor |二级进度背景颜色|color| |zpbbgcolor |背景颜色|color| |zpbpbcolor |进度颜色|color| |zpbmax |进度最大值|int| |zpbprogress |默认进度值|int| |zpbsecondprogress |二级进度默认进度值|int| |zpbopengradient|是否使用渐变色|boolean| |zpbshowzeropoint|进度为0时是否显示圆点|boolean| |zpbgradientfrom|开始渐变颜色|color| |zpbgradientto|结束渐变颜色|color| |zpbshowsecondprogress|二级进度是否显示|boolean| |zpbopensecondgradient|二级进度是否使用渐变色|boolean| |zpbsecondgradientfrom|二级进度开始渐变颜色|color| |zpbsecondgradientto|二级进度结束渐变颜色|color| |zpbshowsecondpointshape|二级进度形状(point,line)|enum| |zpbshowmode|显示进度的模式(round,rect,roundrect)|enum| |zpbroundrectradius|roundrect模式下圆角的半径|dimension| |zpbdrawborder|是否画边框|boolean| |zpbborderwidth|边框的线宽|dimension| |zpbbordercolor|边框的颜色|color|

Fix Records

v1.1.0

  • zpbshowzero_point属性,控制进度为0时是否显示圆点;

v1.0.9

  • 修复二级进度条单一色时进度设置无效问题;

v1.0.8

  • 修复二级进度条单一色时颜色设置无效问题;

v1.0.7

  • 修复圆角进度算法缺陷;

v1.0.6

  • 添加动态设置边框颜色方法;

v1.0.5

  • 添加自定义圆角大小模式;
  • 添加zpbshowmode属性,切换模式;
  • 添加zpbroundrect_radius属性,圆角半径;
  • 添加zpbdrawborder属性,是否画边框;
  • 添加zpbborderwidth属性,边框宽度;
  • 添加zpbbordercolor属性,边框颜色;

v1.0.4

  • 添加矩形进度模式;
  • 添加
    setOnProgressChangedListener
    回调方法;

v1.0.3

  • 添加二级进度;
  • 添加二级进度渐变;
  • 添加二级进度形状;

v1.0.2

  • 添加渐变色属性;

v1.0.1

  • 修复动态修改背景颜色和进度颜色无效问题;

License

Copyright © zhouzhuo810

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.