From f6338a652b29767405894ae8f5ea41517767c557 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Mon, 6 Jun 2022 15:26:07 +0200 Subject: [PATCH] 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. --- res/values-fr/strings.xml | 1 + res/values/strings.xml | 1 + res/xml/settings.xml | 1 + srcs/juloo.keyboard2/Config.java | 7 +++---- 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 @@ Style Marge du bas Hauteur du clavier + Hauteur du clavier en mode paysage Marge des côtés Taille des labels Taille des caractères affichés sur les touches (%.2fx) 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 @@ Style Margin bottom Keyboard height + Keyboard height in landscape mode Horizontal margin Label size Size of characters displayed on the keyboard (%.2fx) 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 @@ + 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 {