mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-01-31 17:12:44 +01:00
Fix clearing no existing dialog fragment (#1242)
This commit is contained in:
parent
d0869b235a
commit
e6247d4428
@ -324,9 +324,7 @@ class MainActivity : BaseActivity<MainPresenter, ActivityMainBinding>(), MainVie
|
||||
}
|
||||
|
||||
override fun showAccountPicker(studentWithSemesters: List<StudentWithSemesters>) {
|
||||
if (supportFragmentManager.isStateSaved) return
|
||||
|
||||
navController.showDialogFragment(AccountQuickDialog.newInstance(studentWithSemesters))
|
||||
showDialogFragment(AccountQuickDialog.newInstance(studentWithSemesters))
|
||||
}
|
||||
|
||||
override fun showActionBarElevation(show: Boolean) {
|
||||
@ -342,9 +340,18 @@ class MainActivity : BaseActivity<MainPresenter, ActivityMainBinding>(), MainVie
|
||||
(navController.currentStack?.getOrNull(0) as? MainView.MainChildView)?.onFragmentChanged()
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun showDialogFragment(dialog: DialogFragment) {
|
||||
if (supportFragmentManager.isStateSaved) return
|
||||
|
||||
//Deprecated method is used here to avoid fragnav bug
|
||||
if (navController.currentDialogFrag?.fragmentManager == null) {
|
||||
FragNavController::class.java.getDeclaredField("mCurrentDialogFrag").apply {
|
||||
isAccessible = true
|
||||
set(navController, null)
|
||||
}
|
||||
}
|
||||
|
||||
navController.showDialogFragment(dialog)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user