Here is the xml portion:
<ProgressBar
android:layout_width="50dp"
android:layout_height="match_parent"
android:padding="15dp"
android:layout_marginEnd="5dp"
android:layout_alignParentEnd="true"
android:visibility="gone"
android:indeterminateTint="@color/colorPrimary"
android:id="@+id/progressBar"
android:indeterminate="true" />
I am using this to show and hide the progress bar:
progressBar.setVisibility(View.GONE);
progressBar.setVisibility(View.VISIBLE);
This is working just as I want it to on newer phones, but on API 21 and 22 the progress bar is never made visible.
Progress bar supports two modes to represent progress: determinate, and indeterminate. For a visual overview of the difference between determinate and indeterminate progress modes, see Progress & activity. Display progress bars to a user in a non-interruptive way.
Indeterminate Progress Bar is a user interface that shows the progress of an operation on the screen until the task completes. There are two modes in which you can show the progress of an operation on the screen. In this Android Indeterminate Progress Bar example, we will discuss in detail.
There are 2 types of progress bars: determinate and indeterminate. The former is used when the amount of information that needs to be loaded is detectable. The latter is used when the system is unsure how much needs to be loaded or how long it will take.
The primary progress is the current playing time of the video, while the secondary progress is the downloaded part of the video.
Adding android:indeterminateTintMode="src_in"
fixed it:
<ProgressBar
android:layout_width="50dp"
android:layout_height="match_parent"
android:padding="15dp"
android:layout_marginEnd="5dp"
android:layout_alignParentEnd="true"
android:visibility="gone"
android:indeterminateTint="@color/colorPrimary"
android:indeterminateTintMode="src_in"
android:id="@+id/progressBar"
android:indeterminate="true" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With