This is my custom white-transparent wheel ProgressBar
progressbar_circle.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="ring"
android:innerRadiusRatio="2.5"
android:thickness="4dp"
android:useLevel="false">
<gradient
android:type="sweep"
android:startColor="@android:color/white"
android:centerColor="@android:color/white"
android:endColor="@android:color/transparent"
/>
</shape>
In the preview window of Android studio, this element has showed correctly.
But after debug testing in both emulator (Android 9) and device (Android 6), ProgressBar showed as @color/colorAccent wheel Progressbar.
I have tried to change android:shape, android:innerRadiusRatio, android:thickness, even change gradient to solid color. Nothing changed.
Here is my progress_task_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/correct_icon"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/correct_icon"
android:padding="@dimen/padding_large"
android:visibility="gone" />
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="8dp"
android:padding="@dimen/padding_large"
android:progressDrawable="@drawable/progressbar_circle"
android:visibility="gone" />
</RelativeLayout>
How to accomplish custom android ProgressBar on xml without dynamically programming in java?
android:indeterminateTint="@android:color/white"
– Nongthonbam Tonthoi Feb 16 '19 at 12:30android:indeterminateTint="@android:color/white"
worked for solid color, how about the gradient one. (I will handle with the old api version later.) – Shinoyakame Feb 16 '19 at 12:45