abouttreesummaryrefslogcommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/values-fr/strings.xml2
-rw-r--r--res/values-lv/strings.xml2
-rw-r--r--res/values/dimens.xml1
-rw-r--r--res/values/strings.xml2
-rw-r--r--res/xml/settings.xml2
-rw-r--r--srcs/juloo.keyboard2/Config.java23
6 files changed, 24 insertions, 8 deletions
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index 5588d5d..506b2ad 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -23,7 +23,7 @@
<string name="pref_precise_repeat_summary">Modifier la vitesse de répétition en bougeant le doigt</string>
<string name="pref_category_style">Style</string>
<string name="pref_margin_bottom_title">Marge du bas</string>
- <string name="pref_key_height_title">Hauteur des touches</string>
+ <string name="pref_keyboard_height_title">Hauteur du clavier</string>
<string name="pref_horizontal_margin_title">Marge des côtés</string>
<string name="pref_character_size_title">Taille des labels</string>
<string name="pref_character_size_summary">Taille des caractères affichés sur les touches (%.2fx)</string>
diff --git a/res/values-lv/strings.xml b/res/values-lv/strings.xml
index 48fccda..0e1c5cd 100644
--- a/res/values-lv/strings.xml
+++ b/res/values-lv/strings.xml
@@ -23,7 +23,7 @@
<string name="pref_precise_repeat_summary">Mainīt taustiņa atkārtošanās ātrumu ar pavilkšanas attālumu</string>
<string name="pref_category_style">Izskata pielāgojumi</string>
<string name="pref_margin_bottom_title">Apakšējā apmale</string>
- <string name="pref_key_height_title">Taustiņa augstums</string>
+ <string name="pref_keyboard_height_title">Tastatūras augstums</string>
<string name="pref_horizontal_margin_title">Līmeniskā apmale</string>
<string name="pref_character_size_title">Iezīmes izmērs</string>
<string name="pref_character_size_summary">Tastatūrā attēloto rakstzīmju izmērs (%.2fx)</string>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index fce808b..59dbfef 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -12,4 +12,5 @@
<dimen name="emoji_type_button_height">56dp</dimen>
<dimen name="emoji_grid_height">250dp</dimen>
<dimen name="emoji_text_size">28dp</dimen>
+ <dimen name="landscape_extra_horizontal_margin">20dp</dimen>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 46754d7..3d68d1f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -23,7 +23,7 @@
<string name="pref_precise_repeat_summary">Modulate key repeat speed by swiping more or less</string>
<string name="pref_category_style">Style</string>
<string name="pref_margin_bottom_title">Margin bottom</string>
- <string name="pref_key_height_title">Key height</string>
+ <string name="pref_keyboard_height_title">Keyboard height</string>
<string name="pref_horizontal_margin_title">Horizontal margin</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>
diff --git a/res/xml/settings.xml b/res/xml/settings.xml
index 22ec3d0..7ae8542 100644
--- a/res/xml/settings.xml
+++ b/res/xml/settings.xml
@@ -17,7 +17,7 @@
<PreferenceCategory android:title="@string/pref_category_style">
<ListPreference android:key="theme" android:title="@string/pref_theme" android:summary="%s" android:defaultValue="system" android:entries="@array/pref_theme_entries" android:entryValues="@array/pref_theme_values"/>
<juloo.common.IntSlideBarPreference android:key="margin_bottom" android:title="@string/pref_margin_bottom_title" android:summary="%sdp" android:defaultValue="5" min="0" max="100"/>
- <juloo.common.IntSlideBarPreference android:key="key_height" android:title="@string/pref_key_height_title" android:summary="%sdp" android:defaultValue="50" min="30" max="90"/>
+ <juloo.common.IntSlideBarPreference android:key="keyboard_height" android:title="@string/pref_keyboard_height_title" android:summary="%s%%" android:defaultValue="35" min="25" max="50"/>
<juloo.common.IntSlideBarPreference android:key="horizontal_margin" android:title="@string/pref_horizontal_margin_title" android:summary="%sdp" android:defaultValue="3" 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"/>
<juloo.common.IntSlideBarPreference android:key="key_vertical_space" android:title="@string/pref_key_vertical_space" android:summary="%sdp" android:defaultValue="2" min="0" max="8"/>
diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java
index 66b9239..2a2be30 100644
--- a/srcs/juloo.keyboard2/Config.java
+++ b/srcs/juloo.keyboard2/Config.java
@@ -81,6 +81,21 @@ final class Config
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
Resources res = context.getResources();
DisplayMetrics dm = res.getDisplayMetrics();
+ // The height of the keyboard is relative to the height of the screen. This
+ // is not the actual size of the keyboard, which will be bigger if the
+ // layout has a fifth row.
+ int keyboardHeightPercent;
+ float extra_horizontal_margin;
+ if (res.getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) // Landscape mode
+ {
+ keyboardHeightPercent = 55;
+ extra_horizontal_margin = res.getDimension(R.dimen.landscape_extra_horizontal_margin);
+ }
+ else
+ {
+ keyboardHeightPercent = prefs.getInt("keyboard_height", 35);
+ extra_horizontal_margin = 0.f;
+ }
layout = layoutId_of_string(prefs.getString("layout", "system"));
swipe_dist_dp = Float.valueOf(prefs.getString("swipe_dist", "15"));
swipe_dist_px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, swipe_dist_dp, dm);
@@ -91,10 +106,10 @@ final class Config
marginBottom = getDipPref(dm, prefs, "margin_bottom", marginBottom);
keyVerticalInterval = getDipPref(dm, prefs, "key_vertical_space", keyVerticalInterval);
keyHorizontalInterval = getDipPref(dm, prefs, "key_horizontal_space", keyHorizontalInterval);
- // Add keyVerticalInterval to keyHeight because the space between the keys
- // is removed from the keys during rendering
- keyHeight = getDipPref(dm, prefs, "key_height", keyHeight) + keyVerticalInterval;
- horizontalMargin = getDipPref(dm, prefs, "horizontal_margin", horizontalMargin);
+ // Do not substract keyVerticalInterval from keyHeight because this is done
+ // during rendered.
+ keyHeight = dm.heightPixels * keyboardHeightPercent / 100 / 4;
+ horizontalMargin = getDipPref(dm, prefs, "horizontal_margin", horizontalMargin) + extra_horizontal_margin;
preciseRepeat = prefs.getBoolean("precise_repeat", preciseRepeat);
characterSize = prefs.getFloat("character_size", characterSize);
accents = Integer.valueOf(prefs.getString("accents", "1"));