1
0
Fork 0

Adjustable Settings font size (#500)

This commit is contained in:
sspanak 2024-04-25 10:46:53 +03:00
parent c9e5707803
commit b609178976
51 changed files with 481 additions and 157 deletions

View file

@ -0,0 +1,26 @@
package io.github.sspanak.tt9.preferences.custom;
import android.content.Context;
import android.util.AttributeSet;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import io.github.sspanak.tt9.R;
final public class PreferencePlainText extends ScreenPreference {
public PreferencePlainText(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); }
public PreferencePlainText(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); }
public PreferencePlainText(@NonNull Context context, @Nullable AttributeSet attrs) { super(context, attrs); }
public PreferencePlainText(@NonNull Context context) { super(context); }
@Override
protected int getDefaultLayout() {
return R.layout.pref_plain_text;
}
@Override
protected int getLargeLayout() {
return R.layout.pref_plain_text_large;
}
}

View file

@ -0,0 +1,97 @@
package io.github.sspanak.tt9.preferences.custom;
import android.content.Context;
import android.util.AttributeSet;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.preference.DropDownPreference;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceViewHolder;
import androidx.preference.SwitchPreferenceCompat;
import io.github.sspanak.tt9.R;
import io.github.sspanak.tt9.preferences.settings.SettingsStore;
import io.github.sspanak.tt9.util.Logger;
abstract public class ScreenPreference extends Preference {
private int SMALL_LAYOUT = 0;
public ScreenPreference(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
public ScreenPreference(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public ScreenPreference(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public ScreenPreference(@NonNull Context context) {
super(context);
}
@Override
public void onBindViewHolder(@NonNull PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
boolean largeFont = new SettingsStore(getContext()).getSettingsFontSize() == SettingsStore.FONT_SIZE_LARGE;
int layout = largeFont ? getLargeLayout() : getDefaultLayout();
setLayoutResource(layout);
}
public static int getLargeLayout(Preference pref) {
if (pref instanceof PreferenceCategory) {
return R.layout.pref_category;
} else if (pref instanceof SwitchPreferenceCompat) {
return R.layout.pref_switch;
} else if (pref instanceof DropDownPreference) {
return R.layout.pref_dropdown;
} else {
return R.layout.pref_text;
}
}
public static int getDefaultLayout(Preference pref) {
if (pref instanceof PreferenceCategory) {
return new PreferenceCategory(pref.getContext()).getLayoutResource();
} else if (pref instanceof SwitchPreferenceCompat) {
return new SwitchPreferenceCompat(pref.getContext()).getLayoutResource();
} else if (pref instanceof DropDownPreference) {
return new DropDownPreference(pref.getContext()).getLayoutResource();
} else {
return new Preference(pref.getContext()).getLayoutResource();
}
}
public static void setFontSize(Preference pref, int fontSize) {
int layout;
if (fontSize == SettingsStore.FONT_SIZE_LARGE) {
layout = getLargeLayout(pref);
} else if (fontSize == SettingsStore.FONT_SIZE_DEFAULT) {
layout = getDefaultLayout(pref);
} else {
Logger.w(ScreenPreference.class.getSimpleName(), "Unknown font size: " + fontSize);
return;
}
pref.setIconSpaceReserved(false);
pref.setLayoutResource(layout);
pref.setSingleLineTitle(pref instanceof PreferenceCategory);
}
protected int getDefaultLayout() {
if (SMALL_LAYOUT == 0) {
SMALL_LAYOUT = new Preference(getContext()).getLayoutResource();
}
return SMALL_LAYOUT;
}
abstract protected int getLargeLayout();
}

View file

@ -0,0 +1,79 @@
package io.github.sspanak.tt9.preferences.custom;
import androidx.annotation.NonNull;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceScreen;
import java.util.ArrayList;
public class ScreenPreferencesList {
@NonNull private final PreferenceScreen axScreen;
@NonNull private final ArrayList<Preference> preferences;
public ScreenPreferencesList(@NonNull PreferenceScreen screen) {
this.axScreen = screen;
preferences = new ArrayList<>();
}
public int size() {
int count = 0;
for (int i = axScreen.getPreferenceCount(); i > 0; i--) {
Preference pref = axScreen.getPreference(i - 1);
if (pref.isVisible()) {
count += pref instanceof PreferenceCategory ? ((PreferenceCategory) pref).getPreferenceCount() : 1;
}
}
return count;
}
public void setFontSize(int fontSize) {
for (Preference pref : preferences) {
ScreenPreference.setFontSize(pref, fontSize);
}
}
public void getAll(boolean noCache, boolean includeCategories) {
if (noCache) {
preferences.clear();
}
if (preferences.isEmpty()) {
addFromScreen(includeCategories);
}
}
private void addFromScreen(boolean includeCategories) {
for (int i = axScreen.getPreferenceCount(); i > 0; i--) {
add(axScreen.getPreference(i - 1), includeCategories);
}
}
private void add(@NonNull Preference pref, boolean includeCategories) {
if (!pref.isVisible()) {
return;
}
if (pref instanceof PreferenceCategory) {
addCategory((PreferenceCategory) pref);
}
if (includeCategories || !(pref instanceof PreferenceCategory)) {
preferences.add(pref);
}
}
private void addCategory(@NonNull PreferenceCategory category) {
for (int i = category.getPreferenceCount(); i > 0; i--) {
add(category.getPreference(i - 1), false);
}
}
}

View file

@ -4,16 +4,15 @@ import android.os.Bundle;
import android.view.MenuItem;
import androidx.annotation.NonNull;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceScreen;
import io.github.sspanak.tt9.preferences.PreferencesActivity;
import io.github.sspanak.tt9.preferences.custom.ScreenPreferencesList;
import io.github.sspanak.tt9.util.Logger;
abstract public class BaseScreenFragment extends PreferenceFragmentCompat {
protected PreferencesActivity activity;
private ScreenPreferencesList preferencesList;
protected void init(PreferencesActivity activity) {
@ -37,6 +36,13 @@ abstract public class BaseScreenFragment extends PreferenceFragmentCompat {
}
private void initPreferencesList() {
if (preferencesList == null) {
preferencesList = new ScreenPreferencesList(getPreferenceScreen());
}
}
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
setHasOptionsMenu(true); // enable "back" in "onOptionsItemSelected()"
@ -73,17 +79,16 @@ abstract public class BaseScreenFragment extends PreferenceFragmentCompat {
public int getPreferenceCount() {
PreferenceScreen screen = getPreferenceScreen();
initPreferencesList();
return preferencesList.size();
}
int count = 0;
for (int i = screen.getPreferenceCount(); i > 0; i--) {
Preference pref = screen.getPreference(i - 1);
if (pref.isVisible()) {
count += pref instanceof PreferenceCategory ? ((PreferenceCategory) pref).getPreferenceCount() : 1;
}
}
return count;
public void resetFontSize(boolean reloadList) {
initPreferencesList();
preferencesList.getAll(reloadList, true);
preferencesList.setFontSize(activity.getSettings().getSettingsFontSize());
}

View file

@ -32,6 +32,7 @@ public class MainSettingsScreen extends BaseScreenFragment {
createSettingsSection();
addHelpLink();
createAboutSection();
resetFontSize(false);
}
@ -40,6 +41,7 @@ public class MainSettingsScreen extends BaseScreenFragment {
init(); // changing the theme recreates the PreferencesActivity, making "this.activity" NULL, so we reinitialize it.
super.onResume();
createSettingsSection();
resetFontSize(false);
}

View file

@ -34,6 +34,8 @@ public class UsageStatsScreen extends BaseScreenFragment {
return true;
});
}
resetFontSize(false);
}
private void printSummary() {

View file

@ -26,5 +26,12 @@ public class AppearanceScreen extends BaseScreenFragment {
.enableClickHandler();
(new ItemStatusIcon(findPreference(ItemStatusIcon.NAME), activity.getSettings())).populate();
(new ItemSelectSettingsFontSize(findPreference(ItemSelectSettingsFontSize.NAME), this))
.populate()
.preview()
.enableClickHandler();
resetFontSize(true);
}
}

View file

@ -0,0 +1,41 @@
package io.github.sspanak.tt9.preferences.screens.appearance;
import androidx.preference.DropDownPreference;
import androidx.preference.Preference;
import java.util.LinkedHashMap;
import io.github.sspanak.tt9.R;
import io.github.sspanak.tt9.preferences.items.ItemDropDown;
import io.github.sspanak.tt9.preferences.settings.SettingsStore;
public class ItemSelectSettingsFontSize extends ItemDropDown {
public static final String NAME = "pref_font_size";
private final AppearanceScreen screen;
public ItemSelectSettingsFontSize(DropDownPreference item, AppearanceScreen screen) {
super(item);
this.screen = screen;
}
public ItemDropDown populate() {
LinkedHashMap<Integer, String> themes = new LinkedHashMap<>();
themes.put(SettingsStore.FONT_SIZE_DEFAULT, screen.getString(R.string.pref_font_size_default));
themes.put(SettingsStore.FONT_SIZE_LARGE, screen.getString(R.string.pref_font_size_large));
super.populateIntegers(themes);
setValue(String.valueOf(new SettingsStore(screen.getContext()).getSettingsFontSize()));
return this;
}
@Override
protected boolean onClick(Preference preference, Object newSize) {
if (super.onClick(preference, newSize)) {
screen.resetFontSize(true);
return true;
}
return false;
}
}

View file

@ -36,6 +36,8 @@ public class DebugScreen extends BaseScreenFragment {
SwitchPreferenceCompat systemLogs = findPreference(SYSTEM_LOGS_SWITCH);
boolean includeSystemLogs = systemLogs != null && systemLogs.isChecked();
printLogs(includeSystemLogs);
resetFontSize(false);
}
private void initSystemLogsSwitch() {

View file

@ -27,7 +27,6 @@ class DeletableWordsList {
if (item != null) {
PreferenceDeletableWord pref = new PreferenceDeletableWord(item.getContext());
pref.setWord(word);
pref.setLayoutResource(R.layout.pref_deletable_word);
item.addPreference(pref);
}
}

View file

@ -26,5 +26,7 @@ public class DeleteWordsScreen extends BaseScreenFragment {
if (searchWords != null) {
searchWords.setOnWordsHandler((words) -> searchResultsList.setResult(searchWords.getLastSearchTerm(), words));
}
resetFontSize(false);
}
}

View file

@ -6,16 +6,16 @@ import android.util.AttributeSet;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
import io.github.sspanak.tt9.R;
import io.github.sspanak.tt9.db.WordStoreAsync;
import io.github.sspanak.tt9.languages.LanguageCollection;
import io.github.sspanak.tt9.preferences.custom.ScreenPreference;
import io.github.sspanak.tt9.preferences.settings.SettingsStore;
import io.github.sspanak.tt9.ui.UI;
public class PreferenceDeletableWord extends Preference {
public class PreferenceDeletableWord extends ScreenPreference {
private String word;
@ -25,6 +25,10 @@ public class PreferenceDeletableWord extends Preference {
public PreferenceDeletableWord(@NonNull Context context) { super(context); }
@Override protected int getDefaultLayout() { return R.layout.pref_deletable_word; }
@Override protected int getLargeLayout() { return R.layout.pref_deletable_word_large; }
public void setWord(String word) {
this.word = word;
setTitle(word);

View file

@ -6,7 +6,6 @@ import android.widget.EditText;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
import java.util.ArrayList;
@ -15,11 +14,12 @@ import io.github.sspanak.tt9.R;
import io.github.sspanak.tt9.db.WordStoreAsync;
import io.github.sspanak.tt9.languages.Language;
import io.github.sspanak.tt9.languages.LanguageCollection;
import io.github.sspanak.tt9.preferences.custom.ScreenPreference;
import io.github.sspanak.tt9.preferences.settings.SettingsStore;
import io.github.sspanak.tt9.util.ConsumerCompat;
import io.github.sspanak.tt9.util.Logger;
public class PreferenceSearchWords extends Preference {
public class PreferenceSearchWords extends ScreenPreference {
public static final String NAME = "dictionary_delete_words_search";
private static final String LOG_TAG = PreferenceSearchWords.class.getSimpleName();
@ -46,6 +46,10 @@ public class PreferenceSearchWords extends Preference {
}
@Override protected int getDefaultLayout() { return R.layout.pref_input_text; }
@Override protected int getLargeLayout() { return R.layout.pref_input_text_large; }
@NonNull
public String getLastSearchTerm() {
return lastSearchTerm;

View file

@ -36,5 +36,7 @@ public class HotkeysScreen extends BaseScreenFragment {
(new ItemResetKeys(findPreference(ItemResetKeys.NAME), activity, section))
.enableClickHandler();
resetFontSize(false);
}
}

View file

@ -24,5 +24,7 @@ public class KeyPadScreen extends BaseScreenFragment {
.populate()
.enableClickHandler()
.preview();
resetFontSize(false);
}
}

View file

@ -80,6 +80,8 @@ public class LanguagesScreen extends BaseScreenFragment {
ItemClickable.enableAllClickHandlers(clickables);
refreshItems();
resetFontSize(false);
}

View file

@ -21,6 +21,7 @@ public class SetupScreen extends BaseScreenFragment {
boolean isTT9On = SystemSettings.isTT9Enabled(activity);
createKeyboardSection(isTT9On);
createHacksSection(isTT9On);
resetFontSize(false);
}
@Override

View file

@ -8,11 +8,15 @@ import androidx.appcompat.app.AppCompatDelegate;
import io.github.sspanak.tt9.util.DeviceInfo;
public class SettingsUI extends SettingsTyping {
public final static int FONT_SIZE_DEFAULT = 0;
public final static int FONT_SIZE_LARGE = 2;
public final static int LAYOUT_STEALTH = 0;
public final static int LAYOUT_TRAY = 2;
public final static int LAYOUT_SMALL = 3;
public final static int LAYOUT_NUMPAD = 4;
SettingsUI(Context context) { super(context); }
public boolean isStatusIconEnabled() {
@ -28,6 +32,11 @@ public class SettingsUI extends SettingsTyping {
}
}
public int getSettingsFontSize() {
int defaultSize = DeviceInfo.isQinF21() || DeviceInfo.isLgX100S() ? FONT_SIZE_LARGE : FONT_SIZE_DEFAULT;
return getStringifiedInt("pref_font_size", defaultSize);
}
public int getTheme() {
return getStringifiedInt("pref_theme", AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
}

View file

@ -25,6 +25,10 @@ public class DeviceInfo {
return Build.MANUFACTURER.equals("DuoQin") && Build.MODEL.contains("F21");
}
public static boolean isLgX100S() {
return Build.MANUFACTURER.equals("LGE") && Build.MODEL.contains("X100S");
}
public static boolean isSonim() {
return Build.MANUFACTURER.equals("Sonimtech");
}

View file

@ -3,9 +3,9 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/pref_padding_horizontal"
android:paddingTop="@dimen/pref_category_padding_top"
android:paddingBottom="@dimen/pref_category_padding_bottom">
android:paddingHorizontal="@dimen/pref_large_padding_horizontal"
android:paddingTop="@dimen/pref_large_category_padding_top"
android:paddingBottom="@dimen/pref_large_category_padding_bottom">
<TextView
android:id="@android:id/title"
@ -13,5 +13,5 @@
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="?attr/colorAccent"
android:textSize="@dimen/pref_text_size" />
android:textSize="@dimen/pref_large_text_size" />
</LinearLayout>

View file

@ -15,7 +15,6 @@
android:paddingEnd="15dp"
android:text="✕"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.TextView"
android:textSize="@dimen/soft_key_icon_size"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView
@ -23,6 +22,5 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.TextView"
android:textSize="@dimen/pref_text_size"
tools:text="Lorem" />
</LinearLayout>

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingHorizontal="@dimen/pref_large_padding_horizontal"
android:paddingVertical="@dimen/pref_large_padding_vertical"
app:layout_anchorGravity="center_horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingEnd="15dp"
android:text="✕"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.TextView"
android:textSize="@dimen/soft_key_icon_size"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.TextView"
android:textSize="@dimen/pref_large_text_size"
tools:text="Lorem" />
</LinearLayout>

View file

@ -4,8 +4,8 @@
android:layout_height="wrap_content"
android:baselineAligned="false"
android:orientation="horizontal"
android:paddingHorizontal="@dimen/pref_padding_horizontal"
android:paddingVertical="@dimen/pref_padding_vertical">
android:paddingHorizontal="@dimen/pref_large_padding_horizontal"
android:paddingVertical="@dimen/pref_large_padding_vertical">
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/spinner"
@ -24,14 +24,14 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.TextView"
android:textSize="@dimen/pref_text_size" />
android:textSize="@dimen/pref_large_text_size" />
<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:textSize="@dimen/pref_summary_size" />
android:textSize="@dimen/pref_large_summary_size" />
</LinearLayout>
</LinearLayout>

View file

@ -21,13 +21,11 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:textSize="@dimen/pref_text_size" />
android:layout_width="match_parent" />
<TextView android:id="@android:id/summary"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:textSize="@dimen/pref_summary_size" />
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
</LinearLayout>

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:descendantFocusability="afterDescendants"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/pref_large_padding_horizontal"
android:paddingVertical="@dimen/pref_large_padding_vertical">
<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:labelFor="@id/input_text_input_field"
android:text="?android:title" />
<EditText
android:id="@+id/input_text_input_field"
android:importantForAutofill="no"
android:inputType="text"
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:textSize="@dimen/pref_large_text_size" />
<TextView android:id="@android:id/summary"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:textSize="@dimen/pref_large_summary_size" />
</LinearLayout>

View file

@ -9,6 +9,5 @@
<TextView
android:id="@android:id/summary"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.TextView" />
android:layout_width="wrap_content" />
</LinearLayout>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/pref_large_padding_horizontal"
android:paddingVertical="@dimen/pref_large_padding_vertical">
<TextView
android:id="@android:id/summary"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.TextView" />
</LinearLayout>

View file

@ -10,24 +10,24 @@
android:layout_weight="3"
android:gravity="start|center_vertical"
android:orientation="vertical"
android:paddingStart="@dimen/pref_padding_horizontal"
android:paddingTop="@dimen/pref_padding_vertical"
android:paddingStart="@dimen/pref_large_padding_horizontal"
android:paddingTop="@dimen/pref_large_padding_vertical"
android:paddingEnd="4dp"
android:paddingBottom="@dimen/pref_padding_vertical">
android:paddingBottom="@dimen/pref_large_padding_vertical">
<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.TextView"
android:textSize="@dimen/pref_text_size" />
android:textSize="@dimen/pref_large_text_size" />
<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:textSize="@dimen/pref_summary_size" />
android:textSize="@dimen/pref_large_summary_size" />
</LinearLayout>
<androidx.appcompat.widget.SwitchCompat
@ -37,5 +37,5 @@
android:layout_weight="1"
android:gravity="end|center_vertical"
android:paddingStart="2dp"
android:paddingEnd="@dimen/pref_padding_horizontal" />
android:paddingEnd="@dimen/pref_large_padding_horizontal" />
</LinearLayout>

View file

@ -3,18 +3,18 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/pref_padding_horizontal"
android:paddingVertical="@dimen/pref_padding_vertical">
android:paddingHorizontal="@dimen/pref_large_padding_horizontal"
android:paddingVertical="@dimen/pref_large_padding_vertical">
<TextView android:id="@android:id/title"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.TextView"
android:textSize="@dimen/pref_text_size" />
android:textSize="@dimen/pref_large_text_size" />
<TextView android:id="@android:id/summary"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:textSize="@dimen/pref_summary_size" />
android:textSize="@dimen/pref_large_summary_size" />
</LinearLayout>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_settings">Настройки на TT9</string>
<string name="pref_font_size_large">Голям</string>
<string name="completed">Завършено</string>
<string name="no_language">Няма език</string>
<string name="error_unexpected">Възникна неочаквана грешка.</string>
@ -121,4 +122,6 @@
<string name="dictionary_export_generating_csv">Експортиране на CSV…</string>
<string name="dictionary_export_generating_csv_for_language">Експортиране на CSV (%1$s)…</string>
<string name="pref_layout">Екранна подредба</string>
<string name="pref_font_size">Размер на шрифта в настройките</string>
<string name="pref_font_size_default">По подразбиране</string>
</resources>

View file

@ -65,6 +65,7 @@
<string name="key_channel_up">Nächster Kanal</string>
<string name="char_newline">Neue Zeile</string>
<string name="pref_category_setup">Ersteinrichtung</string>
<string name="pref_font_size_large">Große</string>
<string name="completed">Abgeschlossen</string>
<string name="error">Fehler</string>
<string name="pref_dark_theme_yes">Ja</string>
@ -103,4 +104,6 @@
<string name="pref_layout">Layout auf dem Bildschirm</string>
<string name="dictionary_no_notifications">Wörterbuchbenachrichtigungen</string>
<string name="dictionary_no_notifications_summary">Benachrichtigen über Wörterbuchaktualisierungen und den Ladevorgang.</string>
<string name="pref_font_size">Schriftgröße der Einstellungen</string>
<string name="pref_font_size_default">Standard</string>
</resources>

View file

@ -11,6 +11,7 @@
<string name="pref_layout_stealth">Modo invisible</string>
<string name="pref_layout_tray">Solo lista de palabras</string>
<string name="pref_help">Ayuda</string>
<string name="pref_font_size_large">Grande</string>
<string name="completed">Terminado</string>
<string name="no_language">Sin idioma</string>
<string name="error_unexpected">Ocurrió un error inesperado.</string>
@ -121,4 +122,6 @@
<string name="dictionary_export_generating_csv">Exportando CSV…</string>
<string name="dictionary_export_generating_csv_for_language">Exportando CSV (%1$s)…</string>
<string name="pref_layout">Distribución del teclado en pantalla</string>
<string name="pref_font_size">Tamaño de fuente de configuración</string>
<string name="pref_font_size_default">Predeterminado</string>
</resources>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_settings">Paramètres de TT9</string>
<string name="pref_font_size_large">Grande</string>
<string name="completed">Fini</string>
<string name="no_language">Aucun langue</string>
<string name="error_unexpected">Une erreur inattendue s\'est produite.</string>
@ -116,4 +117,6 @@
<string name="dictionary_export_generating_csv">Exportation CSV en cours…</string>
<string name="dictionary_export_generating_csv_for_language">Exportation CSV en cours (%1$s)…</string>
<string name="pref_layout">Disposition à l\'écran</string>
<string name="pref_font_size">Taille de la police des paramètres</string>
<string name="pref_font_size_default">Par défaut</string>
</resources>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_settings">TT9 Impostazioni</string>
<string name="pref_font_size_large">Grande</string>
<string name="completed">Completato</string>
<string name="no_language">Nessuna lingua</string>
<string name="error_unexpected">Si è verificato un errore imprevisto.</string>
@ -105,5 +106,7 @@
<string name="pref_layout">Layout sullo schermo</string>
<string name="dictionary_no_notifications">Notifiche del dizionario</string>
<string name="dictionary_no_notifications_summary">Ricevere notifiche sugli aggiornamenti del dizionario e sul progresso del caricamento.</string>
<string name="pref_font_size">Dimensione del carattere delle impostazioni</string>
<string name="pref_font_size_default">Predefinita</string>
</resources>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_settings">TT9 הגדרות</string>
<string name="pref_font_size_large">גדול</string>
<string name="completed">הסתיים</string>
<string name="no_language">אין שפה</string>
<string name="error_unexpected">אירעה שגיאה לא צפויה.</string>
@ -120,4 +121,6 @@
<string name="pref_layout">תצורת המקלדת על המסך</string>
<string name="dictionary_no_notifications">התראות מילון</string>
<string name="dictionary_no_notifications_summary">לקבל התראות על עדכוני המילון ועל התקדמות הטעינה.</string>
<string name="pref_font_size">גודל הגופן בהגדרות</string>
<string name="pref_font_size_default">ברירת מחדל</string>
</resources>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_settings">„TT9“ nustatymai</string>
<string name="pref_font_size_large">Didelis</string>
<string name="completed">Baigta</string>
<string name="error">Klaida</string>
<string name="no_language">Kalbos nėra</string>
@ -130,4 +131,6 @@
<string name="donate_title">Paaukoti</string>
<string name="donate_summary">Jei jums patinka %1$s, galite paremti jo plėtrą čia: %2$s.</string>
<string name="pref_layout">Klaviatūros išdėstymas ekrane</string>
<string name="pref_font_size">Nustatymų šrifto dydis</string>
<string name="pref_font_size_default">Numatytasis</string>
</resources>

View file

@ -67,6 +67,7 @@
<string name="char_newline">Nieuwe regel</string>
<string name="pref_category_setup">Initiële setup</string>
<string name="dictionary_truncating">Verwijderen…</string>
<string name="pref_font_size_large">Groot</string>
<string name="completed">Voltooid</string>
<string name="error">Fout</string>
<string name="pref_dark_theme_yes">Ja</string>
@ -101,4 +102,6 @@
<string name="pref_layout">Indeling op het scherm</string>
<string name="dictionary_no_notifications">Woordenboekmeldingen</string>
<string name="dictionary_no_notifications_summary">Ontvang meldingen over woordenboekupdates en de voortgang van het laden.</string>
<string name="pref_font_size">Instellingen lettergrootte</string>
<string name="pref_font_size_default">Standaard</string>
</resources>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_settings">Configurações do Teclado</string>
<string name="pref_font_size_large">Grande</string>
<string name="completed">Concluído</string>
<string name="no_language">Sem idioma</string>
<string name="error_unexpected">Um erro inesperado aconteceu.</string>
@ -122,4 +123,6 @@
<string name="pref_layout">Layout na tela</string>
<string name="dictionary_no_notifications">Notificações do dicionário</string>
<string name="dictionary_no_notifications_summary">Receber notificações sobre atualizações do dicionário e sobre o progresso do carregamento.</string>
<string name="pref_font_size">Tamanho da fonte das configurações</string>
<string name="pref_font_size_default">Padrão</string>
</resources>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_settings">TT9 настройки</string>
<string name="pref_font_size_large">Крупный</string>
<string name="completed">Выполнено</string>
<string name="no_language">Нет языка</string>
<string name="error_unexpected">Произошла непредвиденная ошибка.</string>
@ -121,4 +122,6 @@
<string name="dictionary_export_generating_csv">Экспорт CSV…</string>
<string name="dictionary_export_generating_csv_for_language">Экспорт CSV (%1$s)…</string>
<string name="pref_layout">Экранная раскладка</string>
<string name="pref_font_size">Размер шрифта в настройках</string>
<string name="pref_font_size_default">По умолчанию</string>
</resources>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_settings">Налаштування TT9</string>
<string name="pref_font_size_large">Великий</string>
<string name="completed">Виконано</string>
<string name="error">Помилка</string>
<string name="no_language">Немає мови</string>
@ -132,4 +133,6 @@
<string name="dictionary_export_generating_csv">Експорт CSV…</string>
<string name="dictionary_export_generating_csv_for_language">Експорт CSV (%1$s)…</string>
<string name="pref_layout">Екранна розкладка</string>
<string name="pref_font_size">Розмір шрифту у налаштуваннях</string>
<string name="pref_font_size_default">За замовчуванням</string>
</resources>

View file

@ -7,12 +7,18 @@
<dimen name="soft_key_height">44dp</dimen>
<dimen name="soft_key_icon_size">24sp</dimen>
<dimen name="pref_category_padding_top">30dp</dimen>
<dimen name="pref_category_padding_bottom">12dp</dimen>
<!-- Large font size -->
<dimen name="pref_large_category_padding_top">30dp</dimen>
<dimen name="pref_large_category_padding_bottom">12dp</dimen>
<dimen name="pref_large_padding_horizontal">16dp</dimen>
<dimen name="pref_large_padding_vertical">18dp</dimen>
<dimen name="pref_large_text_size">22sp</dimen>
<dimen name="pref_large_summary_size">19sp</dimen>
<!-- Default font size -->
<dimen name="pref_padding_horizontal">16dp</dimen>
<dimen name="pref_padding_vertical">18dp</dimen>
<dimen name="pref_text_size">22sp</dimen>
<dimen name="pref_summary_size">19sp</dimen>
<dimen name="pref_padding_vertical">12dp</dimen>
<!-- Numpad -->
<dimen name="numpad_padding_bottom">2dp</dimen>

View file

@ -64,6 +64,9 @@
<string name="pref_layout_small">Function keys</string>
<string name="pref_layout_stealth">Invisible</string>
<string name="pref_layout_tray">Suggestion list only</string>
<string name="pref_font_size">Settings Font Size</string>
<string name="pref_font_size_default">Default</string>
<string name="pref_font_size_large">Large</string>
<string name="pref_status_icon">Status Icon</string>
<string name="pref_status_icon_summary">Show an icon when keyboard input is active.</string>
<string name="pref_upside_down_keys">Reverse Key Order</string>

View file

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:layout="@layout/pref_text"
app:orderingFromXml="true">
<Preference
app:key="help"
app:layout="@layout/pref_text"
app:summary="github.com/sspanak/tt9"
app:title="@string/pref_help">
<intent
@ -17,35 +15,29 @@
<Preference
app:fragment="io.github.sspanak.tt9.preferences.AppearanceScreen"
app:key="screen_appearance"
app:layout="@layout/pref_text"
app:title="@string/pref_category_appearance" />
<Preference
app:fragment="io.github.sspanak.tt9.preferences.LanguagesScreen"
app:key="screen_languages"
app:layout="@layout/pref_text"
app:title="@string/pref_choose_languages" />
<Preference
app:fragment="io.github.sspanak.tt9.preferences.KeyPadScreen"
app:key="screen_keypad"
app:layout="@layout/pref_text"
app:title="@string/pref_category_keypad" />
<Preference
app:fragment="io.github.sspanak.tt9.preferences.SetupScreen"
app:key="screen_setup"
app:layout="@layout/pref_text"
app:title="@string/pref_category_setup" />
<PreferenceCategory
android:title="@string/pref_category_about"
app:layout="@layout/pref_category"
app:singleLineTitle="true">
<Preference
app:key="donate_link"
app:layout="@layout/pref_text"
app:title="@string/donate_title"
app:summary="@string/donate_summary">
<intent
@ -56,7 +48,6 @@
<Preference
app:fragment="io.github.sspanak.tt9.preferences.DebugScreen"
app:key="version_info"
app:layout="@layout/pref_text"
app:title="@string/app_name" />
</PreferenceCategory>

View file

@ -3,22 +3,20 @@
<DropDownPreference
app:defaultValue="-1"
app:iconSpaceReserved="false"
app:key="pref_theme"
app:layout="@layout/pref_dropdown"
app:title="@string/pref_dark_theme" />
<DropDownPreference
app:iconSpaceReserved="false"
app:key="pref_layout_type"
app:layout="@layout/pref_dropdown"
app:title="@string/pref_layout" />
<SwitchPreferenceCompat
app:key="pref_status_icon"
app:layout="@layout/pref_switch"
app:title="@string/pref_status_icon"
app:summary="@string/pref_status_icon_summary" />
<DropDownPreference
app:key="pref_font_size"
app:title="@string/pref_font_size" />
</PreferenceScreen>

View file

@ -3,47 +3,37 @@
<Preference
app:key="pref_device_info"
app:layout="@layout/pref_text"
app:title="Device Info" />
<DropDownPreference
app:iconSpaceReserved="false"
app:key="pref_input_handling_mode"
app:layout="@layout/pref_dropdown"
app:title="Keypad Handling Mode" />
<SwitchPreferenceCompat
<Preference
app:fragment="io.github.sspanak.tt9.preferences.UsageStatsScreen"
app:key="pref_slow_queries"
app:layout="@layout/pref_text"
app:title="@string/pref_category_usage_stats" />
<DropDownPreference
app:iconSpaceReserved="false"
app:key="pref_log_level"
app:layout="@layout/pref_dropdown"
app:title="Log Level" />
<SwitchPreferenceCompat
app:defaultValue="false"
app:key="pref_enable_system_logs"
app:layout="@layout/pref_switch"
app:title="System Logs" />
<Preference
app:key="pref_export_logcat"
app:layout="@layout/pref_text"
app:title="Export Logs" />
<PreferenceCategory
app:title="Recent Log Messages"
app:layout="@layout/pref_category"
app:singleLineTitle="true">
<Preference
<io.github.sspanak.tt9.preferences.custom.PreferencePlainText
app:key="debug_logs_container"
app:summary="--"
app:layout="@layout/pref_plain_text">
</Preference>
app:summary="--">
</io.github.sspanak.tt9.preferences.custom.PreferencePlainText>
</PreferenceCategory>
</PreferenceScreen>

View file

@ -2,12 +2,10 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:orderingFromXml="true">
<io.github.sspanak.tt9.preferences.screens.deleteWords.PreferenceSearchWords
android:layout="@layout/pref_input_text"
android:key="dictionary_delete_words_search"
android:title="@string/delete_words_search_placeholder" />
<PreferenceCategory
android:key="delete_words_list"
android:title="@string/delete_words_list"
android:layout="@layout/pref_category" />
android:title="@string/delete_words_list" />
</PreferenceScreen>

View file

@ -3,69 +3,47 @@
app:orderingFromXml="true">
<DropDownPreference
app:iconSpaceReserved="false"
app:key="key_add_word"
app:layout="@layout/pref_dropdown"
app:title="@string/function_add_word_key" />
<DropDownPreference
app:iconSpaceReserved="false"
app:key="key_backspace"
app:layout="@layout/pref_dropdown"
app:title="@string/function_backspace_key" />
<DropDownPreference
app:iconSpaceReserved="false"
app:key="key_filter_clear"
app:layout="@layout/pref_dropdown"
app:title="@string/function_filter_clear_key" />
<DropDownPreference
app:iconSpaceReserved="false"
app:key="key_filter_suggestions"
app:layout="@layout/pref_dropdown"
app:title="@string/function_filter_suggestions_key" />
<DropDownPreference
app:iconSpaceReserved="false"
app:key="key_previous_suggestion"
app:layout="@layout/pref_dropdown"
app:title="@string/function_previous_suggestion_key" />
<DropDownPreference
app:iconSpaceReserved="false"
app:key="key_next_suggestion"
app:layout="@layout/pref_dropdown"
app:title="@string/function_next_suggestion_key" />
<DropDownPreference
app:iconSpaceReserved="false"
app:key="key_next_language"
app:layout="@layout/pref_dropdown"
app:title="@string/function_next_language_key" />
<DropDownPreference
app:iconSpaceReserved="false"
app:key="key_next_input_mode"
app:layout="@layout/pref_dropdown"
app:title="@string/function_next_mode_key" />
<DropDownPreference
app:iconSpaceReserved="false"
app:key="key_change_keyboard"
app:layout="@layout/pref_dropdown"
app:title="@string/function_change_keyboard_key" />
<DropDownPreference
app:iconSpaceReserved="false"
app:key="key_show_settings"
app:layout="@layout/pref_dropdown"
app:title="@string/function_show_settings_key" />
<Preference
app:iconSpaceReserved="false"
app:key="reset_keys"
app:layout="@layout/pref_text"
app:title="@string/function_reset_keys_title" />
</PreferenceScreen>

View file

@ -7,32 +7,27 @@
<Preference
app:fragment="io.github.sspanak.tt9.preferences.HotkeysScreen"
app:key="screen_hotkeys"
app:layout="@layout/pref_text"
app:title="@string/pref_category_function_keys" />
<SwitchPreferenceCompat
app:defaultValue="false"
app:key="pref_upside_down_keys"
app:layout="@layout/pref_switch"
app:summary="@string/pref_upside_down_keys_summary"
app:title="@string/pref_upside_down_keys" />
<PreferenceCategory
android:title="@string/pref_category_predictive_mode"
app:layout="@layout/pref_category"
app:singleLineTitle="true">
<SwitchPreferenceCompat
app:defaultValue="true"
app:key="auto_space"
app:layout="@layout/pref_switch"
app:title="@string/pref_auto_space"
app:summary="@string/pref_auto_space_summary" />
<SwitchPreferenceCompat
app:defaultValue="true"
app:key="auto_text_case"
app:layout="@layout/pref_switch"
app:summary="@string/pref_auto_text_case_summary"
app:title="@string/pref_auto_text_case" />
@ -40,16 +35,13 @@
app:defaultValue="false"
app:dependency="auto_text_case"
app:key="auto_capitals_after_newline"
app:layout="@layout/pref_switch"
app:summary="@string/pref_auto_capitals_after_newline_summary"
app:title="@string/pref_auto_capitals_after_newline" />
<DropDownPreference
app:defaultValue="."
app:iconSpaceReserved="false"
app:key="pref_double_zero_char"
app:layout="@layout/pref_dropdown"
app:title="@string/pref_double_zero_char" />
</PreferenceCategory>
@ -57,13 +49,11 @@
<PreferenceCategory
android:title="@string/pref_category_abc_mode"
app:layout="@layout/pref_category"
app:singleLineTitle="true">
<DropDownPreference
app:defaultValue="800"
app:key="pref_abc_auto_accept_time"
app:layout="@layout/pref_dropdown"
app:title="@string/pref_abc_auto_accept" />
</PreferenceCategory>

View file

@ -3,51 +3,42 @@
<MultiSelectListPreference
app:key="pref_languages"
app:layout="@layout/pref_text"
app:title="@string/pref_choose_languages" />
<SwitchPreferenceCompat
app:isPreferenceVisible="false"
app:key="dictionary_notifications"
app:layout="@layout/pref_switch"
app:title="@string/dictionary_no_notifications"
app:summary="@string/dictionary_no_notifications_summary"/>
<Preference
app:key="dictionary_load"
app:layout="@layout/pref_text"
app:title="@string/dictionary_load_title" />
<Preference
app:key="dictionary_export"
app:layout="@layout/pref_text"
app:title="@string/dictionary_export"
app:isPreferenceVisible="false" />
<Preference
app:key="dictionary_truncate_unselected"
app:layout="@layout/pref_text"
app:title="@string/dictionary_truncate_unselected" />
<Preference
app:key="dictionary_truncate"
app:layout="@layout/pref_text"
app:title="@string/dictionary_truncate_title" />
<PreferenceCategory
app:title="@string/pref_category_custom_words"
app:layout="@layout/pref_category"
app:singleLineTitle="true">
<Preference
app:key="dictionary_export_custom"
app:layout="@layout/pref_text"
app:title="@string/dictionary_export_custom_words" />
<Preference
app:fragment="io.github.sspanak.tt9.preferences.DeleteWordsScreen"
app:key="screen_delete_words"
app:layout="@layout/pref_text"
app:title="@string/delete_words_delete"
app:summary="@string/delete_words_link_summary"/>

View file

@ -1,46 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto"
app:layout="@layout/pref_text"
app:orderingFromXml="true">
<Preference
app:key="global_tt9_status"
app:layout="@layout/pref_text"
app:title="@string/setup_keyboard_status" />
<Preference
app:key="global_default_keyboard"
app:layout="@layout/pref_text"
app:title="@string/setup_default_keyboard" />
<PreferenceCategory
app:title="@string/pref_category_hacks"
app:layout="@layout/pref_category"
app:singleLineTitle="true">
<SwitchPreferenceCompat
app:key="pref_alternative_suggestion_scrolling"
app:layout="@layout/pref_switch"
app:title="@string/pref_alternative_suggestion_scrolling"
app:summary="@string/pref_alternative_suggestion_scrolling_summary"/>
<SwitchPreferenceCompat
app:key="pref_alternative_suggestion_scrolling"
app:title="@string/pref_alternative_suggestion_scrolling"
app:summary="@string/pref_alternative_suggestion_scrolling_summary"/>
<SwitchPreferenceCompat
app:defaultValue="false"
app:key="pref_hack_google_chat"
app:layout="@layout/pref_switch"
app:title="@string/pref_hack_google_chat"
app:summary="(BETA)"/>
<SwitchPreferenceCompat
app:defaultValue="false"
app:key="pref_hack_google_chat"
app:title="@string/pref_hack_google_chat"
app:summary="(BETA)"/>
<SwitchPreferenceCompat
app:defaultValue="false"
app:key="pref_hack_fb_messenger"
app:layout="@layout/pref_switch"
app:title="@string/pref_hack_fb_messenger"/>
<SwitchPreferenceCompat
app:defaultValue="false"
app:key="pref_hack_fb_messenger"
app:title="@string/pref_hack_fb_messenger"/>
<DropDownPreference
app:iconSpaceReserved="false"
app:key="pref_key_pad_debounce_time"
app:layout="@layout/pref_dropdown"
app:title="@string/pref_hack_key_pad_debounce_time" />
<DropDownPreference
app:key="pref_key_pad_debounce_time"
app:title="@string/pref_hack_key_pad_debounce_time" />
</PreferenceCategory>
</PreferenceScreen>

View file

@ -3,29 +3,24 @@
<SwitchPreferenceCompat
app:key="pref_slow_queries_reset_stats"
app:layout="@layout/pref_text"
app:title="Clear DB Cache" />
<PreferenceCategory
app:title="Summary"
app:layout="@layout/pref_category"
app:singleLineTitle="true">
<Preference
<io.github.sspanak.tt9.preferences.custom.PreferencePlainText
app:key="summary_container"
app:summary="--"
app:layout="@layout/pref_plain_text">
</Preference>
app:summary="--">
</io.github.sspanak.tt9.preferences.custom.PreferencePlainText>
</PreferenceCategory>
<PreferenceCategory
app:title="Slow Queries"
app:layout="@layout/pref_category"
app:singleLineTitle="true">
<Preference
<io.github.sspanak.tt9.preferences.custom.PreferencePlainText
app:key="query_list_container"
app:summary="--"
app:layout="@layout/pref_plain_text">
</Preference>
app:summary="--">
</io.github.sspanak.tt9.preferences.custom.PreferencePlainText>
</PreferenceCategory>
</PreferenceScreen>