[Android] Fix BottomSheet style in video player
Nicolas Pomepuy
git at videolan.org
Tue Jun 30 14:06:25 CEST 2020
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Jun 30 13:22:03 2020 +0200| [f8517fba137c369a4d8851477a7924dcac848034] | committer: Nicolas Pomepuy
Fix BottomSheet style in video player
> https://code.videolan.org/videolan/vlc-android/commit/f8517fba137c369a4d8851477a7924dcac848034
---
.../src/main/res/drawable/bottom_sheet_background.xml | 4 ++--
application/resources/src/main/res/values/attrs.xml | 1 +
.../vlc-android/res/layout-land/player_overlay_tracks.xml | 1 -
application/vlc-android/res/layout/player_overlay_tracks.xml | 1 -
application/vlc-android/res/values/styles.xml | 12 +++++++++++-
5 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/application/resources/src/main/res/drawable/bottom_sheet_background.xml b/application/resources/src/main/res/drawable/bottom_sheet_background.xml
index cbd6ae2e2..1d54f3e27 100644
--- a/application/resources/src/main/res/drawable/bottom_sheet_background.xml
+++ b/application/resources/src/main/res/drawable/bottom_sheet_background.xml
@@ -3,7 +3,7 @@
android:shape="rectangle">
<solid android:color="?attr/bottom_sheet_background" />
<corners
- android:topLeftRadius="16dp"
- android:topRightRadius="16dp" />
+ android:topLeftRadius="?attr/bottom_sheet_radius"
+ android:topRightRadius="?attr/bottom_sheet_radius" />
</shape>
\ No newline at end of file
diff --git a/application/resources/src/main/res/values/attrs.xml b/application/resources/src/main/res/values/attrs.xml
index 4ff16c688..f93d5d179 100644
--- a/application/resources/src/main/res/values/attrs.xml
+++ b/application/resources/src/main/res/values/attrs.xml
@@ -29,6 +29,7 @@
<attr name="header_background" format="reference|color" />
<attr name="bottom_navigation_background" format="reference|color" />
<attr name="bottom_sheet_background" format="reference|color" />
+ <attr name="bottom_sheet_radius" format="dimension" />
<attr name="bottom_navigation_color" format="reference|color" />
<attr name="background_default_darker" format="reference|color" />
<attr name="background_actionbar" format="reference|color" />
diff --git a/application/vlc-android/res/layout-land/player_overlay_tracks.xml b/application/vlc-android/res/layout-land/player_overlay_tracks.xml
index fb2d1ccd5..5e9457c8d 100644
--- a/application/vlc-android/res/layout-land/player_overlay_tracks.xml
+++ b/application/vlc-android/res/layout-land/player_overlay_tracks.xml
@@ -35,7 +35,6 @@
android:id="@+id/player_overlay_tracks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@color/black_transparent_80"
android:orientation="horizontal">
diff --git a/application/vlc-android/res/layout/player_overlay_tracks.xml b/application/vlc-android/res/layout/player_overlay_tracks.xml
index 1b0de51c9..fb551a92b 100644
--- a/application/vlc-android/res/layout/player_overlay_tracks.xml
+++ b/application/vlc-android/res/layout/player_overlay_tracks.xml
@@ -35,7 +35,6 @@
android:id="@+id/player_overlay_tracks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@color/black_transparent_80"
android:orientation="horizontal">
diff --git a/application/vlc-android/res/values/styles.xml b/application/vlc-android/res/values/styles.xml
index 7e09c4ef7..84610035d 100644
--- a/application/vlc-android/res/values/styles.xml
+++ b/application/vlc-android/res/values/styles.xml
@@ -43,6 +43,7 @@
<item name="background_default">@color/white</item>
<item name="bottom_navigation_background">@drawable/bottom_navigation_background</item>
<item name="bottom_sheet_background">@color/white</item>
+ <item name="bottom_sheet_radius">16dp</item>
<item name="bottom_navigation_color">@color/grey700</item>
<item name="progress_indeterminate_tint">@color/white</item>
<item name="header_background">@color/whitetransparent_ea</item>
@@ -172,6 +173,7 @@
<item name="background_default">@color/black</item>
<item name="bottom_navigation_background">@drawable/bottom_navigation_background_dark</item>
<item name="bottom_sheet_background">@color/grey875</item>
+ <item name="bottom_sheet_radius">16dp</item>
<item name="bottom_navigation_color">@color/grey500</item>
<item name="header_background">@color/blacktransparent</item>
<item name="background_default_darker">@color/grey875</item>
@@ -376,7 +378,10 @@
<item name="textInputStyle">@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox
</item>
- <item name="bottomSheetDialogTheme">@style/AppBottomSheetDialogTheme</item>
+ <item name="bottomSheetDialogTheme">@style/AppBottomSheetDialogTheme.Player</item>
+ <item name="bottom_sheet_background">@color/black_transparent_80</item>
+ <item name="bottom_sheet_radius">4dp</item>
+
<item name="colorPrimary">@color/orange500</item>
<item name="colorPrimaryDark">@color/transparent</item>
@@ -621,6 +626,11 @@
</style>
+ <style name="AppBottomSheetDialogTheme.Player">
+ <item name="android:navigationBarColor">@color/black_transparent_80</item>
+
+ </style>
+
<!-- fixme : We'll have to revert to Widget.MaterialComponents.BottomSheet.Modal when this issue is fixed: https://github.com/material-components/material-components-android/issues/1086-->
<style name="AppModalStyle" parent="Widget.Design.BottomSheet.Modal">
</style>
More information about the Android
mailing list