Last active
August 25, 2017 06:48
-
-
Save AlbertVilaCalvo/10f1d5af388f631d3d3f852f411ac2b0 to your computer and use it in GitHub Desktop.
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
// WITH SHAPE RECTANGLE | |
// drawable-v21/bg_rectangle_green.xml | |
<?xml version="1.0" encoding="utf-8"?> | |
<ripple xmlns:android="http://schemas.android.com/apk/res/android" | |
android:color="@color/white"> | |
<item> | |
<shape android:shape="rectangle"> | |
<solid android:color="@color/green"/> | |
</shape> | |
</item> | |
</ripple> | |
// drawable/bg_rectangle_green.xml | |
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:state_pressed="true"> | |
<shape android:shape="rectangle"> | |
<solid android:color="@color/green_pressed"/> | |
</shape> | |
</item> | |
<item> | |
<shape android:shape="rectangle"> | |
<solid android:color="@color/green"/> | |
</shape> | |
</item> | |
</selector> | |
// WITH*OUT* SHAPE RECTANGLE | |
// drawable-v21/bg_green.xml | |
<?xml version="1.0" encoding="utf-8"?> | |
<ripple xmlns:android="http://schemas.android.com/apk/res/android" | |
android:color="@color/white"> | |
<item> | |
<color android:color="@color/green"/> | |
</item> | |
</ripple> | |
// drawable/bg_green.xml | |
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:state_pressed="true"> | |
<color android:color="@color/green_pressed"/> | |
</item> | |
<item> | |
<color android:color="@color/green"/> | |
</item> | |
</selector> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment