To make the layout interactive and to look good, we need to modify the default of certain widgets. Here is the simple customisation of the progress bar:-
Step 1:- Create a drawable xml say customised_progress.xml
<?xml version="1.0" encoding="utf-8"?>
<rotate
xmlns:android="http://schemas.android.com/apk/res/android"
android:pivotX="50%"
android:pivotY="50%"
android:fromDegrees="0"
android:toDegrees="360">
<shape
android:shape="ring"
android:innerRadiusRatio="3"
android:thicknessRatio="8"
android:useLevel="false">
<size
android:width="76dip"
android:height="76dip" />
<gradient
android:type="sweep"
android:useLevel="false"
android:startColor="@color/white"
android:endColor="@color/white"
android:angle="0"/>
</shape>
</rotate>
Step 2:- Add the above customised drawable in your progress bar.
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/customised_progress" />
0 Comment(s)