diff --git a/README.md b/README.md index 23213a4ed..e633509db 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Might end up on F-Droid... * Number pad * Show all available extra characters on long pressing a key * Backup your learned word / history data +* Adjustable bottom padding ## Hidden functionality Features that may go unnoticed diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/clipboard/ClipboardLayoutParams.kt b/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/clipboard/ClipboardLayoutParams.kt index 5a98e4877..cf4e9fd6f 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/clipboard/ClipboardLayoutParams.kt +++ b/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/clipboard/ClipboardLayoutParams.kt @@ -40,8 +40,8 @@ class ClipboardLayoutParams(res: Resources) { keyHorizontalGap = res.getFraction(R.fraction.config_key_horizontal_gap_holo, defaultKeyboardWidth, defaultKeyboardWidth).toInt() } - bottomPadding = res.getFraction(R.fraction.config_keyboard_bottom_padding_holo, - defaultKeyboardHeight, defaultKeyboardHeight).toInt() + bottomPadding = (res.getFraction(R.fraction.config_keyboard_bottom_padding_holo, + defaultKeyboardHeight, defaultKeyboardHeight) * Settings.getInstance().current.mBottomPaddingScale).toInt() topPadding = res.getFraction(R.fraction.config_keyboard_top_padding_holo, defaultKeyboardHeight, defaultKeyboardHeight).toInt() diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/emoji/EmojiLayoutParams.java b/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/emoji/EmojiLayoutParams.java index f56373d9a..d7b9d6e76 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/emoji/EmojiLayoutParams.java +++ b/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/emoji/EmojiLayoutParams.java @@ -42,18 +42,14 @@ public EmojiLayoutParams(final Resources res) { mKeyHorizontalGap = (int) (res.getFraction(R.fraction.config_key_horizontal_gap_holo, defaultKeyboardWidth, defaultKeyboardWidth)); } - mBottomPadding = (int) res.getFraction(R.fraction.config_keyboard_bottom_padding_holo, - defaultKeyboardHeight, defaultKeyboardHeight); + mBottomPadding = (int) (res.getFraction(R.fraction.config_keyboard_bottom_padding_holo, + defaultKeyboardHeight, defaultKeyboardHeight) * Settings.getInstance().getCurrent().mBottomPaddingScale); mTopPadding = (int) res.getFraction(R.fraction.config_keyboard_top_padding_holo, defaultKeyboardHeight, defaultKeyboardHeight); - mEmojiCategoryPageIdViewHeight = - (int) (res.getDimension(R.dimen.config_emoji_category_page_id_height)); - final int baseheight = defaultKeyboardHeight - mBottomPadding - mTopPadding - + mKeyVerticalGap; - mEmojiActionBarHeight = baseheight / DEFAULT_KEYBOARD_ROWS - - (mKeyVerticalGap - mBottomPadding) / 2; - mEmojiListHeight = defaultKeyboardHeight - mEmojiActionBarHeight - - mEmojiCategoryPageIdViewHeight; + mEmojiCategoryPageIdViewHeight = (int) (res.getDimension(R.dimen.config_emoji_category_page_id_height)); + final int baseheight = defaultKeyboardHeight - mBottomPadding - mTopPadding + mKeyVerticalGap; + mEmojiActionBarHeight = baseheight / DEFAULT_KEYBOARD_ROWS - (mKeyVerticalGap - mBottomPadding) / 2; + mEmojiListHeight = defaultKeyboardHeight - mEmojiActionBarHeight - mEmojiCategoryPageIdViewHeight; mEmojiListBottomMargin = 0; mEmojiKeyboardHeight = mEmojiListHeight - mEmojiListBottomMargin - 1; } diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/internal/KeyboardParams.java b/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/internal/KeyboardParams.java index 0c65ab129..6b0b6234a 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/internal/KeyboardParams.java +++ b/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/internal/KeyboardParams.java @@ -210,8 +210,9 @@ public void readAttributes(final Context context, @Nullable final AttributeSet a mOccupiedWidth = width; mTopPadding = (int) keyboardAttr.getFraction( R.styleable.Keyboard_keyboardTopPadding, height, height, 0); - mBottomPadding = (int) keyboardAttr.getFraction( - R.styleable.Keyboard_keyboardBottomPadding, height, height, 0); + mBottomPadding = (int) (keyboardAttr.getFraction( + R.styleable.Keyboard_keyboardBottomPadding, height, height, 0) + * Settings.getInstance().getCurrent().mBottomPaddingScale); mLeftPadding = (int) keyboardAttr.getFraction( R.styleable.Keyboard_keyboardLeftPadding, width, width, 0); mRightPadding = (int) keyboardAttr.getFraction( diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/AppearanceSettingsFragment.kt b/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/AppearanceSettingsFragment.kt index a2635a3f8..5d3818b93 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/AppearanceSettingsFragment.kt +++ b/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/AppearanceSettingsFragment.kt @@ -41,6 +41,7 @@ class AppearanceSettingsFragment : SubScreenFragment() { setColorPrefs(sharedPreferences.getString(Settings.PREF_THEME_STYLE, KeyboardTheme.STYLE_MATERIAL)!!) setupScalePrefs(Settings.PREF_KEYBOARD_HEIGHT_SCALE, SettingsValues.DEFAULT_SIZE_SCALE) + setupScalePrefs(Settings.PREF_BOTTOM_PADDING_SCALE, SettingsValues.DEFAULT_SIZE_SCALE) if (splitScalePref != null) { setupScalePrefs(Settings.PREF_SPLIT_SPACER_SCALE, SettingsValues.DEFAULT_SIZE_SCALE) splitScalePref?.isVisible = splitPref?.isChecked == true diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/Settings.java b/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/Settings.java index a64617877..0d4e52099 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/Settings.java +++ b/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/Settings.java @@ -85,6 +85,7 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang public static final String PREF_ENABLE_SPLIT_KEYBOARD = "pref_split_keyboard"; public static final String PREF_SPLIT_SPACER_SCALE = "pref_split_spacer_scale"; public static final String PREF_KEYBOARD_HEIGHT_SCALE = "pref_keyboard_height_scale"; + public static final String PREF_BOTTOM_PADDING_SCALE = "pref_bottom_padding_scale"; public static final String PREF_SPACE_TRACKPAD = "pref_space_trackpad"; public static final String PREF_DELETE_SWIPE = "pref_delete_swipe"; public static final String PREF_AUTOSPACE_AFTER_PUNCTUATION = "pref_autospace_after_punctuation"; diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/SettingsValues.java b/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/SettingsValues.java index a9ba50ecf..d7c9ae5c3 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/SettingsValues.java +++ b/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/SettingsValues.java @@ -103,6 +103,7 @@ public class SettingsValues { public final float mKeyboardHeightScale; public final boolean mUrlDetectionEnabled; public final List mPinnedKeys; + public final float mBottomPaddingScale; // From the input box @NonNull @@ -228,6 +229,7 @@ public SettingsValues(final Context context, final SharedPreferences prefs, fina mUrlDetectionEnabled = prefs.getBoolean(Settings.PREF_URL_DETECTION, false); mPinnedKeys = Settings.readPinnedKeys(prefs); mSpacingAndPunctuations = new SpacingAndPunctuations(res, mUrlDetectionEnabled); + mBottomPaddingScale = prefs.getFloat(Settings.PREF_BOTTOM_PADDING_SCALE, DEFAULT_SIZE_SCALE); } public boolean isApplicationSpecifiedCompletionsOn() { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 45b5395d4..6d2e595ab 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -236,6 +236,10 @@ Narrow key gaps Keyboard height scale + + Bottom padding scale + + Set size of the empty space below the keyboard English (UK) diff --git a/app/src/main/res/xml/prefs_screen_appearance.xml b/app/src/main/res/xml/prefs_screen_appearance.xml index 57bfd9835..2a8a0bca1 100644 --- a/app/src/main/res/xml/prefs_screen_appearance.xml +++ b/app/src/main/res/xml/prefs_screen_appearance.xml @@ -81,6 +81,13 @@ latin:minValue="50" latin:maxValue="150" /> + +