Allow clicking the toolbar to go to the manga
Co-authored-by: Jobobby04 <jobobby04@users.noreply.github.com> (cherry picked from commit 8bb69c455b3af3c90340c8969f2c0f474daedbcb)
This commit is contained in:
parent
0185d5f7d6
commit
2845d8cc98
@ -367,7 +367,6 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()
|
|||||||
* Initializes the reader menu. It sets up click listeners and the initial visibility.
|
* Initializes the reader menu. It sets up click listeners and the initial visibility.
|
||||||
*/
|
*/
|
||||||
private fun initializeMenu() {
|
private fun initializeMenu() {
|
||||||
// Set toolbar
|
|
||||||
setSupportActionBar(binding.toolbar)
|
setSupportActionBar(binding.toolbar)
|
||||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||||
binding.toolbar.setNavigationOnClickListener {
|
binding.toolbar.setNavigationOnClickListener {
|
||||||
@ -387,6 +386,18 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()
|
|||||||
insets
|
insets
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binding.toolbar.setOnClickListener {
|
||||||
|
presenter.manga?.id?.let { id ->
|
||||||
|
startActivity(
|
||||||
|
Intent(this, MainActivity::class.java).apply {
|
||||||
|
action = MainActivity.SHORTCUT_MANGA
|
||||||
|
putExtra(MangaController.MANGA_EXTRA, id)
|
||||||
|
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Init listeners on bottom menu
|
// Init listeners on bottom menu
|
||||||
binding.pageSeekbar.setOnSeekBarChangeListener(
|
binding.pageSeekbar.setOnSeekBarChangeListener(
|
||||||
object : SimpleSeekBarListener() {
|
object : SimpleSeekBarListener() {
|
||||||
@ -593,19 +604,6 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()
|
|||||||
}
|
}
|
||||||
.launchIn(lifecycleScope)
|
.launchIn(lifecycleScope)
|
||||||
|
|
||||||
binding.toolbar.clicks()
|
|
||||||
.onEach {
|
|
||||||
presenter.manga?.id?.let { id ->
|
|
||||||
startActivity(
|
|
||||||
Intent(this, MainActivity::class.java)
|
|
||||||
.setAction(MainActivity.SHORTCUT_MANGA)
|
|
||||||
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
|
||||||
.putExtra(MangaController.MANGA_EXTRA, id)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.launchIn(lifecycleScope)
|
|
||||||
|
|
||||||
autoScrollFlow
|
autoScrollFlow
|
||||||
.onEach {
|
.onEach {
|
||||||
viewer.let { v ->
|
viewer.let { v ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user