[Android] Ripple selector for RecyclerView+ListView

Geoffrey Métais git at videolan.org
Mon Apr 27 10:57:47 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Apr 27 10:53:53 2015 +0200| [47c330e65989fe65e62fd1926934b0f238821ab8] | committer: Geoffrey Métais

Ripple selector for RecyclerView+ListView

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=47c330e65989fe65e62fd1926934b0f238821ab8
---

 vlc-android/res/drawable-v21/background_item.xml |    3 ++-
 vlc-android/res/layout/directory_view_item.xml   |    6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/vlc-android/res/drawable-v21/background_item.xml b/vlc-android/res/drawable-v21/background_item.xml
index 176eb68..38b2576 100644
--- a/vlc-android/res/drawable-v21/background_item.xml
+++ b/vlc-android/res/drawable-v21/background_item.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <ripple xmlns:android="http://schemas.android.com/apk/res/android"
     android:color="@color/orange500">
-    <item android:drawable="@color/orange300" />
+    <item android:state_selected="true" android:drawable="@color/orange400" />
+    <item android:state_selected="true" android:drawable="?android:windowBackground" />
 </ripple>
\ No newline at end of file
diff --git a/vlc-android/res/layout/directory_view_item.xml b/vlc-android/res/layout/directory_view_item.xml
index 3005275..1150ad3 100644
--- a/vlc-android/res/layout/directory_view_item.xml
+++ b/vlc-android/res/layout/directory_view_item.xml
@@ -3,7 +3,11 @@
     android:id="@+id/layout_item"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
-    android:orientation="horizontal" >
+    android:orientation="horizontal"
+    android:focusable="true"
+    android:focusableInTouchMode="true"
+    android:clickable="true"
+    android:background="@drawable/background_item">
 
     <ImageView
         android:id="@+id/dvi_icon"



More information about the Android mailing list