Last active
July 4, 2023 07:49
-
-
Save subinkrishna/20d5c373ce46572f901a to your computer and use it in GitHub Desktop.
A simple card background drawable for Android.
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
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:drawable="@drawable/background_card_selected" android:state_selected="true" /> | |
<item android:drawable="@drawable/background_card_selected" android:state_pressed="true" /> | |
<item android:drawable="@drawable/background_card_default" /> | |
</selector> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item> | |
<shape android:shape="rectangle"> | |
<solid android:color="@color/card_shadow"></solid> | |
</shape> | |
</item> | |
<item android:left="0dp" android:right="0dp" android:bottom="1dp"> | |
<shape android:shape="rectangle"> | |
<solid android:color="@color/card_background_default"></solid> | |
</shape> | |
</item> | |
</layer-list> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item> | |
<shape android:shape="rectangle"> | |
<solid android:color="@color/card_shadow"></solid> | |
</shape> | |
</item> | |
<item android:left="0dp" android:right="0dp" android:bottom="1dp"> | |
<shape android:shape="rectangle"> | |
<solid android:color="@color/card_background_selected"></solid> | |
</shape> | |
</item> | |
</layer-list> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<color name="card_shadow">#8000</color> | |
<color name="card_background_default">#F6F6F6</color> | |
<color name="card_background_selected">#CCC</color> | |
</resources> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment