Skip to content

Commit 2dce713

Browse files
committed
improvement(new reviewer): move "Hide hard and easy buttons"
to an Add-ons category, to avoid pushing Anki Desktop to implement it (as requested by David)
1 parent 147bced commit 2dce713

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

AnkiDroid/src/main/java/com/ichi2/anki/preferences/ReviewerOptionsFragment.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.ichi2.anki.preferences
1717

1818
import androidx.preference.ListPreference
19+
import androidx.preference.PreferenceCategory
1920
import androidx.preference.SwitchPreferenceCompat
2021
import com.ichi2.anki.CollectionManager
2122
import com.ichi2.anki.R
@@ -89,5 +90,8 @@ class ReviewerOptionsFragment :
8990
launchCatchingTask { CollectionPreferences.setShowIntervalsOnButtons(newValue) }
9091
}
9192
}
93+
94+
requirePreference<PreferenceCategory>(R.string.addons_category_key).title =
95+
CollectionManager.TR.qtMiscAddons()
9296
}
9397
}

AnkiDroid/src/main/res/values/preferences.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,5 +242,6 @@
242242
<string name="reviewer_menu_settings_key">reviewerMenuSettings</string>
243243
<string name="reviewer_frame_style_key">reviewerFrameStyle</string>
244244
<string name="reviewer_toolbar_position_key">reviewerToolbarPosition</string>
245+
<string name="addons_category_key">addonsCat</string>
245246

246247
</resources>

AnkiDroid/src/main/res/xml/preferences_reviewer.xml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,22 +82,16 @@
8282
<PreferenceCategory
8383
android:title="@string/answer_buttons">
8484

85-
<SwitchPreferenceCompat
86-
android:key="@string/show_estimates_preference"
87-
android:summary="@string/show_estimates_summ"
88-
android:title="@string/show_estimates" />
89-
9085
<SwitchPreferenceCompat
9186
android:defaultValue="false"
9287
android:key="@string/hide_answer_buttons_key"
9388
android:title="@string/hide_answer_buttons"
9489
/>
9590

9691
<SwitchPreferenceCompat
97-
android:defaultValue="false"
98-
android:key="@string/hide_hard_and_easy_key"
99-
android:title="@string/hide_hard_and_easy"
100-
/>
92+
android:key="@string/show_estimates_preference"
93+
android:summary="@string/show_estimates_summ"
94+
android:title="@string/show_estimates" />
10195

10296
<com.ichi2.preferences.SliderPreference
10397
android:title="@string/button_size"
@@ -108,4 +102,16 @@
108102
android:stepSize="10"
109103
app:displayFormat="@string/percentage"/>
110104
</PreferenceCategory>
105+
106+
<PreferenceCategory
107+
android:key="@string/addons_category_key"
108+
tools:title="Add-ons">
109+
110+
<SwitchPreferenceCompat
111+
android:defaultValue="false"
112+
android:key="@string/hide_hard_and_easy_key"
113+
android:title="@string/hide_hard_and_easy"
114+
/>
115+
116+
</PreferenceCategory>
111117
</androidx.preference.PreferenceScreen>

AnkiDroid/src/test/java/com/ichi2/anki/analytics/PreferencesAnalyticsTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class PreferencesAnalyticsTest : RobolectricTest() {
6666
R.string.pref_cat_plugins_key, // category_plugins
6767
R.string.pref_cat_workarounds_key, // category_workarounds
6868
R.string.pref_controls_tab_layout_key, // controlsTabLayout
69+
R.string.addons_category_key, // addonsCat
6970
// Preferences that only click: don't have a value
7071
R.string.tts_key, // tts
7172
R.string.pref_reset_languages_key, // resetLanguages

0 commit comments

Comments
 (0)