commit a6d3c398c7462d4d58c9901b50b7614566f6c33a
parent bcbf54b35aa4c98ae1f58ef0a951d58c5741003a
Author: rhunk <101876869+rhunk@users.noreply.github.com>
Date:   Sun,  9 Jun 2024 23:10:22 +0200

feat(core/ff_message_preview): avenir next font

Signed-off-by: rhunk <101876869+rhunk@users.noreply.github.com>

Diffstat:
Mcore/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/ui/FriendFeedMessagePreview.kt | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/ui/FriendFeedMessagePreview.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/ui/FriendFeedMessagePreview.kt @@ -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 + paint.textSize = secondaryTextSize + paint.color = sigColorTextPrimary + paint.typeface = avenirNextMedium messageCache[conversationId]?.forEachIndexed { index, messageString -> - paint.textSize = secondaryTextSize - paint.color = sigColorTextPrimary canvas.drawText(messageString, feedEntryHeight + ffSdlPrimaryTextStartMargin, offsetY + index * maxTextHeight,