mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-08 06:42:21 -04:00
Merge pull request #2880 from kiwix/Issue#2730
Fix app crash when user navigates away and then returns to the app in…
This commit is contained in:
commit
a89258b85b
@ -60,6 +60,7 @@ class KiwixMainActivity : CoreMainActivity() {
|
||||
override val topLevelDestinations =
|
||||
setOf(R.id.downloadsFragment, R.id.libraryFragment, R.id.readerFragment)
|
||||
|
||||
private var isIntroScreenVisible: Boolean = false
|
||||
override fun injection(coreComponent: CoreComponent) {
|
||||
cachedComponent.inject(this)
|
||||
}
|
||||
@ -98,12 +99,15 @@ class KiwixMainActivity : CoreMainActivity() {
|
||||
handleDrawerOnNavigation()
|
||||
}
|
||||
}
|
||||
if (sharedPreferenceUtil.showIntro()) {
|
||||
if (sharedPreferenceUtil.showIntro() && !isIntroScreenNotVisible()) {
|
||||
navigate(KiwixReaderFragmentDirections.actionReaderFragmentToIntroFragment())
|
||||
}
|
||||
sharedPreferenceUtil.setIsPlayStoreBuildType(BuildConfig.IS_PLAYSTORE)
|
||||
}
|
||||
|
||||
private fun isIntroScreenNotVisible(): Boolean =
|
||||
isIntroScreenVisible.also { isIntroScreenVisible = true }
|
||||
|
||||
override fun onSupportActionModeStarted(mode: ActionMode) {
|
||||
super.onSupportActionModeStarted(mode)
|
||||
actionMode = mode
|
||||
|
Loading…
x
Reference in New Issue
Block a user