mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-14 05:15:10 +01:00
Fixed #311
This commit is contained in:
parent
10d6a04051
commit
b16ffe020e
@ -4,6 +4,7 @@ import android.content.Context
|
|||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import androidx.appcompat.graphics.drawable.DrawerArrowDrawable
|
import androidx.appcompat.graphics.drawable.DrawerArrowDrawable
|
||||||
import com.google.android.material.appbar.MaterialToolbar
|
import com.google.android.material.appbar.MaterialToolbar
|
||||||
|
import eu.kanade.tachiyomi.util.view.gone
|
||||||
import kotlinx.android.synthetic.main.main_activity.view.*
|
import kotlinx.android.synthetic.main.main_activity.view.*
|
||||||
|
|
||||||
class CenteredToolbar@JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
|
class CenteredToolbar@JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
|
||||||
@ -13,6 +14,7 @@ class CenteredToolbar@JvmOverloads constructor(context: Context, attrs: Attribut
|
|||||||
if (navigationIcon is DrawerArrowDrawable) {
|
if (navigationIcon is DrawerArrowDrawable) {
|
||||||
super.setTitle(resId)
|
super.setTitle(resId)
|
||||||
toolbar_title.text = null
|
toolbar_title.text = null
|
||||||
|
dropdown?.gone()
|
||||||
} else {
|
} else {
|
||||||
toolbar_title.text = context.getString(resId)
|
toolbar_title.text = context.getString(resId)
|
||||||
super.setTitle(null)
|
super.setTitle(null)
|
||||||
@ -23,6 +25,7 @@ class CenteredToolbar@JvmOverloads constructor(context: Context, attrs: Attribut
|
|||||||
if (navigationIcon is DrawerArrowDrawable) {
|
if (navigationIcon is DrawerArrowDrawable) {
|
||||||
super.setTitle(title)
|
super.setTitle(title)
|
||||||
toolbar_title.text = ""
|
toolbar_title.text = ""
|
||||||
|
dropdown?.gone()
|
||||||
} else {
|
} else {
|
||||||
toolbar_title.text = title
|
toolbar_title.text = title
|
||||||
super.setTitle(null)
|
super.setTitle(null)
|
||||||
|
@ -518,6 +518,13 @@ class LibraryController(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onChangeEnded(handler: ControllerChangeHandler, type: ControllerChangeType) {
|
||||||
|
super.onChangeEnded(handler, type)
|
||||||
|
if (!type.isEnter) {
|
||||||
|
activity?.dropdown?.gone()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun onActivityResumed(activity: Activity) {
|
override fun onActivityResumed(activity: Activity) {
|
||||||
super.onActivityResumed(activity)
|
super.onActivityResumed(activity)
|
||||||
if (view == null) return
|
if (view == null) return
|
||||||
|
Loading…
Reference in New Issue
Block a user