@@ -142,12 +142,14 @@ class Composition(context: Context, attrs: AttributeSet?) : TextView(context, at
142
142
private val highlightTextColor : Int? ,
143
143
private val highlightBackColor : Int? ,
144
144
private val textColor : Int? ,
145
+ private val textSize : Int ,
145
146
) : ClickableSpan() {
146
147
override fun onClick (tv : View ) {
147
148
textInputManager?.onCandidatePressed(index)
148
149
}
149
150
150
151
override fun updateDrawState (ds : TextPaint ) {
152
+ ds.textSize = sp(textSize).toFloat()
151
153
ds.isUnderlineText = false
152
154
ds.typeface = typeface
153
155
if (index == highlightIndex) {
@@ -319,6 +321,7 @@ class Composition(context: Context, attrs: AttributeSet?) : TextView(context, at
319
321
highlightLabelColor,
320
322
highlightCandidateBackColor,
321
323
labelColor,
324
+ labelTextSize,
322
325
)
323
326
inSpans(alignmentSpan, labelSpan, labelTextSizeSpan) { append(label) }
324
327
@@ -329,6 +332,7 @@ class Composition(context: Context, attrs: AttributeSet?) : TextView(context, at
329
332
highlightCandidateTextColor,
330
333
highlightCandidateBackColor,
331
334
candidateTextColor,
335
+ candidateTextSize,
332
336
)
333
337
inSpans(alignmentSpan, candidateSpan, candidateTextSizeSpan) { append(text) }
334
338
currentLineLength + = text.length
@@ -341,6 +345,7 @@ class Composition(context: Context, attrs: AttributeSet?) : TextView(context, at
341
345
highlightCommentTextColor,
342
346
highlightCandidateBackColor,
343
347
commentTextColor,
348
+ commentTextSize,
344
349
)
345
350
inSpans(alignmentSpan, commentSpan, commentTextSizeSpan) { append(comment) }
346
351
currentLineLength + = comment.length
0 commit comments