Last active
November 23, 2020 03:06
-
-
Save DawnImpulse/d92c81d87736789e234fbd1c6e396e85 to your computer and use it in GitHub Desktop.
Creating gradient drawable for progress bar in android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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="5dp"/> | |
<solid android:color="#fff"/> | |
</shape> | |
</item> | |
<item android:id="@android:id/progress"> | |
<clip> | |
<shape> | |
<corners android:radius="5dp"/> | |
<gradient | |
android:endColor="@android:color/holo_red_dark" | |
android:startColor="@android:color/holo_orange_light" | |
/> | |
</shape> | |
</clip> | |
</item> | |
</layer-list> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ProgressBar | |
xmlns:tools="http://schemas.android.com/tools" | |
style="?android:attr/progressBarStyleHorizontal" | |
android:layout_width="match_parent" | |
android:layout_height="10dp" | |
android:progressDrawable="@drawable/gradient_progress" | |
tools:progress="60" | |
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment