Here is the xml part:
<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 use this to show and hide the progress bar:
progressBar.setVisibility(View.GONE);
progressBar.setVisibility(View.VISIBLE);
This works the same as I want on new phones, but on API 21 and 22, the progress bar never becomes visible.
source
share