[Android] Improve the Info activity status bar behavior and theme

Nicolas Pomepuy git at videolan.org
Tue Apr 6 06:15:36 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Apr  1 11:58:19 2021 +0200| [9c5fdf08b24a93ccb44870e7465fd9354870e229] | committer: Nicolas Pomepuy

Improve the Info activity status bar behavior and theme

> https://code.videolan.org/videolan/vlc-android/commit/9c5fdf08b24a93ccb44870e7465fd9354870e229
---

 application/vlc-android/AndroidManifest.xml          | 2 +-
 application/vlc-android/res/layout/info_activity.xml | 3 ++-
 application/vlc-android/res/values/styles.xml        | 7 +++++++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/application/vlc-android/AndroidManifest.xml b/application/vlc-android/AndroidManifest.xml
index 38bf8492e..dcf9f862e 100644
--- a/application/vlc-android/AndroidManifest.xml
+++ b/application/vlc-android/AndroidManifest.xml
@@ -473,7 +473,7 @@
             android:theme="@style/Theme.VLC"/>
         <activity
             android:name=".gui.InfoActivity"
-            android:theme="@style/Theme.VLC"/>
+            android:theme="@style/Theme.VLC.NoStatus"/>
         <activity
             android:name=".gui.SearchActivity"
             android:theme="@style/Theme.VLC"/>
diff --git a/application/vlc-android/res/layout/info_activity.xml b/application/vlc-android/res/layout/info_activity.xml
index 7dd69182f..31bfc2ebf 100644
--- a/application/vlc-android/res/layout/info_activity.xml
+++ b/application/vlc-android/res/layout/info_activity.xml
@@ -78,6 +78,7 @@
                     android:fitsSystemWindows="true"
                     vlc:expandedTitleTextAppearance="@style/TextAppearance.Design.CollapsingToolbar.Expanded.Shadow"
                     vlc:title="@{item.title}"
+                    vlc:statusBarScrim="?attr/background_default"
                     vlc:theme="@style/Toolbar.VLC"
                     vlc:contentScrim="?attr/background_actionbar"
                     vlc:expandedTitleMarginEnd="64dp"
@@ -88,7 +89,7 @@
                         android:id="@+id/playlist_cover"
                         android:layout_width="match_parent"
                         android:layout_height="match_parent"
-                        android:fitsSystemWindows="false"
+                        android:fitsSystemWindows="true"
                         android:scaleType="centerCrop"
                         android:src="@{cover}"
                         vlc:layout_collapseMode="parallax" />
diff --git a/application/vlc-android/res/values/styles.xml b/application/vlc-android/res/values/styles.xml
index 2ca3f9bf7..d8f4787e4 100644
--- a/application/vlc-android/res/values/styles.xml
+++ b/application/vlc-android/res/values/styles.xml
@@ -437,6 +437,13 @@
         <item name="android:backgroundDimEnabled">false</item>
     </style>
 
+    <style name="Theme.VLC.NoStatus" parent="Theme.VLC">
+        <item name="android:windowTranslucentStatus"  tools:targetApi="lollipop">true</item>
+        <item name="android:navigationBarColor" tools:targetApi="lollipop">@color/transparent</item>
+        <item name="android:statusBarColor" tools:targetApi="lollipop">@color/white</item>
+        <item name="android:windowLightStatusBar" tools:targetApi="m">false</item>
+    </style>
+
     <style name="VLC.TextView" parent="android:Widget.TextView">
         <item name="android:textDirection">locale</item>
     </style>



More information about the Android mailing list