mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 04:29:18 +01:00
Fix global search scrolling up one section after coming from manga details
This commit is contained in:
parent
c020d4d45d
commit
0099dd5523
@ -472,10 +472,10 @@ class MangaDetailsController :
|
||||
|
||||
override fun onChangeStarted(handler: ControllerChangeHandler, type: ControllerChangeType) {
|
||||
super.onChangeStarted(handler, type)
|
||||
if (type == ControllerChangeType.PUSH_ENTER || type == ControllerChangeType.POP_ENTER) {
|
||||
if (type.isEnter) {
|
||||
setActionBar(true)
|
||||
setStatusBarAndToolbar()
|
||||
} else if (type == ControllerChangeType.PUSH_EXIT || type == ControllerChangeType.POP_EXIT) {
|
||||
} else {
|
||||
if (router.backstack.lastOrNull()?.controller is DialogController) {
|
||||
return
|
||||
}
|
||||
@ -485,6 +485,7 @@ class MangaDetailsController :
|
||||
}
|
||||
colorAnimator?.cancel()
|
||||
|
||||
getHeader()?.unbind()
|
||||
val colorSecondary = activity?.getResourceColor(
|
||||
R.attr.colorSecondary
|
||||
) ?: Color.BLACK
|
||||
|
@ -312,6 +312,11 @@ class MangaHeaderHolder(
|
||||
updateCover(manga)
|
||||
}
|
||||
|
||||
fun unbind() {
|
||||
binding?.mangaSummary?.setTextIsSelectable(false)
|
||||
binding?.mangaSummary?.clearFocus()
|
||||
}
|
||||
|
||||
private fun MaterialButton.checked(checked: Boolean) {
|
||||
if (checked) {
|
||||
backgroundTintList = ColorStateList.valueOf(
|
||||
|
@ -41,6 +41,15 @@ class MangaHeaderItem(val manga: Manga, var startExpanded: Boolean) :
|
||||
else holder.bind(this, manga)
|
||||
}
|
||||
|
||||
override fun unbindViewHolder(
|
||||
adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>?,
|
||||
holder: MangaHeaderHolder?,
|
||||
position: Int
|
||||
) {
|
||||
holder?.unbind()
|
||||
super.unbindViewHolder(adapter, holder, position)
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return (this === other)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user