[Android] Set the right colors for statusbar and navigationbar

Nicolas Pomepuy git at videolan.org
Wed Jul 24 15:18:31 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Tue Jul 23 14:44:19 2019 +0200| [02a3707347a9c78e0b1bdfe5df557c9c7d8aa237] | committer: Geoffrey Métais

Set the right colors for statusbar and navigationbar

> https://code.videolan.org/videolan/vlc-android/commit/02a3707347a9c78e0b1bdfe5df557c9c7d8aa237
---

 vlc-android/res/values-v21/styles.xml              | 30 ++++------------------
 vlc-android/res/values/styles.xml                  |  1 -
 .../videolan/vlc/gui/video/VideoPlayerActivity.kt  |  2 +-
 3 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/vlc-android/res/values-v21/styles.xml b/vlc-android/res/values-v21/styles.xml
index 8bd6ea65b..39ba668c1 100644
--- a/vlc-android/res/values-v21/styles.xml
+++ b/vlc-android/res/values-v21/styles.xml
@@ -1,33 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android">
 
-    <!--<style name="Theme.VLC" parent="Theme.VLC.21"/>-->
-    <!--<style name="Theme.VLC.Black" parent="Theme.VLC.Black.21"/>-->
-    <!--<style name="Theme.VLC.Player" parent="Theme.VLC.Player.21"/>-->
-
-    <!--<style name="Theme.VLC.21" parent="Theme.VLC.7">-->
-    <!--<item name="android:popupMenuStyle">@style/PopupMenuStyle.Light</item>-->
-    <!--</style>-->
-    <!--<style name="Theme.VLC.Black.21" parent="Theme.VLC.Black.7">-->
-    <!--<item name="android:popupMenuStyle">@style/PopupMenuStyle</item>-->
-    <!--<item name="android:navigationBarColor">?attr/background_actionbar</item>-->
-    <!--</style>-->
-    <!--<style name="Theme.VLC.Player.21" parent="Theme.VLC.Player.19">-->
-    <!--<item name="android:windowTranslucentStatus">false</item>">-->
-    <!--<item name="android:windowTranslucentNavigation">false</item>-->
-    <!--<item name="android:navigationBarColor">@color/transparent</item>-->
-    <!--</style>-->
-    <!--<style name="Toolbar.VLC" parent="ThemeOverlay.AppCompat.Dark.ActionBar">-->
-    <!--<item name="android:textCursorDrawable">@drawable/cursor_w</item>-->
-    <!--</style>-->
-    <!--<style name="PopupMenuStyle.Light" parent="@style/Widget.AppCompat.Light.PopupMenu">-->
-    <!--<item name="android:overlapAnchor">true</item>-->
-    <!--</style>-->
-    <!--<style name="PopupMenuStyle" parent="@style/Widget.AppCompat.PopupMenu">-->
-    <!--<item name="android:overlapAnchor">true</item>-->
-    <!--</style>-->
     <style name="AppModalStyle" parent="Widget.MaterialComponents.BottomSheet.Modal">
         <item name="android:background">@drawable/bottom_sheet_background</item>
     </style>
 
+    <style name="Theme.VLC.Player" parent="Theme.VLC.Player.7">
+        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
+        <item name="android:statusBarColor">@color/status_bar_transparency</item>
+        <item name="android:navigationBarColor">@color/status_bar_transparency</item>
+    </style>
 </resources>
diff --git a/vlc-android/res/values/styles.xml b/vlc-android/res/values/styles.xml
index 9d5da9084..e053fa382 100644
--- a/vlc-android/res/values/styles.xml
+++ b/vlc-android/res/values/styles.xml
@@ -307,7 +307,6 @@
 
         <item name="bottomSheetDialogTheme">@style/AppBottomSheetDialogTheme</item>
 
-
         <item name="colorPrimary">@color/orange500</item>
         <item name="colorPrimaryDark">@color/transparent</item>
         <item name="colorAccent">@color/orange500</item>
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index 9c13aff30..91dc507ca 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -2282,7 +2282,7 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
             visibility = visibility or View.SYSTEM_UI_FLAG_FULLSCREEN
         } else {
             window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
-            visibility = visibility or View.SYSTEM_UI_FLAG_VISIBLE
+            visibility = visibility or View.SYSTEM_UI_FLAG_VISIBLE or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
         }
 
         if (AndroidDevices.hasNavBar)



More information about the Android mailing list