Last active
August 5, 2017 20:05
-
-
Save StKotok/d050faa1c3ab57e9ec6bca66c38d7e36 to your computer and use it in GitHub Desktop.
selector for ListView with custom highlight effect API<21
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"> | |
<!-- Selected --> | |
<item android:state_focused="true" android:state_pressed="false"> | |
<shape> | |
<solid android:color="#00ffffff" /> | |
</shape> | |
</item> | |
<!-- Pressed --> | |
<item android:state_pressed="true"> | |
<shape> | |
<solid android:color="#0b000000" /> | |
<corners android:radius="6dp" /> | |
</shape> | |
</item> | |
</selector> | |
------------- layout.xml --------------- | |
<ListView | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:drawSelectorOnTop="true" | |
android:listSelector="@drawable/list_selector" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment