Skip to content

Commit 3f25c5b

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
1 parent 50f8fa9 commit 3f25c5b

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
@@ -882,6 +882,7 @@ open class Reviewer :
882882
}
883883
}
884884
menu.findItem(R.id.action_toggle_auto_advance).apply {
885+
if (actionButtons.status.autoAdvanceMenuIsNeverShown()) return@apply
885886
// always show if enabled (to allow disabling)
886887
// otherwise show if it will have an effect
887888
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
@@ -115,6 +115,8 @@ class ActionButtonStatus {
115115

116116
fun flagsIsOverflown(): Boolean = customButtons[R.id.action_flag] == SHOW_AS_ACTION_NEVER
117117

118+
fun autoAdvanceMenuIsNeverShown(): Boolean = customButtons[R.id.action_toggle_auto_advance] == MENU_DISABLED
119+
118120
companion object {
119121
const val SHOW_AS_ACTION_NEVER = MenuItem.SHOW_AS_ACTION_NEVER
120122
const val SHOW_AS_ACTION_IF_ROOM = MenuItem.SHOW_AS_ACTION_IF_ROOM

0 commit comments

Comments
 (0)