Rounded Corner Progressbar on App Widgets

Viewed 51

I am creating a widget for my app. Currently I am just using a normal Horizontal ProgressBar. It works just fine. But I was finding a way to make the corners of the progress bar round. As the remoteviews are limited to specific things, I cannot use a custom progressbar. So can anyone point me a way to make the progressbars round on my appwidget. Really Appreciate it.

I did try to use a RelativeLayout as a progressbar by changing its width on runtime. But changing width on runtime was only possible for API 31+

1 Answers

You can try the LinearProgressIndicator :

enter image description here

    <com.google.android.material.progressindicator.LinearProgressIndicator
        android:id="@+id/loadingProgressBar"
        android:layout_width="match_parent"
        android:layout_height="30dp"
        android:layout_marginTop="10dp"
        android:indeterminate="true"
        app:indicatorColor="@color/white"
        app:trackColor="@color/black"
        app:trackCornerRadius="6dp"
        app:trackThickness="12dp" />
Related