[Android] [PATCH] MainActivity, SidebarAdapter, & ActionBar: focus related resource improvements
Mik Amchislavsky
hailmikhail at gmail.com
Mon Oct 13 13:39:01 CEST 2014
---
vlc-android/res/layout/audio_albums_songs.xml | 2 ++
vlc-android/res/layout/main.xml | 7 ++++++-
vlc-android/res/layout/sidebar.xml | 3 ++-
vlc-android/res/menu-v10/media_library.xml | 4 ++++
vlc-android/res/menu-v13/media_library.xml | 4 ++++
vlc-android/res/menu-v7/media_library.xml | 4 ++++
6 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/vlc-android/res/layout/audio_albums_songs.xml b/vlc-android/res/layout/audio_albums_songs.xml
index 9676501..a0e51c1 100644
--- a/vlc-android/res/layout/audio_albums_songs.xml
+++ b/vlc-android/res/layout/audio_albums_songs.xml
@@ -35,6 +35,7 @@
android:paddingBottom="@dimen/listview_bottom_padding"
android:paddingLeft="20dp"
android:paddingRight="20dp"
+ android:nextFocusUp="@+id/ml_menu_search"
android:nextFocusDown="@id/albums"
android:nextFocusLeft="@id/albums"
android:nextFocusRight="@id/albums" />
@@ -48,6 +49,7 @@
android:paddingBottom="@dimen/listview_bottom_padding"
android:paddingLeft="20dp"
android:paddingRight="20dp"
+ android:nextFocusUp="@+id/ml_menu_search"
android:nextFocusDown="@id/songs"
android:nextFocusLeft="@id/songs"
android:nextFocusRight="@id/songs" />
diff --git a/vlc-android/res/layout/main.xml b/vlc-android/res/layout/main.xml
index 069624a..f5cec39 100644
--- a/vlc-android/res/layout/main.xml
+++ b/vlc-android/res/layout/main.xml
@@ -3,7 +3,12 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root_container"
android:layout_width="match_parent"
- android:layout_height="match_parent" >
+ android:layout_height="match_parent"
+ android:nextFocusLeft="@+id/ml_menu_search"
+ android:nextFocusRight="@+id/ml_menu_search"
+ android:nextFocusUp="@+id/ml_menu_search"
+ android:nextFocusDown="@+id/ml_menu_search"
+ android:nextFocusForward="@+id/ml_menu_search">
<org.videolan.vlc.widget.SlidingPaneLayout
xmlns:android="http://schemas.android.com/apk/res/android"
diff --git a/vlc-android/res/layout/sidebar.xml b/vlc-android/res/layout/sidebar.xml
index 6d420c0..d01839b 100644
--- a/vlc-android/res/layout/sidebar.xml
+++ b/vlc-android/res/layout/sidebar.xml
@@ -11,7 +11,8 @@
android:cacheColorHint="#0000"
android:fastScrollEnabled="true"
android:background="?attr/background_menu"
- android:nextFocusUp="@+id/ml_menu_search"
+ android:nextFocusForward="@id/sidelist"
+ android:nextFocusUp="@id/sidelist"
android:nextFocusDown="@id/sidelist"
android:nextFocusLeft="@id/sidelist"
android:nextFocusRight="@id/sidelist" >
diff --git a/vlc-android/res/menu-v10/media_library.xml b/vlc-android/res/menu-v10/media_library.xml
index 856e35a..9e629ed 100644
--- a/vlc-android/res/menu-v10/media_library.xml
+++ b/vlc-android/res/menu-v10/media_library.xml
@@ -6,11 +6,13 @@
android:id="@+id/ml_menu_search"
android:icon="@drawable/ic_menu_search_wb"
android:title="@string/searchable_hint"
+ android:nextFocusDown="@id/ml_menu_search"
vlc:showAsAction="ifRoom" />
<item
android:id="@+id/ml_menu_open_mrl"
android:icon="@drawable/ic_menu_goto_wb"
android:title="@string/open_mrl"
+ android:nextFocusDown="@id/ml_menu_open_mrl"
vlc:showAsAction="ifRoom" />
<item
android:title="@string/sortby"
@@ -29,11 +31,13 @@
android:id="@+id/ml_menu_last_playlist"
android:icon="@drawable/ic_menu_revert_wb"
android:title="@string/last_playlist"
+ android:nextFocusDown="@id/ml_menu_last_playlist"
vlc:showAsAction="ifRoom" />
<item
android:id="@+id/ml_menu_refresh"
android:icon="@drawable/ic_menu_refresh_wb"
android:title="@string/refresh"
+ android:nextFocusDown="@id/ml_menu_refresh"
vlc:showAsAction="ifRoom" />
<item
android:id="@+id/ml_menu_equalizer"
diff --git a/vlc-android/res/menu-v13/media_library.xml b/vlc-android/res/menu-v13/media_library.xml
index 2c434b0..fab1fc5 100644
--- a/vlc-android/res/menu-v13/media_library.xml
+++ b/vlc-android/res/menu-v13/media_library.xml
@@ -6,11 +6,13 @@
android:id="@+id/ml_menu_search"
android:icon="@drawable/ic_menu_search"
android:title="@string/searchable_hint"
+ android:nextFocusDown="@id/ml_menu_search"
vlc:showAsAction="ifRoom" />
<item
android:id="@+id/ml_menu_open_mrl"
android:icon="@drawable/ic_menu_goto"
android:title="@string/open_mrl"
+ android:nextFocusDown="@id/ml_menu_open_mrl"
vlc:showAsAction="ifRoom" />
<item
android:title="@string/sortby"
@@ -29,11 +31,13 @@
android:id="@+id/ml_menu_last_playlist"
android:icon="@drawable/ic_menu_revert"
android:title="@string/last_playlist"
+ android:nextFocusDown="@id/ml_menu_last_playlist"
vlc:showAsAction="ifRoom" />
<item
android:id="@+id/ml_menu_refresh"
android:icon="@drawable/ic_menu_refresh"
android:title="@string/refresh"
+ android:nextFocusDown="@id/ml_menu_refresh"
vlc:showAsAction="ifRoom" />
<item
android:id="@+id/ml_menu_equalizer"
diff --git a/vlc-android/res/menu-v7/media_library.xml b/vlc-android/res/menu-v7/media_library.xml
index 856e35a..9e629ed 100644
--- a/vlc-android/res/menu-v7/media_library.xml
+++ b/vlc-android/res/menu-v7/media_library.xml
@@ -6,11 +6,13 @@
android:id="@+id/ml_menu_search"
android:icon="@drawable/ic_menu_search_wb"
android:title="@string/searchable_hint"
+ android:nextFocusDown="@id/ml_menu_search"
vlc:showAsAction="ifRoom" />
<item
android:id="@+id/ml_menu_open_mrl"
android:icon="@drawable/ic_menu_goto_wb"
android:title="@string/open_mrl"
+ android:nextFocusDown="@id/ml_menu_open_mrl"
vlc:showAsAction="ifRoom" />
<item
android:title="@string/sortby"
@@ -29,11 +31,13 @@
android:id="@+id/ml_menu_last_playlist"
android:icon="@drawable/ic_menu_revert_wb"
android:title="@string/last_playlist"
+ android:nextFocusDown="@id/ml_menu_last_playlist"
vlc:showAsAction="ifRoom" />
<item
android:id="@+id/ml_menu_refresh"
android:icon="@drawable/ic_menu_refresh_wb"
android:title="@string/refresh"
+ android:nextFocusDown="@id/ml_menu_refresh"
vlc:showAsAction="ifRoom" />
<item
android:id="@+id/ml_menu_equalizer"
--
1.7.9.5
More information about the Android
mailing list