This commit is contained in:
Jay 2020-05-04 15:50:39 -04:00
parent 10d6a04051
commit b16ffe020e
2 changed files with 10 additions and 0 deletions

View File

@ -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)

View File

@ -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