Skip to content

Commit 46cc209

Browse files
committed
fix(card-browser): drop configChanges to fix rotation
Bug: The app bar menu items and fonts were not updated As we now use a ViewModel, the Card Browser state can survive rotation changes, so let the recreation process handle it Part of issue 8589 Fixes 19289
1 parent da36f60 commit 46cc209

File tree

4 files changed

+3
-2
lines changed

4 files changed

+3
-2
lines changed

AnkiDroid/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@
325325
android:label="@string/card_browser"
326326
android:theme="@style/Theme_Dark.Launcher"
327327
android:exported="true"
328-
android:configChanges="keyboardHidden|orientation|screenSize"
329328
android:parentActivityName=".DeckPicker"
330329
>
331330
<intent-filter android:label="@string/card_browser">

AnkiDroid/src/main/java/com/ichi2/anki/browser/CardBrowserFragment.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,7 @@ class CardBrowserFragment :
656656
}
657657
}
658658

659+
// TODO: This dialog should survive activity recreation
659660
fun showChangeDeckDialog() =
660661
launchCatchingTask {
661662
if (!activityViewModel.hasSelectedAnyRows()) {

AnkiDroid/src/main/java/com/ichi2/anki/dialogs/GradeNowDialog.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import timber.log.Timber
5151
*
5252
* @see net.ankiweb.rsdroid.Backend.gradeNow
5353
*/
54+
// TODO: handle rotation, via a DialogFragment with IdsFile handling or Fragment Result API
5455
@NeedsTest("UI test for this dialog")
5556
@NeedsTest("Menu only displayed if cards selected")
5657
@NeedsTest("Suspended card handling")

AnkiDroid/src/main/java/com/ichi2/anki/scheduling/SetDueDateDialog.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class SetDueDateDialog : DialogFragment() {
126126
// (the window size & position was incorrectly calculated)
127127

128128
// There was a minor bug in Reviewer (timer is reset), which meant that
129-
// generally we could not remove the configChanges, we probably can with the CardBrowser
129+
// generally we could not remove the configChanges
130130
// For now, only recreate the activity if this dialog is open
131131
if (getScreenRotation() != initialRotation) {
132132
Timber.d("recreating activity: orientation changed with 'Set due date' open")

0 commit comments

Comments
 (0)