[Android] Fix toolbar elevation preventing the audio player to be displayed

Nicolas Pomepuy git at videolan.org
Thu Dec 23 09:45:07 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Dec  2 15:35:15 2021 +0100| [6fcbcfe0adbad62fb5597096d352b0d00a271eeb] | committer: Nicolas Pomepuy

Fix toolbar elevation preventing the audio player to be displayed

> https://code.videolan.org/videolan/vlc-android/commit/6fcbcfe0adbad62fb5597096d352b0d00a271eeb
---

 application/vlc-android/res/layout/main.xml                             | 1 +
 .../src/org/videolan/vlc/gui/AudioPlayerContainerActivity.kt            | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/application/vlc-android/res/layout/main.xml b/application/vlc-android/res/layout/main.xml
index fad9a4086..26a4b2eb1 100644
--- a/application/vlc-android/res/layout/main.xml
+++ b/application/vlc-android/res/layout/main.xml
@@ -12,6 +12,7 @@
             android:layout_width="wrap_content"
             android:layout_height="match_parent"
             app:labelVisibilityMode="labeled"
+            app:elevation="4dp"
             app:headerLayout="@layout/navigation_rail_fab"
             app:layout_behavior="@string/appbar_scrolling_view_behavior"
             app:menu="@menu/bottom_navigation" />
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.kt
index 0239483e1..95dcfa4a1 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.kt
@@ -154,7 +154,7 @@ open class AudioPlayerContainerActivity : BaseActivity(), KeycodeListener {
         tabLayout?.viewTreeObserver?.addOnGlobalLayoutListener {
             //add a shadow if there are tabs
             val needToElevate = (tabLayout?.layoutParams?.height != 0) || navigationRail?.visibility != View.GONE
-            if (AndroidUtil.isLolliPopOrLater) appBarLayout.elevation = if (needToElevate) 9.dp.toFloat() else 0.dp.toFloat()
+            if (AndroidUtil.isLolliPopOrLater) appBarLayout.elevation = if (needToElevate) 8.dp.toFloat() else 0.dp.toFloat()
         }
         audioPlayerContainer = findViewById(R.id.audio_player_container)
     }



More information about the Android mailing list