Remove system default theme option on API < 27

Closes #1252
parent 389b2b5b
......@@ -44,6 +44,7 @@ import org.briarproject.briar.android.navdrawer.NavDrawerActivity;
import org.briarproject.briar.android.util.UiUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.logging.Logger;
......@@ -210,6 +211,13 @@ public class SettingsFragment extends PreferenceFragmentCompat
return true;
});
if (SDK_INT < 27) {
// remove System Default Theme option
List<CharSequence> entries =
new ArrayList<>(Arrays.asList(theme.getEntries()));
entries.remove(getString(R.string.pref_theme_system));
theme.setEntries(entries.toArray(new CharSequence[0]));
}
if (IS_DEBUG_BUILD) {
findPreference("pref_key_explode").setOnPreferenceClickListener(
preference -> {
......
......@@ -63,10 +63,10 @@
<item>@string/pref_theme_auto</item>
<item>@string/pref_theme_system</item>
</string-array>
<string name="pref_theme_light_value">light</string>
<string name="pref_theme_dark_value">dark</string>
<string name="pref_theme_auto_value">auto</string>
<string name="pref_theme_system_value">system</string>
<string name="pref_theme_light_value" translatable="false">light</string>
<string name="pref_theme_dark_value" translatable="false">dark</string>
<string name="pref_theme_auto_value" translatable="false">auto</string>
<string name="pref_theme_system_value" translatable="false">system</string>
<string-array name="pref_theme_values">
<item>@string/pref_theme_light_value</item>
<item>@string/pref_theme_dark_value</item>
......@@ -82,8 +82,8 @@
<item>@string/pref_lock_timeout_30</item>
<item>@string/pref_lock_timeout_60</item>
</string-array>
<string name="pref_lock_timeout_value_default">5</string>
<string name="pref_lock_timeout_value_never">-1</string>
<string name="pref_lock_timeout_value_default" translatable="false">5</string>
<string name="pref_lock_timeout_value_never" translatable="false">-1</string>
<string-array name="pref_key_lock_timeout_values">
<item>@string/pref_lock_timeout_value_never</item>
<item>1</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment