diff options
| -rw-r--r-- | res/values/strings.xml | 6 | ||||
| -rw-r--r-- | res/xml/settings.xml | 8 | ||||
| -rw-r--r-- | srcs/juloo.keyboard2/Config.java | 3 | ||||
| -rw-r--r-- | srcs/juloo.keyboard2/Keyboard2View.java | 2 |
4 files changed, 16 insertions, 3 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index fc6860d..9637b57 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -9,6 +9,8 @@ <string name="subtype_label_qwerty">%s QWERTY</string> <string name="pref_category_layout">Layout</string> + <string name="pref_disable_accent_keys_title">Toggle accent keys</string> + <string name="pref_disable_accent_keys_summary">Whether to remove the accent keys from the keyboard</string> <string name="pref_category_typing">Typing</string> <string name="pref_preci_title">Precision</string> @@ -33,6 +35,6 @@ <string name="pref_key_height_summary">%sdp</string> <string name="pref_horizontal_margin_title">Horizontal margin</string> <string name="pref_horizontal_margin_summary">%sdp</string> - <string name="pref_disable_accent_keys_title">Toggle accent keys</string> - <string name="pref_disable_accent_keys_summary">Whether to remove the accent keys from the keyboard.</string> + <string name="pref_character_size_title">Label size</string> + <string name="pref_character_size_summary">Size of characters displayed on the keyboard (%.2fx)</string> </resources> diff --git a/res/xml/settings.xml b/res/xml/settings.xml index ef4e232..d56f029 100644 --- a/res/xml/settings.xml +++ b/res/xml/settings.xml @@ -81,5 +81,13 @@ min="0" max="20" /> + <juloo.common.SlideBarPreference + android:key="character_size" + android:title="@string/pref_character_size_title" + android:summary="@string/pref_character_size_summary" + android:defaultValue="1.0" + min="0.8" + max="1.2" + /> </PreferenceCategory> </PreferenceScreen> diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java index 779e2c5..f2b010a 100644 --- a/srcs/juloo.keyboard2/Config.java +++ b/srcs/juloo.keyboard2/Config.java @@ -24,6 +24,7 @@ class Config public float horizontalMargin; public boolean disableAccentKeys; public boolean preciseRepeat; + public float characterSize; // Ratio public boolean shouldOfferSwitchingToNextInputMethod; @@ -48,6 +49,7 @@ class Config horizontalMargin = res.getDimension(R.dimen.horizontal_margin); disableAccentKeys = false; preciseRepeat = true; + characterSize = 1.f; // from prefs refresh(); // initialized later @@ -71,6 +73,7 @@ class Config horizontalMargin = getDipPref(prefs, "horizontal_margin", horizontalMargin); disableAccentKeys = prefs.getBoolean("disable_accent_keys", disableAccentKeys); preciseRepeat = prefs.getBoolean("precise_repeat", preciseRepeat); + characterSize = prefs.getFloat("character_size", characterSize); } private float getDipPref(SharedPreferences prefs, String pref_name, float def) diff --git a/srcs/juloo.keyboard2/Keyboard2View.java b/srcs/juloo.keyboard2/Keyboard2View.java index 3903b7b..7b3495f 100644 --- a/srcs/juloo.keyboard2/Keyboard2View.java +++ b/srcs/juloo.keyboard2/Keyboard2View.java @@ -78,7 +78,7 @@ public class Keyboard2View extends View { Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setTextAlign(align); - paint.setTextSize(getResources().getDimension(size)); + paint.setTextSize(getResources().getDimension(size) * _config.characterSize); if (font != null) paint.setTypeface(font); return (paint); |
