CircularProgressView

Material style circular progress bar for Android

  • 所有者: rahatarmanahmed/CircularProgressView
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Material CircularProgressView, Indeterminate, Determinate, :-------------:, :-----------:, Sample Indeterminate GIF, Sample Determinate GIF, ## Description

This CircularProgressView is a (surprisingly) circular progress bar Android View that is designed to imitate the Material versions of ProgressBar. These versions can be seen on this page of the Material design spec under Circular indicators.

Usage

To use CircularProgressView you must add it as a dependency in your Gradle build:

dependencies {
    compile 'com.github.rahatarmanahmed:circularprogressview:2.5.0'
}

Then add the view to your layout:

<com.github.rahatarmanahmed.cpv.CircularProgressView
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/progress_view"
    android:layout_width="40dp"
    android:layout_height="40dp"
    app:cpv_animAutostart="true"
    app:cpv_indeterminate="true" />

That's all you need! If you don't want the CircularProgressView to automatically start animating, omit the app:cpv_animAutostart option and start it manually yourself:

CircularProgressView progressView = (CircularProgressView) findViewById(R.id.progress_view);
progressView.startAnimation();

A CircularProgressViewListener class is available for listening to some events (as well as a CircularProgressViewAdapter)., Event, Description, :----:, :-----------:, onProgressUpdate(float), Called when setProgress is called. (Determinate only), onProgressUpdateEnd(float), Called when this view finishes animating to the updated progress. (Determinate only), onAnimationReset(), Called when resetAnimation() is called., onModeChange(boolean), Called when you switch between indeterminate and determinate modes., ## Known Issues

CircularProgressView flickers when phone is in battery saving mode

This happens because battery saving mode automatically ends all Animators, but the ones in CPV run in an endless loop. The best way to work around this right now is to use the native ProgressBar for API >21, since that is when the battery saver mode was introduced. See this issue comment on how to accomplish this.

Changelog

v2.5.0

  • Added stopAnimation() method
  • Fixed view animating while not visible. Setting visibility to GONE or INVISIBLE will stop the animation. Setting to VISIBLE will restart it.

v2.4.0

  • Added cpv_startAngle attribute

v2.3.2

  • Fixed CPV stopping when View is recycled

v2.3.1

  • Fixed memory leak

v2.3.0

v2.2.1

  • Fixed ignoring the color #FFFFFF

v2.2.0

  • Now it uses the actual theme's accent color if possible by default.

v2.1.0

  • Fixed default thickness using 4px instead of 4dp

v2.0.1

  • Possible fix for drawArc NullPointerError
  • Slight performance improvements

v2.0.0

  • Removed unnecessary appcompat dependency from example
  • Fixed repaint issue by drawing smaller arcs

v1.0.0

  • Initial release

主要指標

概覽
名稱與所有者rahatarmanahmed/CircularProgressView
主編程語言Java
編程語言Java (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2014-11-17 18:20:38
推送於2017-10-19 05:24:09
最后一次提交2017-10-19 07:24:08
發布數11
最新版本名稱v2.5.0 (發布於 )
第一版名稱v1.0.0 (發布於 2015-03-26 11:57:08)
用户参与
星數757
關注者數32
派生數193
提交數66
已啟用問題?
問題數30
打開的問題數3
拉請求數8
打開的拉請求數0
關閉的拉請求數5
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?