mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-19 05:39:10 +00:00
add setting for adjusting bottom padding in landscape mode
fixes some issue I can't currently find slight issue: will remove the bottom padding on large tables (sw768-land), users need to get it back by switching to 100%
This commit is contained in:
parent
fc12877795
commit
f45f69f8a2
7 changed files with 20 additions and 3 deletions
|
@ -105,6 +105,7 @@ class AppearanceSettingsFragment : SubScreenFragment() {
|
|||
|
||||
setupScalePrefs(Settings.PREF_KEYBOARD_HEIGHT_SCALE, SettingsValues.DEFAULT_SIZE_SCALE)
|
||||
setupScalePrefs(Settings.PREF_BOTTOM_PADDING_SCALE, SettingsValues.DEFAULT_SIZE_SCALE)
|
||||
setupScalePrefs(Settings.PREF_BOTTOM_PADDING_SCALE_LANDSCAPE, 0f)
|
||||
if (splitScalePref != null) {
|
||||
setupScalePrefs(Settings.PREF_SPLIT_SPACER_SCALE, SettingsValues.DEFAULT_SIZE_SCALE)
|
||||
splitScalePref?.isVisible = splitPref?.isChecked == true
|
||||
|
|
|
@ -112,6 +112,7 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
|
|||
public static final String PREF_SPLIT_SPACER_SCALE = "split_spacer_scale";
|
||||
public static final String PREF_KEYBOARD_HEIGHT_SCALE = "keyboard_height_scale";
|
||||
public static final String PREF_BOTTOM_PADDING_SCALE = "bottom_padding_scale";
|
||||
public static final String PREF_BOTTOM_PADDING_SCALE_LANDSCAPE = "bottom_padding_scale_landscape";
|
||||
public static final String PREF_SPACE_HORIZONTAL_SWIPE = "horizontal_space_swipe";
|
||||
public static final String PREF_SPACE_VERTICAL_SWIPE = "vertical_space_swipe";
|
||||
public static final String PREF_DELETE_SWIPE = "delete_swipe";
|
||||
|
@ -499,6 +500,12 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
|
|||
(getCurrent().mDisplayOrientation == Configuration.ORIENTATION_PORTRAIT), gravity).apply();
|
||||
}
|
||||
|
||||
public static float readBottomPaddingScale(final SharedPreferences prefs, final boolean landscape) {
|
||||
if (landscape)
|
||||
return prefs.getFloat(PREF_BOTTOM_PADDING_SCALE_LANDSCAPE, 0f);
|
||||
return prefs.getFloat(PREF_BOTTOM_PADDING_SCALE, SettingsValues.DEFAULT_SIZE_SCALE);
|
||||
}
|
||||
|
||||
public static boolean readHasHardwareKeyboard(final Configuration conf) {
|
||||
// The standard way of finding out whether we have a hardware keyboard. This code is taken
|
||||
// from InputMethodService#onEvaluateInputShown, which canonically determines this.
|
||||
|
|
|
@ -262,7 +262,7 @@ public class SettingsValues {
|
|||
prefs.getBoolean(Settings.PREF_GESTURE_SPACE_AWARE, false)
|
||||
);
|
||||
mSpacingAndPunctuations = new SpacingAndPunctuations(res, mUrlDetectionEnabled);
|
||||
mBottomPaddingScale = prefs.getFloat(Settings.PREF_BOTTOM_PADDING_SCALE, DEFAULT_SIZE_SCALE);
|
||||
mBottomPaddingScale = Settings.readBottomPaddingScale(prefs, mDisplayOrientation == Configuration.ORIENTATION_LANDSCAPE);
|
||||
mLongPressSymbolsForNumpad = prefs.getBoolean(Settings.PREFS_LONG_PRESS_SYMBOLS_FOR_NUMPAD, false);
|
||||
mAutoShowToolbar = prefs.getBoolean(Settings.PREF_AUTO_SHOW_TOOLBAR, false);
|
||||
mAutoHideToolbar = readSuggestionsEnabled(prefs) && prefs.getBoolean(Settings.PREF_AUTO_HIDE_TOOLBAR, false);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<dimen name="config_popup_keys_keyboard_slide_allowance">53.76dp</dimen>
|
||||
|
||||
<fraction name="config_keyboard_top_padding_holo">2.727%p</fraction>
|
||||
<fraction name="config_keyboard_bottom_padding_holo">0.0%p</fraction>
|
||||
<fraction name="config_keyboard_bottom_padding_holo">2.5%p</fraction>
|
||||
<fraction name="config_key_vertical_gap_holo">5.368%p</fraction>
|
||||
<fraction name="config_key_horizontal_gap_holo">1.020%p</fraction>
|
||||
<fraction name="config_key_vertical_gap_holo_narrow">4.85%p</fraction>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<dimen name="config_popup_keys_keyboard_key_height">81.9dp</dimen>
|
||||
|
||||
<fraction name="config_keyboard_top_padding_holo">2.727%p</fraction>
|
||||
<fraction name="config_keyboard_bottom_padding_holo">0.0%p</fraction>
|
||||
<fraction name="config_keyboard_bottom_padding_holo">2.0%p</fraction>
|
||||
<fraction name="config_key_vertical_gap_holo">4.5%p</fraction>
|
||||
<fraction name="config_key_horizontal_gap_holo">0.9%p</fraction>
|
||||
<fraction name="config_key_vertical_gap_holo_narrow">4.5%p</fraction>
|
||||
|
|
|
@ -311,6 +311,8 @@
|
|||
<string name="prefs_keyboard_height_scale">Keyboard height scale</string>
|
||||
<!-- Title of the setting for setting bottom padding height -->
|
||||
<string name="prefs_bottom_padding_scale">Bottom padding scale</string>
|
||||
<!-- Title of the setting for setting bottom padding height in landscape mode -->
|
||||
<string name="prefs_bottom_padding_scale_landscape">Bottom padding scale (landscape)</string>
|
||||
<!-- Title of the setting for customizing space bar text -->
|
||||
<string name="prefs_space_bar_text">Custom text on space bar</string>
|
||||
<!-- Title of the setting for adding / removing custom font file -->
|
||||
|
|
|
@ -111,6 +111,13 @@
|
|||
latin:minValue="0"
|
||||
latin:maxValue="500" /> <!-- percentage -->
|
||||
|
||||
<helium314.keyboard.latin.settings.SeekBarDialogPreference
|
||||
android:key="bottom_padding_scale_landscape"
|
||||
android:title="@string/prefs_bottom_padding_scale_landscape"
|
||||
latin:defaultValue="0"
|
||||
latin:minValue="0"
|
||||
latin:maxValue="500" /> <!-- percentage -->
|
||||
|
||||
<EditTextPreference
|
||||
android:key="space_bar_text"
|
||||
android:title="@string/prefs_space_bar_text"
|
||||
|
|
Loading…
Add table
Reference in a new issue