ProgressView

ProgressView

项目地址:WhiteDG/ProgressView 

简介:ProgressView is a Custom View extend Progressbar to realize circular and horizontal ProgressBar with number.

ProgressBar-自定义控件-进度条-

中文版点我

ProgressView is a Custom View extend Progressbar to realize circular and horizontal ProgressBar with number.

Screenshots

      

Installation

Add the depedency in your build.gradle. The library is distributed via jCenter.

dependencies {
    compile 'com.white:progressview:1.0.1'
}

Usage

  1. In the XML

add the progressview in your layout.xml and set the attributes

// style Horizontal
<com.white.progressview.HorizontalProgressView
    android:id="@+id/progress100"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="10dp"
    android:progress="100"
    app:progressReachColor="@color/colorPrimary"
    app:progressTextColor="@color/colorPrimary"
    app:progressTextVisible="true"
    />

// style Circle
<com.white.progressview.CircleProgressView
      android:id="@+id/circle_progress_normal"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_weight="1"
      android:padding="10dp"
      android:progress="68"
      app:progressNormalSize="4dp"
      app:progressReachSize="4dp"
      app:progressStyle="Normal"
      app:radius="28dp"
      />
  1. In the Activity

you can also set all of the attributes in activity

horizontalProgressView.setXXXX();
// for example:
horizontalProgressView.setTextVisible(false);
horizontalProgressView.setReachBarSize(4);
horizontalProgressView.setProgressPosition(HorizontalProgressView.TOP);
...

and set progress with anim in time

HorizontalProgressView horizontalProgressView = (HorizontalProgressView) findViewById(R.id.progress100);
// set progress 100 with anim in 2500ms 
horizontalProgressView.setProgressInTime(100,2500);
// set progress from 20 to 100 with anim in 2500ms 
horizontalProgressView.setProgressInTime(0,100,2500);
// reset current progress with anim in 2500ms 
horizontalProgressView.runProgressAnim(2500);

CircleProgressView circleProgressView = (CircleProgressView) findViewById(R.id.circle_progress_normal);
...
// same as HorizontalProgressView
circleProgressView.setProgressInTime(100,2500);

Attributes

HorizontalProgressView

NameDescription
progressNormalColorset the normal bar color
progressReachColorset the reach bar color
progressTextColorset the progress text color
progressTextSizeset the progress text size
progressTextOffsetset the progress text offset
progressNormalSizeset the normal bar size
progressReachSizeset the reach bar size
progressTextPositionset the progress text position(CENTER/BOTTOM/TOP)
progressTextVisibleis show the progress text
progressTextSkewXset the progress text skewx
progressTextPrefixset the progress text prefix
progressTextSuffixset the progress text suffix(default '%')

CircleProgressView

NameDescription
progressNormalColorset the normal bar color
progressReachColorset the reach bar color
progressTextColorset the progress text color
progressTextSizeset the progress text size
progressTextOffsetset the progress text offset
progressNormalSizeset the normal bar size
progressReachSizeset the reach bar size
radiusset the circle radius
progressTextVisibleis show the progress text
progressTextSkewXset the progress text skewx
progressTextPrefixset the progress text prefix
progressTextSuffixset the progress text suffix(default '%')
progressStartArcset the startArc of reach area
progressStyleset the style of CircleProgressView(Normal/FillInner/FillInnerArc)
reachCapRoundset the reach bar cap round or not(only for style Normal)
innerBackgroundColorset the inner background color(only for style Normal)
innerProgressColorset the inner progress color(only for style FillInner)
innerPaddingset the padding between the inner and outer circles(only for style FillInnerArc)
outerColorset the outer circle color(only for style FillInnerArc)
outerSizeset outer circle width(only for style FillInnerArc)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值