You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes part of #5345: Fixing restarting of app on config change. (#5953)
Fixes part of #5345 :
This pull request improves the handling of dialog persistence in the
Feature Flags and Platform Parameters developer options screens,
specifically ensuring that pending changes and restart dialogs remain
visible after configuration changes (such as device rotation). It
introduces a new state variable to track dialog visibility, updates
fragment and presenter logic to restore dialogs, and adds tests to
verify this behavior. Additionally, it refines the app restart logic to
avoid unnecessary restarts during configuration changes.
**Dialog Persistence and State Management**
* Added an `PendingDialogListener` and implemented in
`PlatformParametersFragment` and `FeatureFlagsFragment` when the save
and discard are called from `PendingChangesDialogFragment`.
**App Restart Logic**
* Modified the app restart logic in both presenters to only restart the
app if the configuration is not changing, preventing unnecessary
restarts during device rotation.
**Testing**
* Added new instrumented tests for both fragments to verify that dialogs
(pending changes and restart dialogs) persist after configuration
changes, improving reliability and user experience.
**Code Cleanup**
* Removed extra `onBackNavigation` code in the
`PlatformParametersFragmentPresenter.kt` that might have been
duplicated.
These changes ensure a smoother and more predictable experience for
developers using the feature flags and platform parameters screens,
especially when making changes that require confirmation dialogs.
#### Screenrecording:
https://github.com/user-attachments/assets/4642d72f-bfce-4179-9524-0e7aaa3971a9
## Essential Checklist
<!-- Please tick the relevant boxes by putting an "x" in them. -->
- [x] The PR title and explanation each start with "Fix #bugnum: " (If
this PR fixes part of an issue, prefix the title with "Fix part of
#bugnum: ...".)
- [x] Any changes to
[scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets)
files have their rationale included in the PR explanation.
- [x] The PR follows the [style
guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide).
- [x] The PR does not contain any unnecessary code changes from Android
Studio
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)).
- [x] The PR is made from a branch that's **not** called "develop" and
is up-to-date with "develop".
- [x] The PR is **assigned** to the appropriate reviewers
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)).
---------
Co-authored-by: theayushyadav11 <[email protected]>
Co-authored-by: Manas <[email protected]>
Co-authored-by: Adhiambo Peres <[email protected]>
Co-authored-by: RD Rama Devi <[email protected]>
0 commit comments