File tree Expand file tree Collapse file tree 3 files changed +6
-16
lines changed
app/src/main/java/com/osfans/trime/ime Expand file tree Collapse file tree 3 files changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -640,10 +640,12 @@ class Keyboard() {
640
640
val keyboardSidePaddingLandscape = theme.style.getInt(" keyboard_padding_land" )
641
641
642
642
val keyboardSidePaddingPx =
643
- when (appContext.resources.configuration.orientation) {
644
- Configuration .ORIENTATION_LANDSCAPE -> keyboardSidePaddingLandscape
645
- else -> keyboardSidePadding
646
- }.apply { appContext.dp(this ) }
643
+ appContext.dp(
644
+ when (appContext.resources.configuration.orientation) {
645
+ Configuration .ORIENTATION_LANDSCAPE -> keyboardSidePaddingLandscape
646
+ else -> keyboardSidePadding
647
+ },
648
+ )
647
649
648
650
mDisplayWidth = ScreenUtils .getAppScreenWidth() - 2 * keyboardSidePaddingPx
649
651
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ object KeyboardSwitcher {
16
16
private var currentKeyboardId = " .default"
17
17
private var lastKeyboardId = " .default"
18
18
private var lastLockKeyboardId = " .default"
19
- private var currentDisplayWidth: Int = 0
20
19
private val keyboardPrefs = KeyboardPrefs ()
21
20
22
21
lateinit var currentKeyboard: Keyboard
@@ -40,7 +39,6 @@ object KeyboardSwitcher {
40
39
currentKeyboardId = " .default"
41
40
lastKeyboardId = " .default"
42
41
lastLockKeyboardId = " .default"
43
- currentDisplayWidth = 0
44
42
keyboardCache.clear()
45
43
switchKeyboard(currentKeyboardId)
46
44
}
@@ -138,13 +136,4 @@ object KeyboardSwitcher {
138
136
Timber .d(" Could not find keyboard layout $layout , fallback to default" )
139
137
return " default"
140
138
}
141
-
142
- /* *
143
- * Change current display width when e.g. rotate the screen.
144
- */
145
- fun resize (displayWidth : Int ) {
146
- if (displayWidth == currentDisplayWidth) return
147
- currentDisplayWidth = displayWidth
148
- newOrReset()
149
- }
150
139
}
Original file line number Diff line number Diff line change @@ -200,7 +200,6 @@ class TextInputManager private constructor() :
200
200
}
201
201
202
202
KeyboardSwitcher .run {
203
- resize(trime.maxWidth)
204
203
// Select a keyboard based on the input type of the editing field.
205
204
switchKeyboard(keyboardType)
206
205
}
You can’t perform that action at this time.
0 commit comments