Skip to content

Instantly share code, notes, and snippets.

@alexfu
Created January 12, 2016 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexfu/7512da07e81dab7fe32f to your computer and use it in GitHub Desktop.
Save alexfu/7512da07e81dab7fe32f to your computer and use it in GitHub Desktop.
v21 checkable selector with ripples
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/mycolor">
<item android:id="@+id/mask">
<color android:color="@android:color/white" />
</item>
</ripple>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_activated="true" android:drawable="@color/mycolor"/>
<item android:drawable="@drawable/ripple_item_background"/>
</selector>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment