abouttreesummaryrefslogcommitdiff
diff options
context:
space:
mode:
authorJules Aguillon2022-06-06 15:26:07 +0200
committerJules Aguillon2022-06-06 15:33:39 +0200
commitf6338a652b29767405894ae8f5ea41517767c557 (patch)
tree342fdde9c1b0b40e5d1d89d12ddb95c9a0589247
parent9a42fa4dca4eea0cca77841d361fe8256597aa55 (diff)
downloadunexpected-keyboard-f6338a652b29767405894ae8f5ea41517767c557.tar.gz
unexpected-keyboard-f6338a652b29767405894ae8f5ea41517767c557.zip
New setting: Keyboard height in landscape mode
The previous fixed value of 55% was too high. The new default value is 50% and it is customizable.
-rw-r--r--res/values-fr/strings.xml1
-rw-r--r--res/values/strings.xml1
-rw-r--r--res/xml/settings.xml1
-rw-r--r--srcs/juloo.keyboard2/Config.java7
4 files changed, 6 insertions, 4 deletions
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index 431264e..d37ec15 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -22,6 +22,7 @@
<string name="pref_category_style">Style</string>
<string name="pref_margin_bottom_title">Marge du bas</string>
<string name="pref_keyboard_height_title">Hauteur du clavier</string>
+ <string name="pref_keyboard_height_landscape_title">Hauteur du clavier en mode paysage</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/strings.xml b/res/values/strings.xml
index d223d71..741a9e2 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -28,6 +28,7 @@
<string name="pref_category_style">Style</string>
<string name="pref_margin_bottom_title">Margin bottom</string>
<string name="pref_keyboard_height_title">Keyboard height</string>
+ <string name="pref_keyboard_height_landscape_title">Keyboard height in landscape mode</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 c6900cd..5d7072c 100644
--- a/res/xml/settings.xml
+++ b/res/xml/settings.xml
@@ -29,6 +29,7 @@
<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="keyboard_height" android:title="@string/pref_keyboard_height_title" android:summary="%s%%" android:defaultValue="35" min="25" max="50"/>
+ <juloo.common.IntSlideBarPreference android:key="keyboard_height_landscape" android:title="@string/pref_keyboard_height_landscape_title" android:summary="%s%%" android:defaultValue="50" min="35" max="65"/>
<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 054fc41..552aadf 100644
--- a/srcs/juloo.keyboard2/Config.java
+++ b/srcs/juloo.keyboard2/Config.java
@@ -94,13 +94,12 @@ 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.
+ // The height of the keyboard is relative to the height of the screen.
+ // This is the height of the keyboard if it have 4 rows.
int keyboardHeightPercent;
if (res.getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) // Landscape mode
{
- keyboardHeightPercent = 55;
+ keyboardHeightPercent = prefs.getInt("keyboard_height_landscape", 50);
}
else
{