Coder Social home page Coder Social logo

zzc1990 / circleprogressview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jenly1314/circleprogressview

0.0 1.0 0.0 4.93 MB

🎡 CircleProgressView是一个圆形渐变的进度动画控件(支持外环显示刻度,内环随之变化,配置参数完全可配),动画效果纵享丝滑。

License: MIT License

Java 100.00%

circleprogressview's Introduction

CircleProgressView

Download JCenter JitPack CI CircleCI API License Blog QQGroup

CircleProgressView for Android 是一个圆形的进度动画控件,动画效果纵享丝滑。

CircleProgressView 不能满足你的需求?

也许你想要的是 ArcSeekBar

Gif 展示

Image

CircleProgressView自定义属性说明(进度默认渐变色)

属性 值类型 默认值 说明
cpvStrokeWidth dimension 12dp 笔画描边的宽度
cpvNormalColor color #FFC8C8C8 圆正常颜色
cpvProgressColor color #FF4FEAAC 圆进度颜色
cpvStartAngle integer 270 开始角度,默认十二点钟方向
cpvSweepAngle integer 360 扫描角度范围
cpvMax integer 100 进度最大值
cpvProgress integer 0 当前进度
cpvDuration integer 500 动画时长
cpvLabelText string 中间的标签文本,默认自动显示百分比
cpvLabelTextColor color #FF333333 文本字体颜色
cpvLabelTextSize dimension 30sp 文本字体大小
cpvShowLabel boolean true 是否显示文本
cpvShowTick boolean true 是否显示外环刻度
cpvCirclePadding dimension 10dp 外圆环刻度与内圆环间距
cpvTickSplitAngle integer 5 刻度间隔的角度大小
cpvBlockAngle integer 1 刻度的角度大小
cpvTurn boolean false 是否旋转
cpvCapRound boolean true 是否是圆形线冒(圆角弧度)
cpvLabelPaddingLeft dimension 0dp 文本居左边内间距
cpvLabelPaddingTop dimension 0dp 文本居顶边内间距
cpvLabelPaddingRight dimension 0dp 文本居右边内间距
cpvLabelPaddingBottom dimension 0dp 文本居底边内间距

引入

Maven:

<dependency>
  <groupId>com.king.view</groupId>
  <artifactId>circleprogressview</artifactId>
  <version>1.1.1</version>
  <type>pom</type>
</dependency>

Gradle:

implementation 'com.king.view:circleprogressview:1.1.1'

Lvy:

<dependency org='com.king.view' name='circleprogressview' rev='1.1.1'>
  <artifact name='$AID' ext='pom'></artifact>
</dependency>
如果Gradle出现compile失败的情况,可以在Project的build.gradle里面添加如下:(也可以使用上面的GitPack来complie)
allprojects {
    repositories {
        maven { url 'https://dl.bintray.com/jenly/maven' }
    }
}

示例

布局示例

    <com.king.view.circleprogressview.CircleProgressView
        android:id="@+id/cpv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

代码示例

    //显示进度动画,进度,动画时长
    circleProgressView.showAnimation(80,3000);
    //设置当前进度
    circleProgressView.setProgress(80);
    //设置进度改变监听
    circleProgressView.setOnChangeListener(onChangeListener);   

更多使用详情,请查看app中的源码使用示例

版本记录

v1.1.1:2020-4-2

  • 新增cpvLabelPadding..相关属性

v1.1.0:2019-8-19

  • 移除appcompat依赖,适配AndroidX

v1.0.1:2019-5-23

  • 新增cpvTurn属性(是否旋转)

v1.0.0:2019-2-17

  • CircleProgressView初始版本

赞赏

如果您喜欢CircleProgressView,或感觉CircleProgressView帮助到了您,可以点右上角“Star”支持一下,您的支持就是我的动力,谢谢 😃

您也可以扫描下面的二维码,请作者喝杯咖啡 ☕

关于我

Name: Jenly

Email: jenly1314#gmail.com / jenly1314#vip.qq.com

CSDN: jenly121

CNBlogs: jenly

GitHub: jenly1314

Gitee: jenly1314

加入QQ群: 20867961

circleprogressview's People

Contributors

jenly1314 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.