mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 18:51:51 +01:00
clean up toolbar dropdown arrow logic
since its no longer used
This commit is contained in:
parent
b6de6a77f0
commit
975bd43ea1
@ -18,7 +18,6 @@ open class BaseToolbar @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||
protected val titleTextAppeance: Int
|
||||
|
||||
var incognito = false
|
||||
var hasDropdown: Boolean? = null
|
||||
init {
|
||||
val a = context.obtainStyledAttributes(
|
||||
attrs,
|
||||
@ -42,22 +41,9 @@ open class BaseToolbar @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||
toolbarTitle.isVisible = true
|
||||
toolbarTitle.text = title
|
||||
super.setTitle(null)
|
||||
if (navigationIcon is DrawerArrowDrawable) {
|
||||
hideDropdown()
|
||||
}
|
||||
setIncognitoMode(incognito)
|
||||
}
|
||||
|
||||
fun hideDropdown() {
|
||||
hasDropdown = null
|
||||
setIcons()
|
||||
}
|
||||
|
||||
fun showDropdown(down: Boolean = true) {
|
||||
hasDropdown = down
|
||||
setIcons()
|
||||
}
|
||||
|
||||
fun setIncognitoMode(enabled: Boolean) {
|
||||
incognito = enabled
|
||||
setIcons()
|
||||
@ -76,7 +62,6 @@ open class BaseToolbar @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||
private fun getIncogRes(): Int {
|
||||
return when {
|
||||
incognito -> R.drawable.ic_incognito_circle_24dp
|
||||
hasDropdown != null -> R.drawable.ic_blank_24dp
|
||||
else -> 0
|
||||
}
|
||||
}
|
||||
@ -84,8 +69,6 @@ open class BaseToolbar @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||
@DrawableRes
|
||||
private fun getDropdownRes(): Int {
|
||||
return when {
|
||||
hasDropdown == true -> R.drawable.ic_arrow_drop_down_24dp
|
||||
hasDropdown == false -> R.drawable.ic_arrow_drop_up_24dp
|
||||
incognito && navigationIcon !is DrawerArrowDrawable -> R.drawable.ic_blank_28dp
|
||||
else -> 0
|
||||
}
|
||||
|
@ -856,7 +856,6 @@ class LibraryController(
|
||||
binding.recyclerCover.isClickable = false
|
||||
binding.recyclerCover.isFocusable = false
|
||||
singleCategory = presenter.categories.size <= 1
|
||||
showDropdown()
|
||||
|
||||
if (preferences.showLibrarySearchSuggestions().get()) {
|
||||
activityBinding?.cardToolbar?.setOnLongClickListener {
|
||||
@ -880,18 +879,10 @@ class LibraryController(
|
||||
if (binding.filterBottomSheet.filterBottomSheet.sheetBehavior.isHidden()) {
|
||||
binding.filterBottomSheet.filterBottomSheet.isInvisible = true
|
||||
}
|
||||
activityBinding?.toolbar?.hideDropdown()
|
||||
activityBinding?.cardToolbar?.setOnLongClickListener(null)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onChangeEnded(handler: ControllerChangeHandler, type: ControllerChangeType) {
|
||||
super.onChangeEnded(handler, type)
|
||||
if (!type.isEnter) {
|
||||
activityBinding?.toolbar?.hideDropdown()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivityResumed(activity: Activity) {
|
||||
super.onActivityResumed(activity)
|
||||
if (!isBindingInitialized) return
|
||||
@ -931,7 +922,6 @@ class LibraryController(
|
||||
}
|
||||
adapter.setItems(mangaMap)
|
||||
singleCategory = presenter.categories.size <= 1
|
||||
showDropdown()
|
||||
binding.progress.isVisible = false
|
||||
if (!freshStart) {
|
||||
justStarted = false
|
||||
@ -975,16 +965,6 @@ class LibraryController(
|
||||
}
|
||||
}
|
||||
|
||||
private fun showDropdown() {
|
||||
if (onRoot) {
|
||||
if (!singleCategory) {
|
||||
activityBinding?.toolbar?.showDropdown()
|
||||
} else {
|
||||
activityBinding?.toolbar?.hideDropdown()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showSlideAnimation() {
|
||||
isAnimatingHopper = true
|
||||
val slide = 25f.dpToPx
|
||||
@ -1032,7 +1012,6 @@ class LibraryController(
|
||||
binding.recyclerCover.animate().translationY(translateY).start()
|
||||
binding.recyclerCover.animate().alpha(if (show) 0.75f else 0f).start()
|
||||
binding.libraryGridRecycler.recycler.suppressLayout(show)
|
||||
activityBinding?.toolbar?.showDropdown(!show)
|
||||
binding.swipeRefresh.isEnabled = !show
|
||||
setSubtitle()
|
||||
if (show) {
|
||||
|
Loading…
Reference in New Issue
Block a user