Skip to content

Commit

Permalink
feat: Hide 'Hard' and 'Easy' buttons setting
Browse files Browse the repository at this point in the history
It is a frequently requested feature, helps a big number of users that
only use two buttons, and it is quite simple to implement
  • Loading branch information
BrayanDSO authored and mikehardy committed Aug 16, 2024
1 parent c85da52 commit 4af8ad3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ class ReviewerFragment :
answerButtonsLayout.isVisible = false
}
}

if (sharedPrefs().getBoolean(getString(R.string.hide_hard_and_easy_key), false)) {
hardButton.isVisible = false
easyButton.isVisible = false
}
}

private fun setupCounts(view: View) {
Expand Down
1 change: 1 addition & 0 deletions AnkiDroid/src/main/res/values/10-preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -444,4 +444,5 @@ this formatter is used if the bind only applies to both the question and the ans
>All</string>
<string name="ignore_display_cutout" maxLength="41">Ignore display cutout</string>
<string name="hide_answer_buttons" maxLength="41">Hide answer buttons</string>
<string name="hide_hard_and_easy" maxLength="41">Hide ‘Hard’ and ‘Easy’ buttons</string>
</resources>
1 change: 1 addition & 0 deletions AnkiDroid/src/main/res/values/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,6 @@
<string name="hide_system_bars_key">hideSystemBars</string>
<string name="ignore_display_cutout_key">ignoreDisplayCutout</string>
<string name="hide_answer_buttons_key">hideAnswerButtons</string>
<string name="hide_hard_and_easy_key">hideHardAndEasy</string>

</resources>
6 changes: 6 additions & 0 deletions AnkiDroid/src/main/res/xml/preferences_reviewer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,10 @@
android:key="@string/hide_answer_buttons_key"
android:title="@string/hide_answer_buttons"
/>

<SwitchPreferenceCompat
android:defaultValue="false"
android:key="@string/hide_hard_and_easy_key"
android:title="@string/hide_hard_and_easy"
/>
</androidx.preference.PreferenceScreen>

0 comments on commit 4af8ad3

Please sign in to comment.