[Android] Show about in left menu panel

Geoffrey Métais git at videolan.org
Fri Jan 23 17:10:38 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jan 23 12:03:23 2015 +0100| [1ba2a70bc97d9c4b8cdcc95b7fcbcb40b815ba4c] | committer: Geoffrey Métais

Show about in left menu panel

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

 vlc-android/res/layout/sidebar.xml                 |   38 ++++++++++++++++++--
 vlc-android/res/menu/media_library.xml             |    4 ---
 .../src/org/videolan/vlc/gui/MainActivity.java     |    9 ++---
 3 files changed, 41 insertions(+), 10 deletions(-)

diff --git a/vlc-android/res/layout/sidebar.xml b/vlc-android/res/layout/sidebar.xml
index ff2a7ff..dfe586e 100644
--- a/vlc-android/res/layout/sidebar.xml
+++ b/vlc-android/res/layout/sidebar.xml
@@ -14,7 +14,7 @@
             android:dividerHeight="0.2dp"
             android:paddingTop="?attr/actionBarSize"
             android:cacheColorHint="#0000"
-            android:layout_above="@+id/sidebar_separator"
+            android:layout_above="@+id/sidebar_separator_about"
             android:nextFocusForward="@id/sidelist"
             android:nextFocusUp="@id/sidelist"
             android:nextFocusDown="@id/sidelist"
@@ -23,7 +23,41 @@
         </ListView>
 
         <View
-            android:id="@+id/sidebar_separator"
+            android:id="@+id/sidebar_separator_about"
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:layout_above="@+id/about"
+            android:background="?attr/playlist_item_footer" />
+
+        <ImageView
+            android:id="@+id/about_icon"
+            android:layout_width="32dp"
+            android:layout_height="32dp"
+            android:layout_alignParentLeft="true"
+            android:layout_above="@+id/sidebar_separator_settings"
+            android:layout_margin="10dp"
+            android:clickable="true"
+            android:onClick="onClick"
+            android:src="@drawable/ic_cone_o"/>
+
+        <TextView
+            android:id="@+id/about"
+            android:layout_width="match_parent"
+            android:layout_height="32dp"
+            android:layout_toRightOf="@+id/about_icon"
+            android:layout_above="@+id/sidebar_separator_settings"
+            android:gravity="left|center_vertical"
+            android:layout_marginTop="10dp"
+            android:layout_marginBottom="10dp"
+            android:clickable="true"
+            android:onClick="onClick"
+            android:text="@string/about"
+            android:textColor="?attr/list_menu"
+            android:textSize="16sp"
+            android:fontFamily="sans-serif"/>
+
+        <View
+            android:id="@+id/sidebar_separator_settings"
             android:layout_width="match_parent"
             android:layout_height="1dp"
             android:layout_above="@+id/settings"
diff --git a/vlc-android/res/menu/media_library.xml b/vlc-android/res/menu/media_library.xml
index 95edd9f..6453721 100644
--- a/vlc-android/res/menu/media_library.xml
+++ b/vlc-android/res/menu/media_library.xml
@@ -45,10 +45,6 @@
         android:icon="@drawable/ic_menu_equalizer"
         android:title="@string/equalizer" />
     <item
-        android:id="@+id/ml_menu_about"
-        android:icon="@drawable/ic_menu_info"
-        android:title="@string/about" />
-    <item
         android:title="@string/clear_history"
         android:visible="false"
         android:icon="@android:drawable/ic_menu_close_clear_cancel"
diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index fceccb4..4086578 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -592,10 +592,6 @@ public class MainActivity extends ActionBarActivity implements OnItemClickListen
                     ? VideoListAdapter.SORT_BY_TITLE
                     : VideoListAdapter.SORT_BY_LENGTH);
                 break;
-            // About
-            case R.id.ml_menu_about:
-                showSecondaryFragment("about");
-                break;
             case R.id.ml_menu_equalizer:
                 showSecondaryFragment("equalizer");
                 break;
@@ -979,7 +975,12 @@ public class MainActivity extends ActionBarActivity implements OnItemClickListen
             case R.id.settings_icon:
                 startActivityForResult(new Intent(mContext, PreferencesActivity.class), ACTIVITY_RESULT_PREFERENCES);
                 break;
+            case R.id.about:
+            case R.id.about_icon:
+                showSecondaryFragment("about");
+                break;
         }
+        mRootContainer.closeDrawer(mSideMenu);
     }
 
     @Override



More information about the Android mailing list