Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MorenoTropical committed Jan 5, 2024
1 parent d3f874e commit b02eab6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -804,11 +804,11 @@ open class Reviewer :
if (mTTS.enabled && !mActionButtons.status.selectTtsIsDisabled()) {
menu.findItem(R.id.action_select_tts).isVisible = true
}
if (!suspendNoteAvailable()) {
if (!suspendNoteAvailable() && !mActionButtons.status.suspendIsDisabled()) {
menu.findItem(R.id.action_suspend).isVisible = false
menu.findItem(R.id.action_suspend_card).isVisible = true
}
if (!buryNoteAvailable()) {
if (!buryNoteAvailable() && !mActionButtons.status.buryIsDisabled()) {
menu.findItem(R.id.action_bury).isVisible = false
menu.findItem(R.id.action_bury_card).isVisible = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ class ActionButtonStatus {
setupButton(preferences, R.id.action_select_tts, "customButtonSelectTts", SHOW_AS_ACTION_NEVER)
setupButton(preferences, R.id.action_open_deck_options, "customButtonDeckOptions", SHOW_AS_ACTION_NEVER)
setupButton(preferences, R.id.action_bury, "customButtonBury", SHOW_AS_ACTION_NEVER)
setupButton(preferences, R.id.action_bury_card, "customButtonBury", SHOW_AS_ACTION_NEVER)
setupButton(preferences, R.id.action_suspend, "customButtonSuspend", SHOW_AS_ACTION_NEVER)
setupButton(preferences, R.id.action_suspend_card, "customButtonSuspend", SHOW_AS_ACTION_NEVER)
setupButton(preferences, R.id.action_mark_card, "customButtonMarkCard", SHOW_AS_ACTION_IF_ROOM)
setupButton(preferences, R.id.action_delete, "customButtonDelete", SHOW_AS_ACTION_NEVER)
setupButton(preferences, R.id.action_toggle_mic_tool_bar, "customButtonToggleMicToolBar", SHOW_AS_ACTION_NEVER)
Expand Down Expand Up @@ -98,6 +100,10 @@ class ActionButtonStatus {
return mCustomButtons[R.id.action_change_whiteboard_pen_color] == MENU_DISABLED
}

fun suspendIsDisabled(): Boolean = mCustomButtons[R.id.action_suspend] == MENU_DISABLED

fun buryIsDisabled(): Boolean = mCustomButtons[R.id.action_bury] == MENU_DISABLED

companion object {
const val SHOW_AS_ACTION_NEVER = MenuItem.SHOW_AS_ACTION_NEVER
const val SHOW_AS_ACTION_IF_ROOM = MenuItem.SHOW_AS_ACTION_IF_ROOM
Expand Down

0 comments on commit b02eab6

Please sign in to comment.