From 71fa086f7d623ff382c63852b2de416c9389efe6 Mon Sep 17 00:00:00 2001 From: migulyaev Date: Thu, 21 Sep 2023 12:07:06 +0200 Subject: [PATCH] fix fonts --- .../letro/contacts/ui/ContactsScreen.kt | 10 ++--- .../messages/list/ConversationsListScreen.kt | 16 +++---- .../messages/viewing/ConversationScreen.kt | 6 +-- .../relaycorp/letro/ui/common/LetroButton.kt | 4 +- .../tech/relaycorp/letro/ui/theme/Type.kt | 42 +++++++++++++++++-- 5 files changed, 57 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/tech/relaycorp/letro/contacts/ui/ContactsScreen.kt b/app/src/main/java/tech/relaycorp/letro/contacts/ui/ContactsScreen.kt index 23a173f6..3275fbd4 100644 --- a/app/src/main/java/tech/relaycorp/letro/contacts/ui/ContactsScreen.kt +++ b/app/src/main/java/tech/relaycorp/letro/contacts/ui/ContactsScreen.kt @@ -35,9 +35,9 @@ import tech.relaycorp.letro.R import tech.relaycorp.letro.contacts.ContactsViewModel import tech.relaycorp.letro.contacts.model.Contact import tech.relaycorp.letro.ui.common.text.BoldText -import tech.relaycorp.letro.ui.theme.LargeProminent +import tech.relaycorp.letro.ui.theme.LabelLargeProminent import tech.relaycorp.letro.ui.theme.LetroColor -import tech.relaycorp.letro.ui.theme.SmallProminent +import tech.relaycorp.letro.ui.theme.TitleSmallProminent import tech.relaycorp.letro.ui.utils.SnackbarStringsProvider import tech.relaycorp.letro.utils.ext.showSnackbar @@ -105,7 +105,7 @@ fun ContactsScreen( ) { Text( text = stringResource(id = R.string.delete), - style = MaterialTheme.typography.LargeProminent, + style = MaterialTheme.typography.LabelLargeProminent, color = MaterialTheme.colorScheme.primary, ) } @@ -118,7 +118,7 @@ fun ContactsScreen( ) { Text( text = stringResource(id = R.string.cancel), - style = MaterialTheme.typography.LargeProminent, + style = MaterialTheme.typography.LabelLargeProminent, color = MaterialTheme.colorScheme.primary, ) } @@ -156,7 +156,7 @@ private fun EditContactBottomSheet( ) { Text( text = title, - style = MaterialTheme.typography.SmallProminent, + style = MaterialTheme.typography.TitleSmallProminent, color = MaterialTheme.colorScheme.onSurface, modifier = Modifier .fillMaxWidth() diff --git a/app/src/main/java/tech/relaycorp/letro/messages/list/ConversationsListScreen.kt b/app/src/main/java/tech/relaycorp/letro/messages/list/ConversationsListScreen.kt index f19a9d92..6373b9c7 100644 --- a/app/src/main/java/tech/relaycorp/letro/messages/list/ConversationsListScreen.kt +++ b/app/src/main/java/tech/relaycorp/letro/messages/list/ConversationsListScreen.kt @@ -28,9 +28,9 @@ import androidx.compose.ui.unit.dp import tech.relaycorp.letro.R import tech.relaycorp.letro.messages.model.ExtendedConversation import tech.relaycorp.letro.messages.model.ExtendedMessage -import tech.relaycorp.letro.ui.theme.LargeProminent -import tech.relaycorp.letro.ui.theme.MediumProminent -import tech.relaycorp.letro.ui.theme.SmallProminent +import tech.relaycorp.letro.ui.theme.BodyLargeProminent +import tech.relaycorp.letro.ui.theme.BodyMediumProminent +import tech.relaycorp.letro.ui.theme.LabelSmallProminent import tech.relaycorp.letro.ui.utils.ConversationsStringsProvider import java.util.UUID @@ -85,7 +85,7 @@ private fun Conversation( ) { Text( text = conversation.contactDisplayName, - style = if (!conversation.isRead) MaterialTheme.typography.LargeProminent else MaterialTheme.typography.bodyLarge, + style = if (!conversation.isRead) MaterialTheme.typography.BodyLargeProminent else MaterialTheme.typography.bodyLarge, color = MaterialTheme.colorScheme.onSurface, maxLines = 1, ) @@ -105,7 +105,7 @@ private fun Conversation( Spacer(modifier = Modifier.weight(1f)) Text( text = conversation.lastMessageFormattedTimestamp, - style = if (!conversation.isRead) MaterialTheme.typography.SmallProminent else MaterialTheme.typography.labelSmall, + style = if (!conversation.isRead) MaterialTheme.typography.LabelSmallProminent else MaterialTheme.typography.labelSmall, color = MaterialTheme.colorScheme.onSurface, maxLines = 1, ) @@ -113,18 +113,18 @@ private fun Conversation( Row { Text( text = conversation.subject ?: noSubjectText, - style = if (!conversation.isRead) MaterialTheme.typography.MediumProminent else MaterialTheme.typography.bodyMedium, + style = if (!conversation.isRead) MaterialTheme.typography.BodyMediumProminent else MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurface, maxLines = 1, ) Text( text = " - ", - style = if (!conversation.isRead) MaterialTheme.typography.MediumProminent else MaterialTheme.typography.bodyMedium, + style = if (!conversation.isRead) MaterialTheme.typography.BodyMediumProminent else MaterialTheme.typography.bodyMedium, color = if (!conversation.isRead) MaterialTheme.colorScheme.onSurface else MaterialTheme.colorScheme.onSurfaceVariant, ) Text( text = conversation.messages.last().text, - style = if (!conversation.isRead) MaterialTheme.typography.MediumProminent else MaterialTheme.typography.bodyMedium, + style = if (!conversation.isRead) MaterialTheme.typography.BodyMediumProminent else MaterialTheme.typography.bodyMedium, color = if (!conversation.isRead) MaterialTheme.colorScheme.onSurface else MaterialTheme.colorScheme.onSurfaceVariant, maxLines = 1, ) diff --git a/app/src/main/java/tech/relaycorp/letro/messages/viewing/ConversationScreen.kt b/app/src/main/java/tech/relaycorp/letro/messages/viewing/ConversationScreen.kt index eecbfb45..dfa71a48 100644 --- a/app/src/main/java/tech/relaycorp/letro/messages/viewing/ConversationScreen.kt +++ b/app/src/main/java/tech/relaycorp/letro/messages/viewing/ConversationScreen.kt @@ -37,7 +37,7 @@ import androidx.hilt.navigation.compose.hiltViewModel import tech.relaycorp.letro.R import tech.relaycorp.letro.messages.model.ExtendedMessage import tech.relaycorp.letro.ui.common.LetroButton -import tech.relaycorp.letro.ui.theme.LargeProminent +import tech.relaycorp.letro.ui.theme.LabelLargeProminent import tech.relaycorp.letro.ui.utils.ConversationsStringsProvider import tech.relaycorp.letro.utils.ext.applyIf @@ -256,7 +256,7 @@ private fun DeleteConversationDialog( ) { Text( text = stringResource(id = R.string.delete), - style = MaterialTheme.typography.LargeProminent, + style = MaterialTheme.typography.LabelLargeProminent, color = MaterialTheme.colorScheme.primary, ) } @@ -269,7 +269,7 @@ private fun DeleteConversationDialog( ) { Text( text = stringResource(id = R.string.cancel), - style = MaterialTheme.typography.LargeProminent, + style = MaterialTheme.typography.LabelLargeProminent, color = MaterialTheme.colorScheme.primary, ) } diff --git a/app/src/main/java/tech/relaycorp/letro/ui/common/LetroButton.kt b/app/src/main/java/tech/relaycorp/letro/ui/common/LetroButton.kt index 2a7a3577..f085978d 100644 --- a/app/src/main/java/tech/relaycorp/letro/ui/common/LetroButton.kt +++ b/app/src/main/java/tech/relaycorp/letro/ui/common/LetroButton.kt @@ -15,7 +15,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp -import tech.relaycorp.letro.ui.theme.LargeProminent +import tech.relaycorp.letro.ui.theme.LabelLargeProminent import tech.relaycorp.letro.ui.theme.LetroColor @Composable @@ -69,7 +69,7 @@ fun LetroButton( } Text( text = text, - style = MaterialTheme.typography.LargeProminent, + style = MaterialTheme.typography.LabelLargeProminent, ) } } diff --git a/app/src/main/java/tech/relaycorp/letro/ui/theme/Type.kt b/app/src/main/java/tech/relaycorp/letro/ui/theme/Type.kt index aa3c978f..ea0e8db3 100644 --- a/app/src/main/java/tech/relaycorp/letro/ui/theme/Type.kt +++ b/app/src/main/java/tech/relaycorp/letro/ui/theme/Type.kt @@ -106,7 +106,7 @@ val Typography = Typography( ), ) -val Typography.LargeProminent: TextStyle +val Typography.LabelLargeProminent: TextStyle get() = TextStyle( fontFamily = Inter, fontWeight = FontWeight.SemiBold, @@ -115,7 +115,7 @@ val Typography.LargeProminent: TextStyle letterSpacing = 0.1.sp, ) -val Typography.MediumProminent: TextStyle +val Typography.LabelMediumProminent: TextStyle get() = TextStyle( fontFamily = Inter, fontWeight = FontWeight.SemiBold, @@ -124,10 +124,46 @@ val Typography.MediumProminent: TextStyle letterSpacing = 0.1.sp, ) -val Typography.SmallProminent: TextStyle +val Typography.LabelSmallProminent: TextStyle get() = TextStyle( fontFamily = Inter, fontWeight = FontWeight.SemiBold, fontSize = 14.sp, lineHeight = 16.sp, ) + +val Typography.TitleMediumProminent: TextStyle + get() = TextStyle( + fontFamily = Inter, + fontWeight = FontWeight.SemiBold, + fontSize = 18.sp, + lineHeight = 26.sp, + letterSpacing = (-0.15).sp, + ) + +val Typography.TitleSmallProminent: TextStyle + get() = TextStyle( + fontFamily = Inter, + fontWeight = FontWeight.SemiBold, + fontSize = 16.sp, + lineHeight = 22.sp, + letterSpacing = (-0.2).sp, + ) + +val Typography.BodyLargeProminent: TextStyle + get() = TextStyle( + fontFamily = Inter, + fontWeight = FontWeight.SemiBold, + fontSize = 18.sp, + lineHeight = 26.sp, + letterSpacing = (-0.15).sp, + ) + +val Typography.BodyMediumProminent: TextStyle + get() = TextStyle( + fontFamily = Inter, + fontWeight = FontWeight.SemiBold, + fontSize = 16.sp, + lineHeight = 22.sp, + letterSpacing = (-0.25).sp, + )