[Android] Remove useless toolbar_height dimension and collapsing toolbar uniformization
Nicolas Pomepuy
git at videolan.org
Fri Jan 7 12:30:22 UTC 2022
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Dec 22 14:39:31 2021 +0100| [7d119c6593f7fbee984251f6f927ff026a8ef5ce] | committer: Nicolas Pomepuy
Remove useless toolbar_height dimension and collapsing toolbar uniformization
> https://code.videolan.org/videolan/vlc-android/commit/7d119c6593f7fbee984251f6f927ff026a8ef5ce
---
.../resources/src/main/res/values-h480dp/dimens.xml | 1 -
.../resources/src/main/res/values-h600dp/dimens.xml | 1 -
application/resources/src/main/res/values/dimens.xml | 1 -
application/vlc-android/AndroidManifest.xml | 2 +-
.../vlc-android/res/layout/playlist_activity.xml | 19 +++++++++++--------
application/vlc-android/res/layout/toolbar.xml | 2 +-
application/vlc-android/res/values/styles.xml | 2 --
7 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/application/resources/src/main/res/values-h480dp/dimens.xml b/application/resources/src/main/res/values-h480dp/dimens.xml
index ab9fe3993..e6c1c595e 100644
--- a/application/resources/src/main/res/values-h480dp/dimens.xml
+++ b/application/resources/src/main/res/values-h480dp/dimens.xml
@@ -3,7 +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>
<dimen name="audio_item_header_padding">8dp</dimen>
<dimen name="audio_item_padding_botom">8dp</dimen>
diff --git a/application/resources/src/main/res/values-h600dp/dimens.xml b/application/resources/src/main/res/values-h600dp/dimens.xml
index cbc5373eb..9ffda49c2 100644
--- a/application/resources/src/main/res/values-h600dp/dimens.xml
+++ b/application/resources/src/main/res/values-h600dp/dimens.xml
@@ -2,6 +2,5 @@
<resources>
<dimen name="subs_dl_dialog_height">448dp</dimen>
<dimen name="audio_player_seekbar_bottom_margin">32dp</dimen>
- <dimen name="toolbar_height">40dp</dimen>
<dimen name="tab_layout_height">-2px</dimen>
</resources>
\ No newline at end of file
diff --git a/application/resources/src/main/res/values/dimens.xml b/application/resources/src/main/res/values/dimens.xml
index 236bd53dd..c630798c1 100644
--- a/application/resources/src/main/res/values/dimens.xml
+++ b/application/resources/src/main/res/values/dimens.xml
@@ -98,7 +98,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>
<!-- Audio items -->
diff --git a/application/vlc-android/AndroidManifest.xml b/application/vlc-android/AndroidManifest.xml
index 88e734d24..dbe041fe7 100644
--- a/application/vlc-android/AndroidManifest.xml
+++ b/application/vlc-android/AndroidManifest.xml
@@ -473,7 +473,7 @@
android:windowSoftInputMode="adjustPan"/>
<activity
android:name=".gui.PlaylistActivity"
- android:theme="@style/Theme.VLC"/>
+ android:theme="@style/Theme.VLC.NoStatus"/>
<activity
android:name=".gui.InfoActivity"
android:theme="@style/Theme.VLC.NoStatus"/>
diff --git a/application/vlc-android/res/layout/playlist_activity.xml b/application/vlc-android/res/layout/playlist_activity.xml
index fb328f213..6e81b400b 100644
--- a/application/vlc-android/res/layout/playlist_activity.xml
+++ b/application/vlc-android/res/layout/playlist_activity.xml
@@ -22,27 +22,30 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ android:layout_height="@dimen/info_appbar_height"
+ android:fitsSystemWindows="true">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:fitsSystemWindows="true"
- vlc:title="@{playlist.title}"
- vlc:theme="@style/Toolbar.VLC"
+ android:keyboardNavigationCluster="true"
+ tools:targetApi="O"
vlc:contentScrim="?attr/background_actionbar"
vlc:expandedTitleMarginEnd="64dp"
vlc:expandedTitleMarginStart="48dp"
vlc:expandedTitleTextAppearance="@style/TextAppearance.Design.CollapsingToolbar.Expanded.Shadow"
vlc:layout_scrollFlags="scroll|exitUntilCollapsed"
- android:keyboardNavigationCluster="true"
- tools:targetApi="O">
+ vlc:statusBarScrim="?attr/background_default"
+ vlc:theme="@style/Toolbar.VLC"
+ vlc:title="@{playlist.title}">
<ImageView
android:id="@+id/playlist_cover"
android:layout_width="match_parent"
- android:layout_height="192dp"
+ android:layout_height="match_parent"
+ android:fitsSystemWindows="true"
android:scaleType="centerCrop"
android:src="@{cover}"
vlc:layout_collapseMode="parallax" />
@@ -50,7 +53,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/main_toolbar"
android:layout_width="match_parent"
- android:layout_height="@dimen/toolbar_height"
+ android:layout_height="48dp"
vlc:navigationContentDescription="@string/abc_action_bar_up_description"
vlc:popupTheme="?attr/toolbar_popup_style"
vlc:theme="@style/Toolbar.VLC"
diff --git a/application/vlc-android/res/layout/toolbar.xml b/application/vlc-android/res/layout/toolbar.xml
index d4045972d..924ab798a 100644
--- a/application/vlc-android/res/layout/toolbar.xml
+++ b/application/vlc-android/res/layout/toolbar.xml
@@ -12,7 +12,7 @@
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/main_toolbar"
android:layout_width="match_parent"
- android:layout_height="@dimen/toolbar_height"
+ android:layout_height="?attr/actionBarSize"
android:keyboardNavigationCluster="true"
app:layout_scrollFlags="scroll|enterAlways|snap"
app:navigationContentDescription="@string/abc_action_bar_up_description"
diff --git a/application/vlc-android/res/values/styles.xml b/application/vlc-android/res/values/styles.xml
index 4fd88c664..aa5613b95 100644
--- a/application/vlc-android/res/values/styles.xml
+++ b/application/vlc-android/res/values/styles.xml
@@ -31,7 +31,6 @@
<item name="colorOnPrimary">@color/white</item>
<item name="colorAccent">@color/orange800</item>
<item name="windowActionModeOverlay">true</item>
- <item name="actionBarSize">@dimen/toolbar_height</item>
<item name="colorOnSurface">@color/black</item>
<item name="colorControlHighlight">@color/orange800</item>
<item name="colorControlNormal">@color/grey700</item>
@@ -165,7 +164,6 @@
<style name="Theme.VLC.Apearance.Black" parent="Theme.MaterialComponents.NoActionBar">
<item name="marginTopContent">50dp</item>
<item name="toolbar_popup_style">@style/ThemeOverlay.MaterialComponents.Dark</item>
- <item name="actionBarSize">@dimen/toolbar_height</item>
<item name="android:gridViewStyle">@style/Theme.VLC.List</item>
<item name="android:expandableListViewStyle">@style/Theme.VLC.List</item>
More information about the Android
mailing list