disabled the Settings Font Size option on Android 12 or higher
This commit is contained in:
parent
3070fc4c4c
commit
2269ac4717
2 changed files with 19 additions and 5 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
package io.github.sspanak.tt9.preferences.screens;
|
package io.github.sspanak.tt9.preferences.screens;
|
||||||
|
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
|
||||||
|
|
@ -8,6 +9,7 @@ import androidx.preference.PreferenceFragmentCompat;
|
||||||
|
|
||||||
import io.github.sspanak.tt9.preferences.PreferencesActivity;
|
import io.github.sspanak.tt9.preferences.PreferencesActivity;
|
||||||
import io.github.sspanak.tt9.preferences.custom.ScreenPreferencesList;
|
import io.github.sspanak.tt9.preferences.custom.ScreenPreferencesList;
|
||||||
|
import io.github.sspanak.tt9.preferences.settings.SettingsUI;
|
||||||
import io.github.sspanak.tt9.util.Logger;
|
import io.github.sspanak.tt9.util.Logger;
|
||||||
|
|
||||||
abstract public class BaseScreenFragment extends PreferenceFragmentCompat {
|
abstract public class BaseScreenFragment extends PreferenceFragmentCompat {
|
||||||
|
|
@ -87,7 +89,12 @@ abstract public class BaseScreenFragment extends PreferenceFragmentCompat {
|
||||||
public void resetFontSize(boolean reloadList) {
|
public void resetFontSize(boolean reloadList) {
|
||||||
initPreferencesList();
|
initPreferencesList();
|
||||||
preferencesList.getAll(reloadList, true);
|
preferencesList.getAll(reloadList, true);
|
||||||
preferencesList.setFontSize(activity.getSettings().getSettingsFontSize());
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||||
|
preferencesList.setFontSize(SettingsUI.FONT_SIZE_DEFAULT);
|
||||||
|
} else {
|
||||||
|
preferencesList.setFontSize(activity.getSettings().getSettingsFontSize());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package io.github.sspanak.tt9.preferences.screens.appearance;
|
package io.github.sspanak.tt9.preferences.screens.appearance;
|
||||||
|
|
||||||
|
import android.os.Build;
|
||||||
|
|
||||||
import androidx.preference.DropDownPreference;
|
import androidx.preference.DropDownPreference;
|
||||||
import androidx.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
|
|
||||||
|
|
@ -19,11 +21,16 @@ public class ItemSelectSettingsFontSize extends ItemDropDown {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemDropDown populate() {
|
public ItemDropDown populate() {
|
||||||
LinkedHashMap<Integer, String> themes = new LinkedHashMap<>();
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||||
themes.put(SettingsStore.FONT_SIZE_DEFAULT, screen.getString(R.string.pref_font_size_default));
|
if (item != null) item.setVisible(false);
|
||||||
themes.put(SettingsStore.FONT_SIZE_LARGE, screen.getString(R.string.pref_font_size_large));
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
super.populateIntegers(themes);
|
LinkedHashMap<Integer, String> sizes = new LinkedHashMap<>();
|
||||||
|
sizes.put(SettingsStore.FONT_SIZE_DEFAULT, screen.getString(R.string.pref_font_size_default));
|
||||||
|
sizes.put(SettingsStore.FONT_SIZE_LARGE, screen.getString(R.string.pref_font_size_large));
|
||||||
|
|
||||||
|
super.populateIntegers(sizes);
|
||||||
setValue(String.valueOf(new SettingsStore(screen.getContext()).getSettingsFontSize()));
|
setValue(String.valueOf(new SettingsStore(screen.getContext()).getSettingsFontSize()));
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue