[Android] UI: fix selected item in lists
Sébastien Toque
git at videolan.org
Sun May 6 12:35:42 CEST 2012
android | branch: master | Sébastien Toque <xilasz at gmail.com> | Sun May 6 11:57:28 2012 +0200| [5f37161fd926ae00ba17e881ccd6daf9b0c2649f] | committer: Sébastien Toque
UI: fix selected item in lists
> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=5f37161fd926ae00ba17e881ccd6daf9b0c2649f
---
vlc-android/res/drawable/background_item1.xml | 29 +++++++++++++++++-------
vlc-android/res/drawable/background_item2.xml | 28 +++++++++++++++++-------
vlc-android/res/layout/media_info.xml | 1 +
3 files changed, 41 insertions(+), 17 deletions(-)
diff --git a/vlc-android/res/drawable/background_item1.xml b/vlc-android/res/drawable/background_item1.xml
index efce0be..3a04558 100644
--- a/vlc-android/res/drawable/background_item1.xml
+++ b/vlc-android/res/drawable/background_item1.xml
@@ -1,10 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <gradient
- android:angle="270"
- android:centerColor="@color/item_1"
- android:endColor="@color/item_common"
- android:startColor="@color/item_common" />
-
-</shape>
\ No newline at end of file
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true">
+ <shape>
+ <gradient
+ android:angle="270"
+ android:centerColor="@color/orange"
+ android:endColor="@color/item_common"
+ android:startColor="@color/item_common" />
+ </shape>
+ </item>
+ <item>
+ <shape>
+ <gradient
+ android:angle="270"
+ android:centerColor="@color/item_1"
+ android:endColor="@color/item_common"
+ android:startColor="@color/item_common" />
+ </shape>
+ </item>
+</selector>
diff --git a/vlc-android/res/drawable/background_item2.xml b/vlc-android/res/drawable/background_item2.xml
index 9662e8e..6831831 100644
--- a/vlc-android/res/drawable/background_item2.xml
+++ b/vlc-android/res/drawable/background_item2.xml
@@ -1,9 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <gradient
- android:angle="270"
- android:centerColor="@color/item_2"
- android:endColor="@color/item_common"
- android:startColor="@color/item_common" />
-</shape>
\ No newline at end of file
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true">
+ <shape>
+ <gradient
+ android:angle="270"
+ android:centerColor="@color/orange"
+ android:endColor="@color/item_common"
+ android:startColor="@color/item_common" />
+ </shape>
+ </item>
+ <item>
+ <shape>
+ <gradient
+ android:angle="270"
+ android:centerColor="@color/item_2"
+ android:endColor="@color/item_common"
+ android:startColor="@color/item_common" />
+ </shape>
+ </item>
+</selector>
diff --git a/vlc-android/res/layout/media_info.xml b/vlc-android/res/layout/media_info.xml
index bc126f9..600582c 100644
--- a/vlc-android/res/layout/media_info.xml
+++ b/vlc-android/res/layout/media_info.xml
@@ -67,6 +67,7 @@
android:layout_height="fill_parent"
android:cacheColorHint="#00000000"
android:divider="#00000000"
+ android:listSelector="@android:color/transparent"
android:fastScrollEnabled="true" />
</LinearLayout>
\ No newline at end of file
More information about the Android
mailing list