fr.castorflex.android.smoothprogressbar.SmoothProgressDrawable Java Examples
The following examples show how to use
fr.castorflex.android.smoothprogressbar.SmoothProgressDrawable.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultHeaderTransformer.java From Klyph with MIT License | 6 votes |
private void applyProgressBarSettings() { if (mHeaderProgressBar != null) { final int strokeWidth = mHeaderProgressBar.getResources() .getDimensionPixelSize(R.dimen.ptr_progress_bar_stroke_width); mHeaderProgressBar.setIndeterminateDrawable( new SmoothProgressDrawable.Builder(mHeaderProgressBar.getContext()) .color(mProgressDrawableColor) .width(strokeWidth) .build()); ShapeDrawable shape = new ShapeDrawable(); shape.setShape(new RectShape()); shape.getPaint().setColor(mProgressDrawableColor); ClipDrawable clipDrawable = new ClipDrawable(shape, Gravity.CENTER, ClipDrawable.HORIZONTAL); mHeaderProgressBar.setProgressDrawable(clipDrawable); } }
Example #2
Source File: DefaultHeaderTransformer.java From KlyphMessenger with MIT License | 6 votes |
private void applyProgressBarSettings() { if (mHeaderProgressBar != null) { final int strokeWidth = mHeaderProgressBar.getResources() .getDimensionPixelSize(R.dimen.ptr_progress_bar_stroke_width); mHeaderProgressBar.setIndeterminateDrawable( new SmoothProgressDrawable.Builder(mHeaderProgressBar.getContext()) .color(mProgressDrawableColor) .width(strokeWidth) .build()); ShapeDrawable shape = new ShapeDrawable(); shape.setShape(new RectShape()); shape.getPaint().setColor(mProgressDrawableColor); ClipDrawable clipDrawable = new ClipDrawable(shape, Gravity.CENTER, ClipDrawable.HORIZONTAL); mHeaderProgressBar.setProgressDrawable(clipDrawable); } }
Example #3
Source File: ThreadViewFragment.java From something.apk with MIT License | 5 votes |
@Override public void onViewCreated(Activity activity, View headerView) { int[] ptrColorArray = getResources().getIntArray(SomeTheme.getThemeResource(getActivity(), R.attr.progressBarColorArray, R.array.sbp_colors_light)); nextPageColor = SomeTheme.getThemeColor(getActivity(), R.attr.progressBarColor, Color.rgb(20,146,204)); refreshColor = SomeTheme.getThemeColor(getActivity(), R.attr.progressBarColorRefresh, Color.rgb(190, 190, 190)); final int strokeWidth = getResources().getDimensionPixelSize(R.dimen.pull_to_refresh_stroke); if(ptrColorArray != null){ pfbProgressbar.setIndeterminateDrawable( new SmoothProgressDrawable.Builder(getActivity()) .colors(ptrColorArray) .sectionsCount(6) .separatorLength(0) .strokeWidth(strokeWidth) .build() ); }else{ pfbProgressbar.setIndeterminateDrawable( new SmoothProgressDrawable.Builder(getActivity()) .color(nextPageColor) .sectionsCount(6) .separatorLength(0) .strokeWidth(strokeWidth) .build()); } updateHeaderState(); }
Example #4
Source File: RefreshNowProgressIndicator.java From RefreshNow with Apache License 2.0 | 4 votes |
public Builder(final Context context) { indeterminateDrawableBuilder = new SmoothProgressDrawable.Builder(context); final Resources res = context.getResources(); progressColor(res.getColor(R.color.spb_default_color)); progressStrokeWidth(res.getDimensionPixelSize(R.dimen.spb_default_stroke_width)); }