Fixed shared element(image) overlapping on bottom sheet

main
Prathamesh More 2021-10-14 12:39:08 +05:30
parent 734cdea427
commit 2517220f1b
2 changed files with 16 additions and 5 deletions

View File

@ -104,7 +104,9 @@ class AlbumDetailsFragment : AbsMainActivityFragment(R.layout.fragment_album_det
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
sharedElementEnterTransition = MaterialContainerTransform().apply { sharedElementEnterTransition = MaterialContainerTransform().apply {
drawingViewId = R.id.fragment_container
scrimColor = Color.TRANSPARENT scrimColor = Color.TRANSPARENT
setAllContainerColors(requireContext().resolveColor(R.attr.colorSurface))
setPathMotion(MaterialArcMotion()) setPathMotion(MaterialArcMotion())
} }
} }
@ -229,7 +231,8 @@ class AlbumDetailsFragment : AbsMainActivityFragment(R.layout.fragment_album_det
loadAlbumCover(album) loadAlbumCover(album)
simpleSongAdapter.swapDataSet(album.songs) simpleSongAdapter.swapDataSet(album.songs)
if (albumArtistExists) { if (albumArtistExists) {
detailsViewModel.getAlbumArtist(album.albumArtist.toString()).observe(viewLifecycleOwner, { detailsViewModel.getAlbumArtist(album.albumArtist.toString())
.observe(viewLifecycleOwner, {
loadArtistImage(it) loadArtistImage(it)
}) })
} else { } else {
@ -303,7 +306,12 @@ class AlbumDetailsFragment : AbsMainActivityFragment(R.layout.fragment_album_det
}) })
GlideApp.with(requireContext()).asBitmapPalette().artistImageOptions(artist) GlideApp.with(requireContext()).asBitmapPalette().artistImageOptions(artist)
//.forceDownload(PreferenceUtil.isAllowedToDownloadMetadata()) //.forceDownload(PreferenceUtil.isAllowedToDownloadMetadata())
.load(RetroGlideExtension.getArtistModel(artist, PreferenceUtil.isAllowedToDownloadMetadata())) .load(
RetroGlideExtension.getArtistModel(
artist,
PreferenceUtil.isAllowedToDownloadMetadata()
)
)
.dontAnimate() .dontAnimate()
.dontTransform() .dontTransform()
.into(object : RetroMusicColoredTarget(binding.artistImage) { .into(object : RetroMusicColoredTarget(binding.artistImage) {
@ -313,7 +321,8 @@ class AlbumDetailsFragment : AbsMainActivityFragment(R.layout.fragment_album_det
} }
private fun loadAlbumCover(album: Album) { private fun loadAlbumCover(album: Album) {
GlideApp.with(requireContext()).asBitmapPalette().albumCoverOptions(album.safeGetFirstSong()) GlideApp.with(requireContext()).asBitmapPalette()
.albumCoverOptions(album.safeGetFirstSong())
//.checkIgnoreMediaStore() //.checkIgnoreMediaStore()
.load(RetroGlideExtension.getSongModel(album.safeGetFirstSong())) .load(RetroGlideExtension.getSongModel(album.safeGetFirstSong()))
.into(object : SingleColorTarget(binding.image) { .into(object : SingleColorTarget(binding.image) {

View File

@ -73,7 +73,9 @@ abstract class AbsArtistDetailsFragment : AbsMainActivityFragment(R.layout.fragm
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
sharedElementEnterTransition = MaterialContainerTransform().apply { sharedElementEnterTransition = MaterialContainerTransform().apply {
drawingViewId = R.id.fragment_container
scrimColor = Color.TRANSPARENT scrimColor = Color.TRANSPARENT
setAllContainerColors(requireContext().resolveColor(R.attr.colorSurface))
} }
} }