Skip to content

Commit 642180b

Browse files
ENOA-ANSUL-EDENBambooin
authored andcommitted
feat: add spacing for candidate comment layout
1 parent dc9d068 commit 642180b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

app/src/main/java/com/osfans/trime/ime/candidates/CandidateItemUi.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import com.osfans.trime.data.theme.Theme
1616
import com.osfans.trime.ime.core.AutoScaleTextView
1717
import com.osfans.trime.ime.keyboard.GestureFrame
1818
import com.osfans.trime.util.pressHighlightDrawable
19-
import splitties.dimensions.dp
2019
import splitties.views.dsl.constraintlayout.baselineToBaselineOf
2120
import splitties.views.dsl.constraintlayout.centerHorizontally
2221
import splitties.views.dsl.constraintlayout.centerInParent
@@ -35,12 +34,10 @@ import splitties.views.dsl.core.matchParent
3534
import splitties.views.dsl.core.view
3635
import splitties.views.dsl.core.wrapContent
3736
import splitties.views.gravityCenter
38-
import splitties.views.horizontalPadding
39-
import timber.log.Timber
4037

4138
class CandidateItemUi(
4239
override val ctx: Context,
43-
theme: Theme,
40+
private val theme: Theme,
4441
) : Ui {
4542
private val textSize = theme.generalStyle.candidateTextSize
4643
private val commentSize = theme.generalStyle.commentTextSize
@@ -133,7 +130,7 @@ class CandidateItemUi(
133130
val cColor = if (isHighlighted) hlCommentColor else commentColor
134131
text.text = item.text
135132
text.setTextColor(tColor)
136-
comment.text = item.comment
133+
comment.text = if (theme.generalStyle.commentOnTop) item.comment else " ${item.comment}"
137134
comment.setTextColor(cColor)
138135
comment.isGone = item.comment.isEmpty()
139136
root.background =

0 commit comments

Comments
 (0)