Remove colored toolbar when expanding cover as well

This commit is contained in:
Jays2Kings 2021-04-27 03:06:02 -04:00
parent 9dbeab3458
commit 36a22c9595

View File

@ -730,6 +730,7 @@ class MangaDetailsController :
//region action bar menu methods //region action bar menu methods
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
if (fullCoverActive) { if (fullCoverActive) {
colorToolbar(isColor = false)
activityBinding?.toolbar?.navigationIcon = activityBinding?.toolbar?.navigationIcon =
view?.context?.contextCompatDrawable(R.drawable.ic_arrow_back_24dp)?.apply { view?.context?.contextCompatDrawable(R.drawable.ic_arrow_back_24dp)?.apply {
setTint(Color.WHITE) setTint(Color.WHITE)
@ -737,11 +738,11 @@ class MangaDetailsController :
inflater.inflate(R.menu.manga_details_cover, menu) inflater.inflate(R.menu.manga_details_cover, menu)
return return
} }
colorToolbar(binding.recycler.canScrollVertically(-1))
activityBinding?.toolbar?.navigationIcon = activityBinding?.toolbar?.navigationIcon =
activityBinding?.toolbar?.navigationIcon?.mutate()?.apply { activityBinding?.toolbar?.navigationIcon?.mutate()?.apply {
setTint(view?.context?.getResourceColor(R.attr.actionBarTintColor) ?: Color.WHITE) setTint(view?.context?.getResourceColor(R.attr.actionBarTintColor) ?: Color.WHITE)
} }
activityBinding?.toolbar?.invalidateDrawable(activityBinding?.toolbar?.navigationIcon!!)
inflater.inflate(R.menu.manga_details, menu) inflater.inflate(R.menu.manga_details, menu)
val editItem = menu.findItem(R.id.action_edit) val editItem = menu.findItem(R.id.action_edit)
editItem.isVisible = presenter.manga.favorite && !presenter.isLockedFromSearch editItem.isVisible = presenter.manga.favorite && !presenter.isLockedFromSearch