Skip to content

Commit 20fa6d3

Browse files
committed
chore: update design system to use our naming system for typography
Signed-off-by: Brandon McAnsh <[email protected]>
1 parent d50ea25 commit 20fa6d3

File tree

72 files changed

+376
-274
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+376
-274
lines changed

app/src/main/java/com/getcode/navigation/screens/ChatScreens.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,13 @@ data class ChatMessageConversationScreen(val messageId: ID) : AppScreen(), ChatG
215215
)
216216
Column {
217217
Text(text = user.username,
218-
style = CodeTheme.typography.subtitle2
218+
style = CodeTheme.typography.screenTitle
219219
)
220220
state.lastSeen?.let {
221221
Text(
222222
text = "Last seen ${it.formatDateRelatively()}",
223223
style = CodeTheme.typography.caption,
224-
color = BrandLight,
224+
color = CodeTheme.colors.textSecondary,
225225
)
226226
}
227227
}

app/src/main/java/com/getcode/navigation/screens/PhoneCountrySelection.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ private fun PhoneCountrySelection(
7070
.padding(start = CodeTheme.dimens.inset)
7171
.align(Alignment.CenterVertically),
7272
text = countryCode.name,
73-
style = CodeTheme.typography.body1.copy(fontWeight = FontWeight.Bold)
73+
style = CodeTheme.typography.textMedium.copy(fontWeight = FontWeight.Bold)
7474
)
7575
Text(
7676
modifier = Modifier
7777
.padding(CodeTheme.dimens.inset)
7878
.align(Alignment.CenterVertically),
79-
color = BrandLight,
79+
color = CodeTheme.colors.textSecondary,
8080
text = "+${countryCode.phoneCode}",
81-
style = CodeTheme.typography.body1.copy(fontWeight = FontWeight.Bold)
81+
style = CodeTheme.typography.textMedium.copy(fontWeight = FontWeight.Bold)
8282
)
8383
}
8484
Divider(

app/src/main/java/com/getcode/ui/components/Badge.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fun Badge(
4141
Text(
4242
text = text,
4343
color = contentColor,
44-
style = CodeTheme.typography.body1.copy(fontWeight = FontWeight.W700),
44+
style = CodeTheme.typography.textMedium.copy(fontWeight = FontWeight.W700),
4545
modifier = Modifier
4646
.drawBehind {
4747
drawCircle(

app/src/main/java/com/getcode/ui/components/BottomBarView.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ fun BottomBarView(
5757
CompositionLocalProvider(LocalContentColor provides White) {
5858
Column(verticalArrangement = Arrangement.spacedBy(CodeTheme.dimens.grid.x2)) {
5959
Text(
60-
style = CodeTheme.typography.subtitle1,
60+
style = CodeTheme.typography.textLarge,
6161
text = bottomBarMessage.title
6262
)
6363
Text(
64-
style = CodeTheme.typography.body2,
64+
style = CodeTheme.typography.textSmall,
6565
text = bottomBarMessage.subtitle,
6666
color = LocalContentColor.current.copy(alpha = 0.8f)
6767
)
@@ -101,7 +101,7 @@ fun BottomBarView(
101101
onClose(BottomBarManager.BottomBarActionType.Tertiary)
102102
}
103103
.padding(vertical = CodeTheme.dimens.grid.x2),
104-
style = CodeTheme.typography.button,
104+
style = CodeTheme.typography.textLarge,
105105
color = White,
106106
text = it
107107
)

app/src/main/java/com/getcode/ui/components/CodeButton.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ fun CodeButton(
5858
shape = shape,
5959
contentColor = textColor,
6060
) {
61-
Text(
62-
text = text,
63-
style = CodeTheme.typography.button,
64-
)
61+
Text(text = text)
6562
}
6663
}
6764

@@ -139,7 +136,9 @@ fun CodeButton(
139136
}
140137

141138
else -> {
142-
content()
139+
ProvideTextStyle(value = CodeTheme.typography.textMedium) {
140+
content()
141+
}
143142
}
144143
}
145144
}

app/src/main/java/com/getcode/ui/components/CodeKeyPad.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,7 @@ private fun KeyBoardButton(
172172
Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
173173
Text(
174174
text = text,
175-
style = CodeTheme.typography.button.copy(
176-
fontSize = 32.sp,
177-
fontWeight = FontWeight.Normal,
178-
textAlign = TextAlign.Center
179-
),
175+
style = CodeTheme.typography.keyboard,
180176
modifier = Modifier
181177
.fillMaxWidth()
182178
.padding(vertical = CodeTheme.dimens.staticGrid.x1)

app/src/main/java/com/getcode/ui/components/CodeSeedView.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,21 @@ private fun SeedItem(
5050
text = "$number.",
5151
modifier = Modifier.padding(end = CodeTheme.dimens.grid.x3)
5252
.width(CodeTheme.dimens.grid.x6),
53-
style = CodeTheme.typography.body1.copy(
53+
style = CodeTheme.typography.textMedium.copy(
5454
textAlign = TextAlign.End
5555
),
56-
color = BrandLight
56+
color = CodeTheme.colors.textSecondary
5757
)
5858
Box {
5959
Text(
6060
modifier = Modifier.alpha(if (isVisible) 1f else 0f),
6161
text = text,
62-
style = CodeTheme.typography.body1
62+
style = CodeTheme.typography.textMedium
6363
)
6464
Text(
6565
modifier = Modifier.alpha(if (!isVisible) 1f else 0f),
6666
text = "-".repeat(text.length),
67-
style = CodeTheme.typography.body1
67+
style = CodeTheme.typography.textMedium
6868
)
6969
}
7070
}

app/src/main/java/com/getcode/ui/components/OtpBox.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fun OtpBox(
4949
text = character,
5050
modifier = Modifier
5151
.align(Alignment.Center),
52-
style = CodeTheme.typography.h6.copy(fontWeight = FontWeight.Normal),
52+
style = CodeTheme.typography.displayExtraSmall,
5353
color = Color.White,
5454
)
5555
}

app/src/main/java/com/getcode/ui/components/SheetTitle.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ fun BoxScope.SheetTitleText(modifier: Modifier = Modifier, text: String) {
2929
Text(
3030
text = text,
3131
color = Color.White,
32-
style = CodeTheme.typography.h6.copy(
33-
fontWeight = FontWeight.Bold,
34-
textAlign = TextAlign.Center
35-
),
32+
style = CodeTheme.typography.screenTitle,
3633
modifier = modifier.align(Alignment.Center)
3734
)
3835
}

app/src/main/java/com/getcode/ui/components/SlideToConfirm.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ object SlideToConfirmDefaults {
9494
Text(
9595
text = text,
9696
color = hintTextColor,
97-
style = CodeTheme.typography.body1,
97+
style = CodeTheme.typography.textMedium,
9898
modifier = modifier,
9999
)
100100
}

app/src/main/java/com/getcode/ui/components/TextInput.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ fun TextInput(
6565
onStateChanged: () -> Unit = { },
6666
keyboardActions: KeyboardActions = KeyboardActions(),
6767
keyboardOptions: KeyboardOptions = KeyboardOptions(),
68-
style: TextStyle = CodeTheme.typography.body1,
69-
placeholderStyle: TextStyle = CodeTheme.typography.body1,
68+
style: TextStyle = CodeTheme.typography.textMedium,
69+
placeholderStyle: TextStyle = CodeTheme.typography.textMedium,
7070
shape: Shape = CodeTheme.shapes.extraSmall,
7171
colors: TextFieldColors = inputColors(),
7272
enabled: Boolean = true,
@@ -135,8 +135,8 @@ fun SecureTextInput(
135135
placeholder: String = "",
136136
state: TextFieldState,
137137
onStateChanged: () -> Unit = { },
138-
style: TextStyle = CodeTheme.typography.subtitle1,
139-
placeholderStyle: TextStyle = CodeTheme.typography.subtitle1,
138+
style: TextStyle = CodeTheme.typography.textLarge,
139+
placeholderStyle: TextStyle = CodeTheme.typography.textLarge,
140140
shape: Shape = RectangleShape,
141141
colors: TextFieldColors = inputColors(),
142142
enabled: Boolean = true,

app/src/main/java/com/getcode/ui/components/TextSection.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ fun TextSection(title: String, description: String) {
1414
Column(verticalArrangement = Arrangement.spacedBy(CodeTheme.dimens.grid.x2)) {
1515
Text(
1616
text = title,
17-
style = CodeTheme.typography.subtitle1
17+
style = CodeTheme.typography.textLarge
1818
)
1919
Text(
2020
text = description,
21-
style = CodeTheme.typography.body2
21+
style = CodeTheme.typography.textSmall
2222
)
2323
}
2424
}

app/src/main/java/com/getcode/ui/components/TitleBar.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fun TitleBar(
5151
Text(
5252
text = title,
5353
color = Color.White,
54-
style = CodeTheme.typography.subtitle2,
54+
style = CodeTheme.typography.screenTitle,
5555
modifier = Modifier.align(Alignment.Center)
5656
)
5757
}

app/src/main/java/com/getcode/ui/components/TopBarContainer.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private fun TopBarView(
127127
)
128128
Text(
129129
text = topBarMessage.title,
130-
style = CodeTheme.typography.body1.copy(
130+
style = CodeTheme.typography.textMedium.copy(
131131
fontWeight = FontWeight.Bold,
132132
fontSize = 18.sp,
133133
lineHeight = 20.sp
@@ -141,7 +141,7 @@ private fun TopBarView(
141141
modifier = Modifier
142142
.padding(horizontal = CodeTheme.dimens.inset),
143143
text = topBarMessage.message,
144-
style = CodeTheme.typography.body1.copy(
144+
style = CodeTheme.typography.textMedium.copy(
145145
fontSize = 15.sp,
146146
lineHeight = 18.sp
147147
),

app/src/main/java/com/getcode/ui/components/TwitterUsernameDisplay.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fun TwitterUsernameDisplay(
3232
painter = rememberVectorPainter(image = ImageVector.vectorResource(id = R.drawable.ic_twitter_x)),
3333
contentDescription = null
3434
)
35-
Text(text = username, style = CodeTheme.typography.subtitle1)
35+
Text(text = username, style = CodeTheme.typography.textLarge)
3636
verificationStatus?.let { status ->
3737
status.checkmark()?.let { asset ->
3838
Image(

app/src/main/java/com/getcode/ui/components/chat/AnnouncementMessage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fun AnnouncementMessage(
3131
) {
3232
Text(
3333
text = text,
34-
style = CodeTheme.typography.body1.copy(fontWeight = FontWeight.W500)
34+
style = CodeTheme.typography.textMedium.copy(fontWeight = FontWeight.W500)
3535
)
3636
}
3737
}

app/src/main/java/com/getcode/ui/components/chat/ChatNode.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fun ChatNode(
6060
modifier = Modifier.fillMaxWidth(),
6161
horizontalArrangement = Arrangement.SpaceBetween,
6262
) {
63-
Text(text = chat.localizedTitle, maxLines = 1, style = CodeTheme.typography.body1)
63+
Text(text = chat.localizedTitle, maxLines = 1, style = CodeTheme.typography.textMedium)
6464
chat.lastMessageMillis?.let {
6565
val isToday = DateUtils.isToday(it)
6666
Text(
@@ -69,7 +69,7 @@ fun ChatNode(
6969
} else {
7070
DateUtils.getDateRelatively(it)
7171
},
72-
style = CodeTheme.typography.body2,
72+
style = CodeTheme.typography.textSmall,
7373
color = if (hasUnreadMessages) ChatNodeDefaults.UnreadIndicator else CodeTheme.colors.brandLight,
7474
)
7575
}
@@ -81,7 +81,7 @@ fun ChatNode(
8181
Text(
8282
modifier = Modifier.weight(1f),
8383
text = chat.messagePreview,
84-
style = CodeTheme.typography.body1,
84+
style = CodeTheme.typography.textMedium,
8585
color = CodeTheme.colors.brandLight,
8686
maxLines = 2,
8787
overflow = TextOverflow.Ellipsis

app/src/main/java/com/getcode/ui/components/chat/DateWithStatus.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ internal fun DateWithStatus(
5050
modifier = Modifier.weight(1f, fill = false),
5151
text = date.formatTimeRelatively(),
5252
style = DateWithStatusDefaults.DateTextStyle,
53-
color = BrandLight,
53+
color = CodeTheme.colors.textSecondary,
5454
maxLines = 1
5555
)
5656
if (status.isValid() && status != MessageStatus.Incoming) {

app/src/main/java/com/getcode/ui/components/chat/EncryptedContent.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ internal fun EncryptedContent(modifier: Modifier = Modifier, date: Instant) {
3636
modifier = Modifier.align(Alignment.End),
3737
text = date.formatTimeRelatively(),
3838
style = CodeTheme.typography.caption,
39-
color = BrandLight,
39+
color = CodeTheme.colors.textSecondary,
4040
)
4141
}
4242
}

app/src/main/java/com/getcode/ui/components/chat/MessagePayment.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,18 @@ internal fun MessagePayment(
6969
Text(
7070
text = price,
7171
color = Color.White,
72-
style = CodeTheme.typography.h3
72+
style = CodeTheme.typography.displaySmall
7373
)
7474
}
7575
)
7676
Text(
7777
text = contents.verb.localizedText,
78-
style = CodeTheme.typography.body1.copy(fontWeight = FontWeight.W500)
78+
style = CodeTheme.typography.textMedium.copy(fontWeight = FontWeight.W500)
7979
)
8080
} else {
8181
Text(
8282
text = contents.verb.localizedText,
83-
style = CodeTheme.typography.body1.copy(fontWeight = FontWeight.W500)
83+
style = CodeTheme.typography.textMedium.copy(fontWeight = FontWeight.W500)
8484
)
8585
PriceWithFlag(
8686
currencyCode = amount.rate.currency,
@@ -89,7 +89,7 @@ internal fun MessagePayment(
8989
Text(
9090
text = price,
9191
color = Color.White,
92-
style = CodeTheme.typography.h3
92+
style = CodeTheme.typography.displaySmall
9393
)
9494
}
9595
)

app/src/main/java/com/getcode/ui/components/chat/MessageTextContent.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private fun rememberAlignmentRule(
121121

122122
@Composable
123123
private fun MessageContent(maxWidth: Int, message: String, date: Instant, status: MessageStatus) {
124-
val contentStyle = CodeTheme.typography.body1.copy(fontWeight = FontWeight.W500)
124+
val contentStyle = CodeTheme.typography.textMedium.copy(fontWeight = FontWeight.W500)
125125
val alignmentRule by rememberAlignmentRule(
126126
contentTextStyle = contentStyle,
127127
maxWidth = maxWidth,

app/src/main/java/com/getcode/ui/tips/definitions/DownloadCodeTip.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class DownloadCodeTip @Inject constructor(
3838
return {
3939
Text(
4040
text = stringResource(R.string.action_tapToShareDownloadLink),
41-
style = CodeTheme.typography.body1
41+
style = CodeTheme.typography.textMedium
4242
)
4343
}
4444
}

app/src/main/java/com/getcode/view/download/ShareDownloadScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fun ShareDownloadScreen() {
7373
Text(
7474
modifier = Modifier.fillMaxWidth(0.6f),
7575
text = stringResource(R.string.title_scanToDownloadCode),
76-
style = CodeTheme.typography.subtitle1,
76+
style = CodeTheme.typography.textLarge,
7777
textAlign = TextAlign.Center
7878
)
7979

app/src/main/java/com/getcode/view/login/AccessKey.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ fun AccessKey(
237237
top = CodeTheme.dimens.grid.x3,
238238
bottom = CodeTheme.dimens.grid.x6
239239
),
240-
style = CodeTheme.typography.body2.copy(textAlign = TextAlign.Center),
240+
style = CodeTheme.typography.textSmall.copy(textAlign = TextAlign.Center),
241241
color = White,
242242
text = stringResource(R.string.subtitle_accessKeyDescription)
243243
)

app/src/main/java/com/getcode/view/login/CameraPermission.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fun CameraPermission(navigator: CodeNavigator = LocalCodeNavigator.current) {
8383
end.linkTo(parent.end)
8484
},
8585
text = stringResource(R.string.permissions_description_camera),
86-
style = CodeTheme.typography.body1
86+
style = CodeTheme.typography.textMedium
8787
.copy(textAlign = TextAlign.Center),
8888
)
8989

app/src/main/java/com/getcode/view/login/InviteCode.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fun InviteCode(
8383
)
8484
.background(White05),
8585
value = dataState.inviteCode,
86-
textStyle = CodeTheme.typography.subtitle1,
86+
textStyle = CodeTheme.typography.textLarge,
8787
keyboardOptions = KeyboardOptions.Default.copy(keyboardType = KeyboardType.Text),
8888
colors = TextFieldDefaults.textFieldColors(
8989
backgroundColor = Color.Transparent,
@@ -116,10 +116,10 @@ fun InviteCode(
116116
modifier = Modifier.constrainAs(captionText) {
117117
linkTo(inviteCodeRow.bottom, captionText.top, topMargin = x4)
118118
},
119-
style = CodeTheme.typography.body2.copy(
119+
style = CodeTheme.typography.textSmall.copy(
120120
textAlign = TextAlign.Center
121121
),
122-
color = BrandLight,
122+
color = CodeTheme.colors.textSecondary,
123123
text = stringResource(id = R.string.subtitle_inviteCodeDescription)
124124
)
125125

app/src/main/java/com/getcode/view/login/LoginHome.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ fun LoginHome(
138138
text = bottomString,
139139
style = CodeTheme.typography.caption.copy(
140140
textAlign = TextAlign.Center,
141-
color = BrandLight
141+
color = CodeTheme.colors.textSecondary
142142
),
143143
modifier = Modifier
144144
.constrainAs(toc) {

0 commit comments

Comments
 (0)