Skip to content

Commit

Permalink
fix: fix fonts (#60)
Browse files Browse the repository at this point in the history
Fix fonts
  • Loading branch information
migulyaev authored Sep 21, 2023
1 parent 38d8177 commit c60d9d5
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
)
}
Expand All @@ -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,
)
}
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
)
Expand All @@ -105,26 +105,26 @@ 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,
)
}
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,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
)
}
Expand All @@ -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,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -69,7 +69,7 @@ fun LetroButton(
}
Text(
text = text,
style = MaterialTheme.typography.LargeProminent,
style = MaterialTheme.typography.LabelLargeProminent,
)
}
}
Expand Down
42 changes: 39 additions & 3 deletions app/src/main/java/tech/relaycorp/letro/ui/theme/Type.kt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ val Typography = Typography(
),
)

val Typography.LargeProminent: TextStyle
val Typography.LabelLargeProminent: TextStyle
get() = TextStyle(
fontFamily = Inter,
fontWeight = FontWeight.SemiBold,
Expand All @@ -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,
Expand All @@ -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,
)

0 comments on commit c60d9d5

Please sign in to comment.