Skip to content

Commit

Permalink
refactor: constraint the text views' height in CandidateItemUi
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck committed Dec 30, 2024
1 parent 0be5946 commit 0aa78a5
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ import com.osfans.trime.data.theme.FontManager
import com.osfans.trime.data.theme.Theme
import com.osfans.trime.ime.core.AutoScaleTextView
import com.osfans.trime.util.pressHighlightDrawable
import splitties.dimensions.dp
import splitties.views.dsl.constraintlayout.bottomOfParent
import splitties.views.dsl.constraintlayout.centerHorizontally
import splitties.views.dsl.constraintlayout.centerVertically
import splitties.views.dsl.constraintlayout.constraintLayout
import splitties.views.dsl.constraintlayout.horizontalChain
import splitties.views.dsl.constraintlayout.packed
import splitties.views.dsl.constraintlayout.topOfParent
import splitties.views.dsl.constraintlayout.verticalChain
import splitties.views.dsl.core.Ui
import splitties.views.dsl.core.view
Expand Down Expand Up @@ -63,7 +66,14 @@ class CandidateItemUi(
listOf(lastText, firstText),
style = packed,
defaultWidth = wrapContent,
defaultHeight = wrapContent,
initFirstViewParams = {
height = dp(theme.generalStyle.commentHeight)
topOfParent()
},
initLastViewParams = {
height = dp(theme.generalStyle.candidateViewHeight)
bottomOfParent()
},
initParams = { centerHorizontally() },
)
} else {
Expand Down

0 comments on commit 0aa78a5

Please sign in to comment.