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