Progress bar running on Android API 23 but not 21 or 22

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.

+4
source share
1 answer

Addition android:indeterminateTintMode="src_in"fixed:

<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" />
+6
source

Source: https://habr.com/ru/post/1664744/


All Articles