The height is determined by the android:layout_height="wrap_content
attribute android:layout_height="wrap_content
. For example, you can set it to 2dp to create a thinner progress bar.
Changing the color will be a little harder as you use gradients. Thus, you have to change the color of the beginning and end to some kind of blue color.
What i use
<ProgressBar android:id="@+id/progressbar" style="?android:attr/progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="4dp" android:layout_marginTop="0.01dp" android:max="100" android:progress="50" android:progressDrawable="@drawable/myprogressbar" android:secondaryProgress="0" />
MyProgressBar.xml in the dropdown folder
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background"> <shape> <corners android:radius="0dip" /> <gradient android:startColor="#C0C0C0" android:centerColor="#F8F8FF" android:centerY="0.75" android:endColor="#ffffff" android:angle="90" /> <stroke android:width="0.01dp" android:color="#6B8E23" /> </shape> </item> <item android:id="@android:id/progress"> <clip> <shape> <corners android:radius="0dip" /> <gradient android:startColor="#9ACD32" android:endColor="#FFFF00" android:angle="90" /> <stroke android:width="1dp" android:color="#6B8E23" /> </shape> </clip> </item> </layer-list>
Replace the color codes with your own blue color codes:
android: startColor = "# C0C0C0" android: centerColor = "# F8F8FF" android: ENDCOLOR = "# FFFFFF"
source share