We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23b1e3d commit bdc282bCopy full SHA for bdc282b
AnkiDroid/src/main/java/com/ichi2/anki/preferences/ControlsSettingsFragment.kt
@@ -76,11 +76,11 @@ class ControlsSettingsFragment :
76
setDynamicTitle()
77
}
78
79
- @NeedsTest("General category is kept and the other elements are removed")
+ @NeedsTest("Only the tab elements are removed")
80
override fun onTabUnselected(tab: TabLayout.Tab?) {
81
val preferences = preferenceScreen.children.toList()
82
- // 0 is the `General` category, which should be kept
83
- for (pref in preferences.subList(1, preferences.size)) {
+ val tabsPrefIndex = preferences.indexOfFirst { it is ControlsTabPreference }
+ for (pref in preferences.subList(tabsPrefIndex + 1, preferences.size)) {
84
preferenceScreen.removePreference(pref)
85
86
0 commit comments