Android Circular Determinate ProgressBar

I have written detailed example on Android circular progress bar here on my blog demonuts.com You can also fond full source code and explanation there. Here’s how I made circular progressbar with percentage inside circle in pure code without any library. first create a drawable file called circular.xml <?xml version=”1.0″ encoding=”utf-8″?> <layer-list xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:id=”@android:id/secondaryProgress”> … Read more

How to Create a circular progressbar in Android which rotates on it?

Here are my two solutions. Short answer: Instead of creating a layer-list, I separated it into two files. One for ProgressBar and one for its background. This is the ProgressDrawable file (@drawable folder): circular_progress_bar.xml <?xml version=”1.0″ encoding=”utf-8″?> <rotate xmlns:android=”http://schemas.android.com/apk/res/android” android:fromDegrees=”270″ android:toDegrees=”270″> <shape android:innerRadiusRatio=”2.5″ android:shape=”ring” android:thickness=”1dp” android:useLevel=”true”><!– this line fixes the issue for lollipop api 21 … Read more

How to change progress bar’s progress color in Android

For a horizontal ProgressBar, you can use a ColorFilter, too, like this: progressBar.getProgressDrawable().setColorFilter( Color.RED, android.graphics.PorterDuff.Mode.SRC_IN); Note: This modifies the appearance of all progress bars in your app. To only modify one specific progress bar, do this: Drawable progressDrawable = progressBar.getProgressDrawable().mutate(); progressDrawable.setColorFilter(Color.RED, android.graphics.PorterDuff.Mode.SRC_IN); progressBar.setProgressDrawable(progressDrawable); If progressBar is indeterminate then use getIndeterminateDrawable() instead of getProgressDrawable(). Since Lollipop … Read more