Created
October 27, 2023 08:55
-
-
Save Radiokot/7312e9aafdc37999cee68ba804453574 to your computer and use it in GitHub Desktop.
Android horizontal progress bar with rounded corners
This file contains 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
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item | |
android:id="@android:id/background" | |
android:bottom="1dp" | |
android:left="1dp" | |
android:right="1dp" | |
android:top="1dp"> | |
<!-- 1 dp padding makes the background thinner --> | |
<shape> | |
<corners android:radius="1dp" /> | |
<solid android:color="@color/progress_background" /> | |
</shape> | |
</item> | |
<item android:id="@android:id/progress"> | |
<scale android:scaleWidth="100%"> | |
<shape> | |
<!-- For circular endings, the radius must be a half of the heigh --> | |
<corners android:radius="2dp" /> | |
<solid android:color="@color/progress_level" /> | |
</shape> | |
</scale> | |
</item> | |
</layer-list> |
Author
Radiokot
commented
Oct 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment