Repository navigation
fix(deck-picker): retain scheduler upgrade prompt - #22635
Merged
Merged
Conversation
Restore the mandatory scheduler decision with a DialogFragment and deliver its result to the current DeckPicker. Keep the existing upgrade, Cancel, Back and help behavior without retaining activity-owned callbacks. Add phone and tablet regression tests for repeated recreation, collection refreshes, confirmation and cancellation. Fixes ankidroid#22632 GPT-6.1 Sol implemented the lifecycle fix and regression tests. Assisted-by: GPT-6.1 Sol
david-allison
approved these changes
Oct 20, 2026
david-allison
left a comment
Member
There was a problem hiding this comment.
Thanks!
Quick nit to use this extension method: I want to keep DeckPicker lean, and this would remove a few lines of code
fun FragmentActivity.registerSchedulerUpgradeHandler(
onUpgrade: () -> Unit,
onCancel: () -> Unit,
) {
setFragmentResultListener(REQUEST_UPGRADE_SCHEDULER) { _, result ->
if (result.getBoolean(RESULT_UPGRADE)) {
onUpgrade()
} else {
onCancel()
}
}
}
mikehardy
approved these changes
Oct 21, 2026
mikehardy
left a comment
Member
There was a problem hiding this comment.
Assisted-by: grok-4.7-medium
Thanks — the upgrade prompt now survives as a dialog the fragment manager restores.
Replayed the tip onto current main without pushing (PRE_TIP 8e581f95). Local lint/CQ, full unit, and the playRelease emulator suite on API 36 (emulator-5554 / API36_GAPI_PS16K) passed.
The scheduler upgrade prompt is a DialogFragment. OK, Cancel, and Back are delivered to the replacement DeckPicker instead of a window that rotation can drop. Looks good as the second approve.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #22632.
Restore the scheduler-upgrade prompt across DeckPicker recreation using a DialogFragment. Deliver upgrade and cancellation decisions to the current activity.
Adds phone and tablet regression tests for repeated recreation, collection refreshes, confirmation, Cancel, and Back.