From 8584db1461d286f8eb966c40eb0bc76e8c9df76a Mon Sep 17 00:00:00 2001 From: Andy Wang Date: Tue, 2 Dec 2014 13:01:11 +0900 Subject: Add keyboard margin options to place the keyboard dynamically. Keyboard location and location can now be set in the debug options section. Change-Id: I87c5a1d679489e12dccf26632c399af28087629e --- .../android/inputmethod/latin/settings/SettingsValues.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'java/src/com/android/inputmethod/latin/settings/SettingsValues.java') diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java index 5f1a7af44..99e0565ca 100644 --- a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java @@ -50,6 +50,7 @@ public class SettingsValues { private static final String FLOAT_NEGATIVE_INFINITY_MARKER_STRING = "floatNegativeInfinity"; private static final int TIMEOUT_TO_GET_TARGET_PACKAGE = 5; // seconds public static final float DEFAULT_SIZE_SCALE = 1.0f; // 100% + public static final float DEFAULT_MARGIN_SCALE = 0.0f; // 0% // From resources: public final SpacingAndPunctuations mSpacingAndPunctuations; @@ -113,6 +114,9 @@ public class SettingsValues { public final boolean mHasCustomKeyPreviewAnimationParams; public final boolean mHasKeyboardResize; public final float mKeyboardHeightScale; + public final float mKeyboardBottomMarginScale; + public final float mKeyboardLeftMarginScale; + public final float mKeyboardRightMarginScale; public final int mKeyPreviewShowUpDuration; public final int mKeyPreviewDismissDuration; public final float mKeyPreviewShowUpStartXScale; @@ -190,7 +194,14 @@ public class SettingsValues { mHasCustomKeyPreviewAnimationParams = prefs.getBoolean( DebugSettings.PREF_HAS_CUSTOM_KEY_PREVIEW_ANIMATION_PARAMS, false); mHasKeyboardResize = prefs.getBoolean(DebugSettings.PREF_RESIZE_KEYBOARD, false); - mKeyboardHeightScale = Settings.readKeyboardHeight(prefs, DEFAULT_SIZE_SCALE); + mKeyboardHeightScale = Settings.readKeyboardScale( + prefs, DebugSettings.PREF_KEYBOARD_HEIGHT_SCALE, DEFAULT_SIZE_SCALE); + mKeyboardBottomMarginScale = Settings.readKeyboardScale( + prefs, DebugSettings.PREF_KEYBOARD_BOTTOM_MARGIN, DEFAULT_MARGIN_SCALE); + mKeyboardLeftMarginScale = Settings.readKeyboardScale( + prefs, DebugSettings.PREF_KEYBOARD_LEFT_MARGIN, DEFAULT_MARGIN_SCALE); + mKeyboardRightMarginScale = Settings.readKeyboardScale( + prefs, DebugSettings.PREF_KEYBOARD_RIGHT_MARGIN, DEFAULT_MARGIN_SCALE); mKeyPreviewShowUpDuration = Settings.readKeyPreviewAnimationDuration( prefs, DebugSettings.PREF_KEY_PREVIEW_SHOW_UP_DURATION, res.getInteger(R.integer.config_key_preview_show_up_duration)); -- cgit v1.2.3-83-g751a