Skip to content

Commit

Permalink
style: format code
Browse files Browse the repository at this point in the history
Signed-off-by: unlsycn <unlsycn@unlsycn.com>
  • Loading branch information
unlsycn committed Jun 30, 2024
1 parent 9d2d5fd commit 1133efd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
16 changes: 11 additions & 5 deletions app/src/main/java/com/osfans/trime/ime/composition/Composition.kt
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,12 @@ class Composition(context: Context, attrs: AttributeSet?) : TextView(context, at
private var onActionMove: ((Float, Float) -> Unit)? = null

private val stickyLines: Int
get() = if (context.isLandscapeMode()) theme.generalStyle.layout.stickyLinesLand
else theme.generalStyle.layout.stickyLines
get() =
if (context.isLandscapeMode()) {
theme.generalStyle.layout.stickyLinesLand
} else {
theme.generalStyle.layout.stickyLines
}

private enum class Movable {
ALWAYS,
Expand Down Expand Up @@ -418,9 +422,11 @@ class Composition(context: Context, attrs: AttributeSet?) : TextView(context, at
for (component in windowComponents) {
when {
component.move.isNotBlank() -> buildSpannedMove(component)
component.composition.isNotBlank() -> buildSpannedComposition(
component, inputContext.composition
)
component.composition.isNotBlank() ->
buildSpannedComposition(
component,
inputContext.composition,
)

component.click.isNotBlank() -> buildSpannedButton(component)
component.candidate.isNotBlank() ->
Expand Down
8 changes: 5 additions & 3 deletions app/src/main/java/com/osfans/trime/ime/keyboard/Keyboard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

package com.osfans.trime.ime.keyboard

import android.content.res.Configuration
import android.view.KeyEvent
import com.osfans.trime.data.prefs.AppPrefs.Companion.defaultInstance
import com.osfans.trime.data.theme.EventManager
Expand Down Expand Up @@ -425,8 +424,11 @@ class Keyboard() {
val keyboardHeight = theme.generalStyle.keyboardHeight
val keyboardHeightLand = theme.generalStyle.keyboardHeightLand
val value =
if (appContext.isLandscapeMode()) keyboardHeightLand.takeIf { it > 0 } ?: keyboardHeight
else keyboardHeight
if (appContext.isLandscapeMode()) {
keyboardHeightLand.takeIf { it > 0 } ?: keyboardHeight
} else {
keyboardHeight
}
return appContext.dp(value)
}

Expand Down

0 comments on commit 1133efd

Please sign in to comment.