mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 06:09:19 +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) {
|
override fun onChangeStarted(handler: ControllerChangeHandler, type: ControllerChangeType) {
|
||||||
super.onChangeStarted(handler, type)
|
super.onChangeStarted(handler, type)
|
||||||
if (type == ControllerChangeType.PUSH_ENTER || type == ControllerChangeType.POP_ENTER) {
|
if (type.isEnter) {
|
||||||
setActionBar(true)
|
setActionBar(true)
|
||||||
setStatusBarAndToolbar()
|
setStatusBarAndToolbar()
|
||||||
} else if (type == ControllerChangeType.PUSH_EXIT || type == ControllerChangeType.POP_EXIT) {
|
} else {
|
||||||
if (router.backstack.lastOrNull()?.controller is DialogController) {
|
if (router.backstack.lastOrNull()?.controller is DialogController) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -485,6 +485,7 @@ class MangaDetailsController :
|
|||||||
}
|
}
|
||||||
colorAnimator?.cancel()
|
colorAnimator?.cancel()
|
||||||
|
|
||||||
|
getHeader()?.unbind()
|
||||||
val colorSecondary = activity?.getResourceColor(
|
val colorSecondary = activity?.getResourceColor(
|
||||||
R.attr.colorSecondary
|
R.attr.colorSecondary
|
||||||
) ?: Color.BLACK
|
) ?: Color.BLACK
|
||||||
|
@ -312,6 +312,11 @@ class MangaHeaderHolder(
|
|||||||
updateCover(manga)
|
updateCover(manga)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun unbind() {
|
||||||
|
binding?.mangaSummary?.setTextIsSelectable(false)
|
||||||
|
binding?.mangaSummary?.clearFocus()
|
||||||
|
}
|
||||||
|
|
||||||
private fun MaterialButton.checked(checked: Boolean) {
|
private fun MaterialButton.checked(checked: Boolean) {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
backgroundTintList = ColorStateList.valueOf(
|
backgroundTintList = ColorStateList.valueOf(
|
||||||
|
@ -41,6 +41,15 @@ class MangaHeaderItem(val manga: Manga, var startExpanded: Boolean) :
|
|||||||
else holder.bind(this, manga)
|
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 {
|
override fun equals(other: Any?): Boolean {
|
||||||
return (this === other)
|
return (this === other)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user