Android Material Design rounded progress_bar -
i´m working on app wich uses different progress bars, , want them ones in google fit, rounded cornes. have custom drawable each bar different colors, , rounds outside corners not inside corners, can see here: custom drawable is:
<?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> <corners android:radius="@dimen/progress_bar_rounded" /> <solid android:color="@color/progressbarbackground" /> </shape> </item> <item android:id="@android:id/progress"> <clip> <shape> <corners android:radius="@dimen/progress_bar_rounded" /> <solid android:color="@color/progressbargreen" /> </shape> </clip> </item> </layer-list>
an progress bars code is:
<progressbar style="?android:attr/progressbarstylehorizontal" android:layout_width="fill_parent" android:layout_height="@dimen/progress_bar_high" android:id="@+id/greenprogressbar" android:indeterminate="false" android:layout_marginleft="15dp" android:layout_gravity="center_vertical" android:progressdrawable="@drawable/custom_green_progressbar" />
i use libraries https://github.com/akexorcist/android-roundcornerprogressbar , such simple thing think it´s not worth it. have been looking on different threads, nothing has worked me. idea, without having work .9.png images, if possible?
thanks lot!
use scale
tag rather clip
:
<?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> <corners android:radius="@dimen/progress_bar_rounded" /> <solid android:color="@color/progressbarbackground" /> </shape> </item> <item android:id="@android:id/progress"> <scale android:scalewidth="100%" android:useintrinsicsizeasminimum="true"> <shape> <corners android:radius="@dimen/progress_bar_rounded" /> <solid android:color="@color/progressbargreen" /> <size android:width="@dimen/progress_bar_rounded"/> </shape> </scale> </item> </layer-list>
Comments
Post a Comment