abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2
diff options
context:
space:
mode:
authorJules Aguillon2022-06-06 16:17:43 +0200
committerJules Aguillon2022-06-06 16:17:43 +0200
commite0131fa6b01ada40905ccd365da4511c2a88dc1c (patch)
tree46844810ba9174a5aa2e127140379a0731cb6c62 /srcs/juloo.keyboard2
parentb236a74b648399c92675558e2674478fc24c3be5 (diff)
downloadunexpected-keyboard-e0131fa6b01ada40905ccd365da4511c2a88dc1c.tar.gz
unexpected-keyboard-e0131fa6b01ada40905ccd365da4511c2a88dc1c.zip
Fix inconsistent text size in landscape mode
Dimens weren't refreshed when the orientation changed. Dimens are not the right solution anyway, use scaling factors instead.
Diffstat (limited to 'srcs/juloo.keyboard2')
-rw-r--r--srcs/juloo.keyboard2/Config.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java
index 43c11a6..39d1c25 100644
--- a/srcs/juloo.keyboard2/Config.java
+++ b/srcs/juloo.keyboard2/Config.java
@@ -57,8 +57,8 @@ final class Config
// static values
marginTop = res.getDimension(R.dimen.margin_top);
keyPadding = res.getDimension(R.dimen.key_padding);
- labelTextSize = Float.valueOf(res.getString(R.integer.label_text_size));
- sublabelTextSize = Float.valueOf(res.getString(R.integer.sublabel_text_size));
+ labelTextSize = 0.33f;
+ sublabelTextSize = 0.22f;
// default values
layout = -1;
programming_layout = -1;
@@ -97,12 +97,14 @@ final class Config
// 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;
- // Increase the horizontal space between the keys
+ // Scale some dimensions depending on orientation
float horizontalIntervalScale = 1.f;
+ float characterSizeScale = 1.f;
if (res.getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) // Landscape mode
{
keyboardHeightPercent = prefs.getInt("keyboard_height_landscape", 50);
horizontalIntervalScale = 2.f;
+ characterSizeScale = 1.25f;
}
else
{
@@ -142,7 +144,9 @@ final class Config
if (prefs.getBoolean("lockable_sup", false)) lockable_modifiers.add(KeyValue.Modifier.SUPERSCRIPT);
if (prefs.getBoolean("lockable_sub", false)) lockable_modifiers.add(KeyValue.Modifier.SUBSCRIPT);
if (prefs.getBoolean("lockable_box", false)) lockable_modifiers.add(KeyValue.Modifier.BOX);
- characterSize = prefs.getFloat("character_size", characterSize);
+ characterSize =
+ prefs.getFloat("character_size", characterSize)
+ * characterSizeScale;
accents = Integer.valueOf(prefs.getString("accents", "1"));
theme = getThemeId(res, prefs.getString("theme", ""));
}