[Android] Change action bar size according to device

Geoffrey Métais git at videolan.org
Tue Jan 22 15:10:33 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jan 22 14:56:18 2019 +0100| [3c19298b7dddb062e163d358fd50125aff0ef698] | committer: Geoffrey Métais

Change action bar size according to device

> https://code.videolan.org/videolan/vlc-android/commit/3c19298b7dddb062e163d358fd50125aff0ef698
---

 vlc-android/res/layout/about.xml             | 3 +--
 vlc-android/res/layout/info_activity.xml     | 2 +-
 vlc-android/res/layout/playlist_activity.xml | 2 +-
 vlc-android/res/layout/tab_layout.xml        | 2 +-
 vlc-android/res/layout/toolbar.xml           | 2 +-
 vlc-android/res/values-h480dp/dimens.xml     | 2 ++
 vlc-android/res/values-h600dp/dimens.xml     | 2 ++
 vlc-android/res/values-land/dimens.xml       | 5 -----
 vlc-android/res/values/dimens.xml            | 3 ++-
 9 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/vlc-android/res/layout/about.xml b/vlc-android/res/layout/about.xml
index f4a98f1d3..898ef6726 100644
--- a/vlc-android/res/layout/about.xml
+++ b/vlc-android/res/layout/about.xml
@@ -2,8 +2,7 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@android:id/tabcontent"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:paddingBottom="@dimen/actionBarSize">
+    android:layout_height="match_parent">
     <androidx.viewpager.widget.ViewPager
         android:id="@+id/pager"
         android:layout_width="match_parent"
diff --git a/vlc-android/res/layout/info_activity.xml b/vlc-android/res/layout/info_activity.xml
index 63a2a28c7..798b7213b 100644
--- a/vlc-android/res/layout/info_activity.xml
+++ b/vlc-android/res/layout/info_activity.xml
@@ -64,7 +64,7 @@
                 <androidx.appcompat.widget.Toolbar
                     android:id="@+id/main_toolbar"
                     android:layout_width="match_parent"
-                    android:layout_height="?attr/actionBarSize"
+                    android:layout_height="@dimen/toolbar_height"
                     vlc:navigationContentDescription="@string/abc_action_bar_up_description"
                     vlc:popupTheme="?attr/toolbar_popup_style"
                     vlc:theme="@style/Toolbar.VLC"
diff --git a/vlc-android/res/layout/playlist_activity.xml b/vlc-android/res/layout/playlist_activity.xml
index f2fd0d14f..2dc38f2ae 100644
--- a/vlc-android/res/layout/playlist_activity.xml
+++ b/vlc-android/res/layout/playlist_activity.xml
@@ -43,7 +43,7 @@
                 <androidx.appcompat.widget.Toolbar
                     android:id="@+id/main_toolbar"
                     android:layout_width="match_parent"
-                    android:layout_height="?attr/actionBarSize"
+                    android:layout_height="@dimen/toolbar_height"
                     vlc:navigationContentDescription="@string/abc_action_bar_up_description"
                     vlc:popupTheme="?attr/toolbar_popup_style"
                     vlc:theme="@style/Toolbar.VLC"
diff --git a/vlc-android/res/layout/tab_layout.xml b/vlc-android/res/layout/tab_layout.xml
index ac8909bcf..8416eb117 100644
--- a/vlc-android/res/layout/tab_layout.xml
+++ b/vlc-android/res/layout/tab_layout.xml
@@ -3,7 +3,7 @@
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:id="@+id/sliding_tabs"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content"
+    android:layout_height="@dimen/tab_layout_height"
     android:background="?attr/background_actionbar"
     app:tabMode="scrollable"
     app:tabSelectedTextColor="?attr/font_actionbar_selected"
diff --git a/vlc-android/res/layout/toolbar.xml b/vlc-android/res/layout/toolbar.xml
index 2312d3b78..0256b379a 100644
--- a/vlc-android/res/layout/toolbar.xml
+++ b/vlc-android/res/layout/toolbar.xml
@@ -11,7 +11,7 @@
     <androidx.appcompat.widget.Toolbar
         android:id="@+id/main_toolbar"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
+        android:layout_height="@dimen/toolbar_height"
         app:navigationContentDescription="@string/abc_action_bar_up_description"
         app:theme="@style/Toolbar.VLC"
         app:popupTheme="?attr/toolbar_popup_style"
diff --git a/vlc-android/res/values-h480dp/dimens.xml b/vlc-android/res/values-h480dp/dimens.xml
index a27e5f6d2..b8599eb1b 100644
--- a/vlc-android/res/values-h480dp/dimens.xml
+++ b/vlc-android/res/values-h480dp/dimens.xml
@@ -3,4 +3,6 @@
     <dimen name="info_appbar_height">300dp</dimen>
     <dimen name="audio_player_cover_margin">16dp</dimen>
     <dimen name="subs_dl_dialog_height">350dp</dimen>
+    <dimen name="toolbar_height">40dp</dimen>
+    <dimen name="tab_layout_height">32dp</dimen>
 </resources>
\ No newline at end of file
diff --git a/vlc-android/res/values-h600dp/dimens.xml b/vlc-android/res/values-h600dp/dimens.xml
index 07ef0127c..d6d167335 100644
--- a/vlc-android/res/values-h600dp/dimens.xml
+++ b/vlc-android/res/values-h600dp/dimens.xml
@@ -2,4 +2,6 @@
 <resources>
     <dimen name="subs_dl_dialog_height">448dp</dimen>
     <dimen name="audio_player_seekbar_bottom_margin">32dp</dimen>
+    <dimen name="toolbar_height">-2px</dimen>
+    <dimen name="tab_layout_height">-2px</dimen>
 </resources>
\ No newline at end of file
diff --git a/vlc-android/res/values-land/dimens.xml b/vlc-android/res/values-land/dimens.xml
deleted file mode 100644
index 094fb9bd4..000000000
--- a/vlc-android/res/values-land/dimens.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<resources>
-    <!-- Default -->
-    <dimen name="actionBarSize">48dp</dimen>
-
-</resources>
\ No newline at end of file
diff --git a/vlc-android/res/values/dimens.xml b/vlc-android/res/values/dimens.xml
index 7a06b6008..c6584e710 100644
--- a/vlc-android/res/values/dimens.xml
+++ b/vlc-android/res/values/dimens.xml
@@ -60,7 +60,6 @@
     <dimen name="info_progress_end_margin">74dp</dimen>
     <dimen name="info_default_margin">16dp</dimen>
 
-    <dimen name="actionBarSize">56dp</dimen>
     <dimen name="info_dialog_peek_height">120dip</dimen>
     <dimen name="player_peek_height">61dip</dimen>
 
@@ -88,4 +87,6 @@
 
     <dimen name="default_margin_plus_audio_margin">24dp</dimen>
     <dimen name="audio_player_seekbar_bottom_margin">16dp</dimen>
+    <dimen name="toolbar_height">40dp</dimen>
+    <dimen name="tab_layout_height">24dp</dimen>
 </resources>
\ No newline at end of file



More information about the Android mailing list