mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-18 07:53:07 +00:00
Enabled split keyboard for landscape (#46)
* Enabled split keyboard for landscape Enable split keyboard is available from medium-sized (720dp) phones (landscape). On smaller phones, this toggle will be hidden. No change on tablet layout behavior.
This commit is contained in:
parent
e0174d1872
commit
38edc6fb3e
10 changed files with 703 additions and 19 deletions
|
@ -29,8 +29,9 @@ import androidx.core.content.edit
|
|||
import org.dslul.openboard.inputmethod.keyboard.KeyboardSwitcher
|
||||
import org.dslul.openboard.inputmethod.keyboard.KeyboardTheme
|
||||
import org.dslul.openboard.inputmethod.latin.R
|
||||
import org.dslul.openboard.inputmethod.latin.common.Constants
|
||||
import org.dslul.openboard.inputmethod.latin.define.ProductionFlags
|
||||
import java.lang.Float.max
|
||||
import java.lang.Float.min
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
|
@ -88,10 +89,13 @@ class AppearanceSettingsFragment : SubScreenFragment(), Preference.OnPreferenceC
|
|||
}
|
||||
setupTheme()
|
||||
|
||||
if (!ProductionFlags.IS_SPLIT_KEYBOARD_SUPPORTED ||
|
||||
Constants.isPhone(Settings.readScreenMetrics(resources))) {
|
||||
|
||||
val widthDp = activity.resources.displayMetrics.widthPixels / activity.resources.displayMetrics.density
|
||||
val heightDp = activity.resources.displayMetrics.heightPixels / activity.resources.displayMetrics.density
|
||||
if (!ProductionFlags.IS_SPLIT_KEYBOARD_SUPPORTED || (min(widthDp, heightDp) < 600 && max(widthDp, heightDp) < 720)) {
|
||||
removePreference(Settings.PREF_ENABLE_SPLIT_KEYBOARD)
|
||||
}
|
||||
|
||||
setupKeyboardHeight(
|
||||
Settings.PREF_KEYBOARD_HEIGHT_SCALE, SettingsValues.DEFAULT_SIZE_SCALE)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue