Skip to content

Commit 1133efd

Browse files
committed
style: format code
Signed-off-by: unlsycn <[email protected]>
1 parent 9d2d5fd commit 1133efd

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

app/src/main/java/com/osfans/trime/ime/composition/Composition.kt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,12 @@ class Composition(context: Context, attrs: AttributeSet?) : TextView(context, at
102102
private var onActionMove: ((Float, Float) -> Unit)? = null
103103

104104
private val stickyLines: Int
105-
get() = if (context.isLandscapeMode()) theme.generalStyle.layout.stickyLinesLand
106-
else theme.generalStyle.layout.stickyLines
105+
get() =
106+
if (context.isLandscapeMode()) {
107+
theme.generalStyle.layout.stickyLinesLand
108+
} else {
109+
theme.generalStyle.layout.stickyLines
110+
}
107111

108112
private enum class Movable {
109113
ALWAYS,
@@ -418,9 +422,11 @@ class Composition(context: Context, attrs: AttributeSet?) : TextView(context, at
418422
for (component in windowComponents) {
419423
when {
420424
component.move.isNotBlank() -> buildSpannedMove(component)
421-
component.composition.isNotBlank() -> buildSpannedComposition(
422-
component, inputContext.composition
423-
)
425+
component.composition.isNotBlank() ->
426+
buildSpannedComposition(
427+
component,
428+
inputContext.composition,
429+
)
424430

425431
component.click.isNotBlank() -> buildSpannedButton(component)
426432
component.candidate.isNotBlank() ->

app/src/main/java/com/osfans/trime/ime/keyboard/Keyboard.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
package com.osfans.trime.ime.keyboard
66

7-
import android.content.res.Configuration
87
import android.view.KeyEvent
98
import com.osfans.trime.data.prefs.AppPrefs.Companion.defaultInstance
109
import com.osfans.trime.data.theme.EventManager
@@ -425,8 +424,11 @@ class Keyboard() {
425424
val keyboardHeight = theme.generalStyle.keyboardHeight
426425
val keyboardHeightLand = theme.generalStyle.keyboardHeightLand
427426
val value =
428-
if (appContext.isLandscapeMode()) keyboardHeightLand.takeIf { it > 0 } ?: keyboardHeight
429-
else keyboardHeight
427+
if (appContext.isLandscapeMode()) {
428+
keyboardHeightLand.takeIf { it > 0 } ?: keyboardHeight
429+
} else {
430+
keyboardHeight
431+
}
430432
return appContext.dp(value)
431433
}
432434

0 commit comments

Comments
 (0)