mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-09 05:25:08 +01:00
Fix recents intent for latest chapters and history
This commit is contained in:
parent
780585caed
commit
283808a865
@ -476,17 +476,28 @@ open class MainActivity : BaseActivity<MainActivityBinding>(), DownloadServiceLi
|
||||
when (intent.action) {
|
||||
SHORTCUT_LIBRARY -> binding.bottomNav.selectedItemId = R.id.nav_library
|
||||
SHORTCUT_RECENTLY_UPDATED, SHORTCUT_RECENTLY_READ -> {
|
||||
binding.bottomNav.selectedItemId = R.id.nav_recents
|
||||
val viewType = when (intent.action) {
|
||||
SHORTCUT_RECENTLY_UPDATED -> RecentsPresenter.VIEW_TYPE_ONLY_UPDATES
|
||||
else -> RecentsPresenter.VIEW_TYPE_ONLY_HISTORY
|
||||
if (binding.bottomNav.selectedItemId != R.id.nav_recents) {
|
||||
binding.bottomNav.selectedItemId = R.id.nav_recents
|
||||
} else {
|
||||
router.popToRoot()
|
||||
}
|
||||
binding.bottomNav.post {
|
||||
val controller = router.backstack.firstOrNull()?.controller() as? RecentsController
|
||||
controller?.tempJumpTo(
|
||||
when (intent.action) {
|
||||
SHORTCUT_RECENTLY_UPDATED -> RecentsPresenter.VIEW_TYPE_ONLY_UPDATES
|
||||
else -> RecentsPresenter.VIEW_TYPE_ONLY_HISTORY
|
||||
}
|
||||
)
|
||||
}
|
||||
router.pushController(RecentsController(viewType).withFadeTransaction())
|
||||
}
|
||||
SHORTCUT_BROWSE -> binding.bottomNav.selectedItemId = R.id.nav_browse
|
||||
SHORTCUT_EXTENSIONS -> {
|
||||
binding.bottomNav.selectedItemId = R.id.nav_browse
|
||||
router.popToRoot()
|
||||
if (binding.bottomNav.selectedItemId != R.id.nav_recents) {
|
||||
binding.bottomNav.selectedItemId = R.id.nav_browse
|
||||
} else {
|
||||
router.popToRoot()
|
||||
}
|
||||
binding.bottomNav.post {
|
||||
val controller =
|
||||
router.backstack.firstOrNull()?.controller() as? BrowseController
|
||||
|
@ -323,7 +323,7 @@ class RecentsController(bundle: Bundle? = null) :
|
||||
return true
|
||||
}
|
||||
if (presenter.preferences.recentsViewType().get() != presenter.viewType) {
|
||||
tempJumpTo(RecentsPresenter.VIEW_TYPE_GROUP_ALL)
|
||||
tempJumpTo(presenter.preferences.recentsViewType().get())
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@ -440,7 +440,7 @@ class RecentsController(bundle: Bundle? = null) :
|
||||
onItemLongClick(position)
|
||||
}
|
||||
|
||||
private fun tempJumpTo(viewType: Int) {
|
||||
fun tempJumpTo(viewType: Int) {
|
||||
presenter.toggleGroupRecents(viewType, false)
|
||||
activityBinding?.mainTabs?.selectTab(activityBinding?.mainTabs?.getTabAt(viewType))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user