feat(core/ff_message_preview): avenir next font

Signed-off-by: rhunk <101876869+rhunk@users.noreply.github.com>
This commit is contained in:
rhunk 2024-06-09 23:10:22 +02:00
parent bcbf54b35a
commit a6d3c398c7

View File

@ -85,8 +85,10 @@ class FriendFeedMessagePreview : Feature("FriendFeedMessagePreview", loadParams
val feedEntryHeight = ffSdlAvatarSize + ffSdlAvatarMargin * 2 + (4 * context.resources.displayMetrics.density).toInt()
val separatorHeight = (context.resources.displayMetrics.density * 2).toInt()
val avenirNextMedium = context.resources.getFont(context.resources.getIdentifier("avenir_next_medium", "font"))
val textPaint = TextPaint().apply {
textSize = secondaryTextSize
typeface = avenirNextMedium
}
context.event.subscribe(BuildMessageEvent::class) { param ->
@ -134,10 +136,11 @@ class FriendFeedMessagePreview : Feature("FriendFeedMessagePreview", loadParams
frameLayout.addForegroundDrawable("ffItem", ShapeDrawable(object: Shape() {
override fun draw(canvas: Canvas, paint: Paint) {
val offsetY = canvas.height.toFloat() - previewContainerHeight
messageCache[conversationId]?.forEachIndexed { index, messageString ->
paint.textSize = secondaryTextSize
paint.color = sigColorTextPrimary
paint.typeface = avenirNextMedium
messageCache[conversationId]?.forEachIndexed { index, messageString ->
canvas.drawText(messageString,
feedEntryHeight + ffSdlPrimaryTextStartMargin,
offsetY + index * maxTextHeight,