2

I want to create horizontal indeterminate progress drawable with round corners for progress bar in android. How to create that using xml?

Edit 1: I am using following drawable:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
    <shape>
        <solid android:color="?attr/dividerAndProgressColor" />
        <corners android:radius="20dp" />
    </shape>
</item>

<item android:id="@android:id/secondaryProgress">
    <clip>
        <shape>
            <solid android:color="?attr/secondaryText" />
            <corners android:radius="20dp" />
        </shape>
    </clip>
</item>
<item
    android:id="@android:id/progress"
    >
    <clip>
        <shape>
            <solid android:color="?attr/secondaryText" />
            <corners android:radius="20dp" />
        </shape>
    </clip>
</item>

</layer-list>


android:indeterminateDrawable="@drawable/progress_drawable_start_end_indeterminate"

But there is one problem, animation starts from 0 reaches 100 and then restarts. This is not desired in case of indeterminate progressbar.

Chaitanya Karmarkar
  • 1,425
  • 2
  • 7
  • 18

1 Answers1

1

round corner lookout this, https://stackoverflow.com/a/42646939/12709358

<ProgressBar
    android:id="@+id/progressbar_horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:indeterminateOnly="true"
    android:indeterminateDrawable="@drawable/progressbar_indeterminate_horizontal"
    android:progressDrawable="@drawable/progressbar_horizontal"
    android:minHeight="24dip"
    android:maxHeight="24dip" 
   />

also see this, https://stackoverflow.com/a/63463786/12709358

Elango
  • 406
  • 3
  • 11