Android水平无限期进度条:SmoothProgressBar

jopen 10年前

一个小的Android库,让您具有光滑和可定制的水平无限期进度条。
Android水平无限期进度条:SmoothProgressBar

用法

  • 直接使用 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"      />
  • 或实例化一个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());

项目主页:http://www.open-open.com/lib/view/home/1390736222836