Android自定义进度条:SmoothProgressBar

jopen 10年前

一个小的Android库,让您拥有光滑,可定制水平不确定的进度条。

SmoothProgressBar


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(2f)                 //2 times faster      .progressiveStartSpeed(2)      .progressiveStopSpeed(3.4)      .reversed(false)      .mirrorMode(false)      .progressiveStart(true)      .progressiveStopEndedListener(mListener) //called when the stop animation is over      .build());    mProgressBar.setIndeterminateDrawable(new CircularProgressDrawable      .Builder(this)      .colors(getResources().getIntArray(R.array.gplus_colors))      .sweepSpeed(1f)      .strokeWidth(mStrokeWidth)      .style(CircularProgressDrawable.Style.ROUNDED)      [ ... ]      .build();

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