Android水平無限期進度條:SmoothProgressBar
一個小的Android庫,讓您具有光滑和可定制的水平無限期進度條。
用法
- 直接使用 SmoothProgressBar:
<fr.castorflex.android.smoothprogressbar.SmoothProgressBar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:indeterminate="true" app:spb_sections_count="12" app:spb_color="#FF0000" app:spb_speed="2.0" app:spb_stroke_width="4dp" app:spb_stroke_separator_length="4dp" app:spb_reversed="false" app:spb_mirror_mode="false" />
</ul>
- 或實例化一個SmoothProgressDrawable并將其設置為您的進度(不要忘記設置橫置式)
mProgressBar.setIndeterminateDrawable(new SmoothProgressDrawable.Builder(context) .color(0xff0000) .interpolator(new DecelerateInterpolator()) .sectionsCount(4) .separatorLength(8) //You should use Resources#getDimensionPixelSize .strokeWidth(8f) //You should use Resources#getDimension .speed(2.0) //2 times faster .reversed(false) .mirrorMode(false) .build());
</ul>
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!