Updated on 2026-08-14

This commit is contained in:
Tangem 2022-12-07 14:56:00 +03:00
parent b5f6af970b
commit 141c7d3936
14 changed files with 66 additions and 64 deletions

View file

@ -173,7 +173,7 @@ private fun PrimaryButtonRow(
.fillMaxWidth()
.height(dimensionResource(R.dimen.size48)),
enabled = enabled,
shape = RoundedCornerShape(dimensionResource(id = R.dimen.radius12)),
shape = RoundedCornerShape(TangemTheme.dimens.radius12),
colors = ButtonDefaults.buttonColors(
backgroundColor = MaterialTheme.colors.buttonColor(type = ButtonColorType.PRIMARY),
contentColor = MaterialTheme.colors.textColor(type = TextColorType.PRIMARY2),

View file

@ -47,17 +47,17 @@ fun Preview_SimpleInfoCard_InDarkTheme() {
@Composable
fun SmallInfoCard(startText: String, endText: String) {
Surface(
shape = RoundedCornerShape(dimensionResource(id = R.dimen.radius12)),
shape = RoundedCornerShape(TangemTheme.dimens.radius12),
color = MaterialTheme.colors.secondary,
elevation = dimensionResource(id = R.dimen.elevation2),
elevation = TangemTheme.dimens.elevation2,
) {
Row(
modifier = Modifier
.fillMaxWidth()
.height(dimensionResource(R.dimen.size48))
.height(TangemTheme.dimens.size48)
.padding(
horizontal = dimensionResource(id = R.dimen.spacing16),
vertical = dimensionResource(id = R.dimen.spacing12),
horizontal = TangemTheme.dimens.spacing16,
vertical = TangemTheme.dimens.spacing12,
),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically

View file

@ -41,15 +41,15 @@ fun AppBarWithAdditionalButtons(
Box(
modifier = Modifier
.fillMaxWidth()
.height(dimensionResource(id = R.dimen.size56))
.padding(all = dimensionResource(id = R.dimen.spacing16)),
.height(TangemTheme.dimens.size56)
.padding(all = TangemTheme.dimens.spacing16),
) {
if (startButton != null) {
IconButton(modifier = Modifier.align(Alignment.CenterStart), onClick = startButton.onIconClicked) {
Icon(
painter = painterResource(id = startButton.iconRes),
contentDescription = null,
modifier = Modifier.size(dimensionResource(id = R.dimen.size24)),
modifier = Modifier.size(TangemTheme.dimens.size24),
tint = MaterialTheme.colors.iconColor(type = IconColorType.PRIMARY1),
)
}
@ -68,7 +68,7 @@ fun AppBarWithAdditionalButtons(
Icon(
painter = painterResource(id = endButton.iconRes),
contentDescription = null,
modifier = Modifier.size(dimensionResource(id = R.dimen.size24)),
modifier = Modifier.size(TangemTheme.dimens.size24),
tint = MaterialTheme.colors.iconColor(type = IconColorType.PRIMARY1),
)
}

View file

@ -29,16 +29,16 @@ fun BottomSheetIndicator() {
Box(
modifier = Modifier
.fillMaxWidth()
.height(dimensionResource(id = R.dimen.size20)),
.height(TangemTheme.dimens.size20),
contentAlignment = Alignment.Center,
) {
Box(
modifier = Modifier
.width(dimensionResource(id = R.dimen.size32))
.height(dimensionResource(id = R.dimen.size4))
.width(TangemTheme.dimens.size32)
.height(TangemTheme.dimens.size4)
.background(
color = MaterialTheme.colors.iconColor(type = IconColorType.INACTIVE),
shape = RoundedCornerShape(dimensionResource(id = R.dimen.radius2)),
shape = RoundedCornerShape(TangemTheme.dimens.radius2),
),
)
}

View file

@ -22,6 +22,7 @@ data class TangemDimens internal constructor(
val radius2: Dp = 2.dp,
val radius4: Dp = 4.dp,
val radius6: Dp = 6.dp,
val radius8: Dp = 8.dp,
val radius12: Dp = 12.dp,
val radius16: Dp = 16.dp,
val radius28: Dp = 28.dp,
@ -51,11 +52,13 @@ data class TangemDimens internal constructor(
val spacing8: Dp = 8.dp,
val spacing10: Dp = 10.dp,
val spacing12: Dp = 12.dp,
val spacing14: Dp = 14.dp,
val spacing16: Dp = 16.dp,
val spacing24: Dp = 24.dp,
val spacing32: Dp = 32.dp,
val spacing44: Dp = 44.dp,
val spacing50: Dp = 50.dp,
val spacing54: Dp = 54.dp,
val spacing56: Dp = 56.dp,
// endregion Spacing
)