mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 20:31:02 -05:00
Add tooltips to bottom reader menu items
This commit is contained in:
parent
c255f57d95
commit
bff73b1b40
1 changed files with 28 additions and 13 deletions
|
@ -59,6 +59,7 @@ import eu.kanade.tachiyomi.util.system.toast
|
||||||
import eu.kanade.tachiyomi.util.view.defaultBar
|
import eu.kanade.tachiyomi.util.view.defaultBar
|
||||||
import eu.kanade.tachiyomi.util.view.hideBar
|
import eu.kanade.tachiyomi.util.view.hideBar
|
||||||
import eu.kanade.tachiyomi.util.view.isDefaultBar
|
import eu.kanade.tachiyomi.util.view.isDefaultBar
|
||||||
|
import eu.kanade.tachiyomi.util.view.setTooltip
|
||||||
import eu.kanade.tachiyomi.util.view.showBar
|
import eu.kanade.tachiyomi.util.view.showBar
|
||||||
import eu.kanade.tachiyomi.util.view.snack
|
import eu.kanade.tachiyomi.util.view.snack
|
||||||
import eu.kanade.tachiyomi.widget.SimpleAnimationListener
|
import eu.kanade.tachiyomi.widget.SimpleAnimationListener
|
||||||
|
@ -341,22 +342,32 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.actionReaderMode.setOnClickListener {
|
with(binding.actionReaderMode) {
|
||||||
val newReadingMode = ReadingModeType.getNextReadingMode(presenter.getMangaViewer(resolveDefault = false))
|
setTooltip(R.string.viewer)
|
||||||
presenter.setMangaViewer(newReadingMode.prefValue)
|
|
||||||
|
|
||||||
menuToggleToast?.cancel()
|
setOnClickListener {
|
||||||
menuToggleToast = toast(newReadingMode.stringRes)
|
val newReadingMode =
|
||||||
|
ReadingModeType.getNextReadingMode(presenter.getMangaViewer(resolveDefault = false))
|
||||||
|
presenter.setMangaViewer(newReadingMode.prefValue)
|
||||||
|
|
||||||
|
menuToggleToast?.cancel()
|
||||||
|
menuToggleToast = toast(newReadingMode.stringRes)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.actionRotation.setOnClickListener {
|
with(binding.actionRotation) {
|
||||||
val newOrientation = OrientationType.getNextOrientation(preferences.rotation().get(), resources)
|
setTooltip(R.string.pref_rotation_type)
|
||||||
|
|
||||||
preferences.rotation().set(newOrientation.prefValue)
|
setOnClickListener {
|
||||||
setOrientation(newOrientation.flag)
|
val newOrientation =
|
||||||
|
OrientationType.getNextOrientation(preferences.rotation().get(), resources)
|
||||||
|
|
||||||
menuToggleToast?.cancel()
|
preferences.rotation().set(newOrientation.prefValue)
|
||||||
menuToggleToast = toast(newOrientation.stringRes)
|
setOrientation(newOrientation.flag)
|
||||||
|
|
||||||
|
menuToggleToast?.cancel()
|
||||||
|
menuToggleToast = toast(newOrientation.stringRes)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
preferences.rotation().asImmediateFlow { updateRotationShortcut(it) }
|
preferences.rotation().asImmediateFlow { updateRotationShortcut(it) }
|
||||||
.onEach {
|
.onEach {
|
||||||
|
@ -364,8 +375,12 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()
|
||||||
}
|
}
|
||||||
.launchIn(lifecycleScope)
|
.launchIn(lifecycleScope)
|
||||||
|
|
||||||
binding.actionSettings.setOnClickListener {
|
with(binding.actionSettings) {
|
||||||
ReaderSettingsSheet(this).show()
|
setTooltip(R.string.action_settings)
|
||||||
|
|
||||||
|
setOnClickListener {
|
||||||
|
ReaderSettingsSheet(this@ReaderActivity).show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set initial visibility
|
// Set initial visibility
|
||||||
|
|
Loading…
Reference in a new issue