Skip to content

Commit 772dc0a

Browse files
committed
refactor: reuse shared hw image size ratio
1 parent 3540624 commit 772dc0a

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

app/src/main/java/to/bitkit/ui/components/HwWalletComponents.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ import to.bitkit.R
1919
import to.bitkit.models.TransportType
2020
import to.bitkit.ui.theme.Colors
2121

22-
// Device illustration proportions, taken from the Figma hardware wallet frames.
23-
private const val HW_DEVICE_IMAGE_SIZE_RATIO = 256f / 375f
22+
/**
23+
* HwWalletComponents - Reusable components and utilities for the Hardware Wallet UI.
24+
* */
25+
26+
// Illustration proportions, taken from the Figma hardware wallet frames (256-wide Visual in a 375 frame).
27+
internal const val HW_DEVICE_IMAGE_SIZE_RATIO = 256f / 375f
2428
private const val HW_DEVICE_TREZOR_BLEED_RATIO = 84f / 375f
2529
private const val HW_DEVICE_LEDGER_BLEED_RATIO = 53f / 375f
2630
private const val HW_DEVICE_STAGGER_RATIO = 12f / 375f

app/src/main/java/to/bitkit/ui/sheets/hardware/HwPairedSheet.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import to.bitkit.ui.components.BodyM
2525
import to.bitkit.ui.components.BottomSheetPreview
2626
import to.bitkit.ui.components.Caption13Up
2727
import to.bitkit.ui.components.Display
28+
import to.bitkit.ui.components.HW_DEVICE_IMAGE_SIZE_RATIO
2829
import to.bitkit.ui.components.PrimaryButton
2930
import to.bitkit.ui.components.TextInput
3031
import to.bitkit.ui.components.VerticalSpacer
@@ -36,9 +37,7 @@ import to.bitkit.ui.theme.AppThemeSurface
3637
import to.bitkit.ui.theme.Colors
3738
import to.bitkit.ui.utils.withAccent
3839

39-
// Coin illustration proportions taken from the Figma "Hardware Funds Paired" frame (375 wide,
40-
// 256-wide bottom Visual) and the coin_stack_3 asset's intrinsic 756x926 size.
41-
private const val COINS_WIDTH_RATIO = 256f / 375f
40+
// Width reuses the shared 256-wide Figma Visual ratio; aspect is the coin_stack_3 asset's intrinsic 756x926.
4241
private const val COINS_ASPECT_RATIO = 756f / 926f
4342

4443
@Composable
@@ -111,7 +110,7 @@ private fun Content(
111110
contentDescription = null,
112111
modifier = Modifier
113112
.align(Alignment.BottomCenter)
114-
.width(maxWidth * COINS_WIDTH_RATIO)
113+
.width(maxWidth * HW_DEVICE_IMAGE_SIZE_RATIO)
115114
.aspectRatio(COINS_ASPECT_RATIO)
116115
)
117116
PrimaryButton(

0 commit comments

Comments
 (0)