Saturday, April 11, 2020

Circle progressbar

XML Code :

<?xml version="1.0" encoding="utf-8" ?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:fromDegrees="120.0" android:toDegrees="140.0" android:pivotX="50.0%" android:pivotY="50.0%">
<item android:id="@android:id/background">
<shape android:shape="ring" android:innerRadiusRatio="2.3" android:thicknessRatio="8.0" android:useLevel="false" android:angle="0.0" android:type="sweep">
<solid android:color="#E0E0E0" />
</shape>
</item>
<item android:id="@android:id/progress">
<rotate android:fromDegrees="270.0" android:toDegrees="270.0">
<shape android:shape="ring" android:innerRadiusRatio="2.3" android:thicknessRatio="8.0" android:angle="0.0" android:type="sweep">
<solid android:color="#304ffe" />
</shape>
</rotate>
</item>
</layer-list>

Java/source code :

progressbar1.setProgressDrawable(getDrawable(R.drawable.circle_progress));

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home