Fixed AppBarLayout issues

This commit is contained in:
Prathamesh More 2021-10-23 17:25:48 +05:30
parent cb8ef7f32c
commit efeacfa622
7 changed files with 14 additions and 16 deletions

View file

@ -64,9 +64,6 @@ abstract class AbsRecyclerViewFragment<A : RecyclerView.Adapter<*>, LM : Recycle
initAdapter()
setUpRecyclerView()
setupToolbar()
binding.appBarLayout.statusBarForeground =
MaterialShapeDrawable.createWithElevationOverlay(requireContext())
// Add listeners when shuffle is visible
if (isShuffleVisible) {
binding.recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() {
@ -95,7 +92,6 @@ abstract class AbsRecyclerViewFragment<A : RecyclerView.Adapter<*>, LM : Recycle
bottomMargin = it
}
})
binding.appBarLayout.drawNextToNavbar()
}
open fun onShuffleClicked() {
@ -117,6 +113,9 @@ abstract class AbsRecyclerViewFragment<A : RecyclerView.Adapter<*>, LM : Recycle
}
val appName = resources.getString(titleRes)
binding.appNameText.text = appName
binding.toolbarContainer.drawNextToNavbar()
binding.appBarLayout.statusBarForeground =
MaterialShapeDrawable.createWithElevationOverlay(requireContext())
}
abstract val titleRes: Int

View file

@ -124,7 +124,7 @@ class FoldersFragment : AbsMainActivityFragment(R.layout.fragment_folder),
}
}
})
binding.appBarLayout.drawNextToNavbar()
binding.toolbarContainer.drawNextToNavbar()
}
private fun setUpTitle() {

View file

@ -76,7 +76,7 @@ class HomeFragment :
view.doOnPreDraw { startPostponedEnterTransition() }
binding.appBarLayout.statusBarForeground =
MaterialShapeDrawable.createWithElevationOverlay(requireContext())
binding.appBarLayout.drawNextToNavbar()
binding.toolbar.drawNextToNavbar()
}
private fun setupListeners() {