Skip to content

Instantly share code, notes, and snippets.

@fnk0
Created March 14, 2016 18:22
Show Gist options
  • Select an option

  • Save fnk0/ebcf61a1459fa0b17bf3 to your computer and use it in GitHub Desktop.

Select an option

Save fnk0/ebcf61a1459fa0b17bf3 to your computer and use it in GitHub Desktop.
Example of a shape in android with different states
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true">
<shape>
<solid android:color="@color/primary_dark" />
</shape>
</item>
<item android:state_pressed="true">
<shape>
<solid android:color="@color/primary_dark" />
</shape>
</item>
<item>
<shape>
<solid android:color="@color/primary" />
</shape>
</item>
</selector>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment