diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/about/AboutFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/about/AboutFragment.kt
index 72cac439..3bbe5e39 100644
--- a/app/src/main/java/code/name/monkey/retromusic/fragments/about/AboutFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/fragments/about/AboutFragment.kt
@@ -20,6 +20,7 @@ import android.net.Uri
import android.os.Bundle
import android.view.View
import androidx.core.app.ShareCompat
+import androidx.core.view.updatePadding
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.DefaultItemAnimator
import androidx.recyclerview.widget.LinearLayoutManager
@@ -30,6 +31,7 @@ import code.name.monkey.retromusic.adapter.ContributorAdapter
import code.name.monkey.retromusic.databinding.FragmentAboutBinding
import code.name.monkey.retromusic.fragments.LibraryViewModel
import code.name.monkey.retromusic.util.NavigationUtil
+import code.name.monkey.retromusic.util.RetroUtil
import org.koin.androidx.viewmodel.ext.android.sharedViewModel
class AboutFragment : Fragment(R.layout.fragment_about), View.OnClickListener {
@@ -43,6 +45,12 @@ class AboutFragment : Fragment(R.layout.fragment_about), View.OnClickListener {
binding.aboutContent.cardOther.version.setSummary(getAppVersion())
setUpView()
loadContributors()
+ // This is a workaround as CollapsingToolbarLayout consumes insets and
+ // insets are not passed to child views
+ // https://github.com/material-components/material-components-android/issues/1310
+ if (!RetroUtil.isLandscape()) {
+ binding.root.updatePadding(bottom = RetroUtil.getNavigationBarHeight())
+ }
}
private fun openUrl(url: String) {
diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/albums/AlbumDetailsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/albums/AlbumDetailsFragment.kt
index fe6b0ceb..5075ca1a 100644
--- a/app/src/main/java/code/name/monkey/retromusic/fragments/albums/AlbumDetailsFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/fragments/albums/AlbumDetailsFragment.kt
@@ -73,6 +73,7 @@ import com.afollestad.materialcab.attached.AttachedCab
import com.afollestad.materialcab.attached.destroy
import com.afollestad.materialcab.attached.isActive
import com.afollestad.materialcab.createCab
+import com.google.android.material.shape.MaterialShapeDrawable
import com.google.android.material.transition.MaterialArcMotion
import com.google.android.material.transition.MaterialContainerTransform
import kotlinx.coroutines.Dispatchers
@@ -179,6 +180,8 @@ class AlbumDetailsFragment : AbsMainActivityFragment(R.layout.fragment_album_det
requireActivity().onBackPressed()
}
}
+ binding.appBarLayout?.statusBarForeground =
+ MaterialShapeDrawable.createWithElevationOverlay(requireContext())
}
override fun onDestroy() {
diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/artists/AbsArtistDetailsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/artists/AbsArtistDetailsFragment.kt
index 8ebf5575..9a638e1f 100644
--- a/app/src/main/java/code/name/monkey/retromusic/fragments/artists/AbsArtistDetailsFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/fragments/artists/AbsArtistDetailsFragment.kt
@@ -47,6 +47,7 @@ import com.afollestad.materialcab.attached.AttachedCab
import com.afollestad.materialcab.attached.destroy
import com.afollestad.materialcab.attached.isActive
import com.afollestad.materialcab.createCab
+import com.google.android.material.shape.MaterialShapeDrawable
import com.google.android.material.transition.MaterialContainerTransform
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
@@ -124,6 +125,8 @@ abstract class AbsArtistDetailsFragment : AbsMainActivityFragment(R.layout.fragm
requireActivity().onBackPressed()
}
}
+ binding.appBarLayout?.statusBarForeground =
+ MaterialShapeDrawable.createWithElevationOverlay(requireContext())
}
private fun setupRecyclerView() {
diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/genres/GenreDetailsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/genres/GenreDetailsFragment.kt
index 567df41f..a12d787b 100644
--- a/app/src/main/java/code/name/monkey/retromusic/fragments/genres/GenreDetailsFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/fragments/genres/GenreDetailsFragment.kt
@@ -33,6 +33,7 @@ import code.name.monkey.retromusic.fragments.base.AbsMainActivityFragment
import code.name.monkey.retromusic.helper.menu.GenreMenuHelper
import code.name.monkey.retromusic.model.Genre
import code.name.monkey.retromusic.model.Song
+import com.google.android.material.shape.MaterialShapeDrawable
import com.google.android.material.transition.MaterialSharedAxis
import org.koin.androidx.viewmodel.ext.android.viewModel
import org.koin.core.parameter.parametersOf
@@ -67,6 +68,8 @@ class GenreDetailsFragment : AbsMainActivityFragment(R.layout.fragment_playlist_
view.doOnPreDraw {
startPostponedEnterTransition()
}
+ binding.appBarLayout.statusBarForeground =
+ MaterialShapeDrawable.createWithElevationOverlay(requireContext())
}
private fun setupRecyclerView() {
diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/playlists/PlaylistDetailsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/playlists/PlaylistDetailsFragment.kt
index 835785f0..bf85121a 100644
--- a/app/src/main/java/code/name/monkey/retromusic/fragments/playlists/PlaylistDetailsFragment.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/fragments/playlists/PlaylistDetailsFragment.kt
@@ -30,6 +30,7 @@ import com.afollestad.materialcab.attached.AttachedCab
import com.afollestad.materialcab.attached.destroy
import com.afollestad.materialcab.attached.isActive
import com.afollestad.materialcab.createCab
+import com.google.android.material.shape.MaterialShapeDrawable
import com.google.android.material.transition.MaterialSharedAxis
import com.h6ah4i.android.widget.advrecyclerview.animator.DraggableItemAnimator
import com.h6ah4i.android.widget.advrecyclerview.animator.GeneralItemAnimator
@@ -75,6 +76,8 @@ class PlaylistDetailsFragment : AbsMainActivityFragment(R.layout.fragment_playli
requireActivity().onBackPressed()
}
}
+ binding.appBarLayout.statusBarForeground =
+ MaterialShapeDrawable.createWithElevationOverlay(requireContext())
}
private fun setUpRecyclerView() {
diff --git a/app/src/main/res/layout/fragment_album_details.xml b/app/src/main/res/layout/fragment_album_details.xml
index e9a8182b..2f0f9a35 100644
--- a/app/src/main/res/layout/fragment_album_details.xml
+++ b/app/src/main/res/layout/fragment_album_details.xml
@@ -10,7 +10,8 @@
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- app:liftOnScroll="true">
+ app:liftOnScroll="true"
+ android:fitsSystemWindows="true">
diff --git a/app/src/main/res/layout/fragment_artist_details.xml b/app/src/main/res/layout/fragment_artist_details.xml
index 9191649c..f025c03d 100644
--- a/app/src/main/res/layout/fragment_artist_details.xml
+++ b/app/src/main/res/layout/fragment_artist_details.xml
@@ -10,7 +10,8 @@
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- app:liftOnScroll="true">
+ app:liftOnScroll="true"
+ android:fitsSystemWindows="true">
diff --git a/app/src/main/res/layout/fragment_playlist_detail.xml b/app/src/main/res/layout/fragment_playlist_detail.xml
index ce6a687c..d335c8fd 100644
--- a/app/src/main/res/layout/fragment_playlist_detail.xml
+++ b/app/src/main/res/layout/fragment_playlist_detail.xml
@@ -12,8 +12,8 @@
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- app:liftOnScroll="true"
- android:fitsSystemWindows="true">
+ android:fitsSystemWindows="true"
+ app:liftOnScroll="true">