mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Fix leaking back views when swiping in details/recents
Fixes #879 also fixed the rapid collapse/expand of manga description
This commit is contained in:
parent
02cacf45b9
commit
256d49b03a
3 changed files with 10 additions and 2 deletions
|
@ -170,6 +170,7 @@ class MangaHeaderHolder(
|
|||
private fun expandDesc(animated: Boolean = false) {
|
||||
binding ?: return
|
||||
if (binding.moreButton.visibility == View.VISIBLE || isTablet) {
|
||||
androidx.transition.TransitionManager.endTransitions(adapter.controller.binding.recycler)
|
||||
binding.mangaSummary.maxLines = Integer.MAX_VALUE
|
||||
binding.mangaSummary.setTextIsSelectable(true)
|
||||
setDescription()
|
||||
|
@ -205,6 +206,7 @@ class MangaHeaderHolder(
|
|||
if (isTablet || !canCollapse) return
|
||||
binding.moreButtonGroup.isVisible = !isTablet
|
||||
if (animated) {
|
||||
androidx.transition.TransitionManager.endTransitions(adapter.controller.binding.recycler)
|
||||
val animVector = AnimatedVectorDrawableCompat.create(
|
||||
binding.root.context,
|
||||
R.drawable.anim_expand_less_to_more
|
||||
|
|
|
@ -146,7 +146,10 @@ class ChapterHolder(
|
|||
}
|
||||
|
||||
private fun resetFrontView() {
|
||||
if (binding.frontView.translationX != 0f) itemView.post { adapter.notifyItemChanged(flexibleAdapterPosition) }
|
||||
if (binding.frontView.translationX != 0f) itemView.post {
|
||||
androidx.transition.TransitionManager.endTransitions(adapter.recyclerView)
|
||||
adapter.notifyItemChanged(flexibleAdapterPosition)
|
||||
}
|
||||
}
|
||||
|
||||
fun notifyStatus(status: Download.State, locked: Boolean, progress: Int, animated: Boolean = false) = with(binding.downloadButton.downloadButton) {
|
||||
|
|
|
@ -156,7 +156,10 @@ class RecentMangaHolder(
|
|||
}
|
||||
|
||||
private fun resetFrontView() {
|
||||
if (binding.frontView.translationX != 0f) itemView.post { adapter.notifyItemChanged(flexibleAdapterPosition) }
|
||||
if (binding.frontView.translationX != 0f) itemView.post {
|
||||
androidx.transition.TransitionManager.endTransitions(adapter.recyclerView)
|
||||
adapter.notifyItemChanged(flexibleAdapterPosition)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onLongClick(view: View?): Boolean {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue