Skip to content

Commit 8f0ce01

Browse files
david-allisonmikehardy
authored andcommitted
fix(automatic-answer): don't show if menu is 'never show'
A user manually enabled the feature and explicitly set the menu item to 'never show', we should respect their wishes rather than try to be helpful introduced in 1788e22 Fixes 18693 (cherry picked from commit 3f25c5b)
1 parent 5d924e9 commit 8f0ce01

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,7 @@ open class Reviewer :
799799
}
800800
}
801801
menu.findItem(R.id.action_toggle_auto_advance).apply {
802+
if (actionButtons.status.autoAdvanceMenuIsNeverShown()) return@apply
802803
// always show if enabled (to allow disabling)
803804
// otherwise show if it will have an effect
804805
isVisible = automaticAnswer.isEnabled() || automaticAnswer.isUsable()

AnkiDroid/src/main/java/com/ichi2/anki/reviewer/ActionButtonStatus.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ class ActionButtonStatus {
112112

113113
fun flagsIsOverflown(): Boolean = customButtons[R.id.action_flag] == SHOW_AS_ACTION_NEVER
114114

115+
fun autoAdvanceMenuIsNeverShown(): Boolean = customButtons[R.id.action_toggle_auto_advance] == MENU_DISABLED
116+
115117
companion object {
116118
const val SHOW_AS_ACTION_NEVER = MenuItem.SHOW_AS_ACTION_NEVER
117119
const val SHOW_AS_ACTION_IF_ROOM = MenuItem.SHOW_AS_ACTION_IF_ROOM

0 commit comments

Comments
 (0)