Skip to content

Commit d17834e

Browse files
committed
docs: use kdoc for hw constants
1 parent a56d98e commit d17834e

5 files changed

Lines changed: 17 additions & 6 deletions

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,16 @@ import to.bitkit.ui.theme.Colors
2323
* HwWalletComponents - Reusable components and utilities for the Hardware Wallet UI.
2424
* */
2525

26-
// Illustration proportions, taken from the Figma hardware wallet frames (256-wide Visual in a 375 frame).
26+
/** Illustration width as a fraction of the sheet width — the 256-wide Visual in the 375-wide Figma frame. */
2727
internal const val HW_ILLUSTRATION_SIZE_RATIO = 256f / 375f
28+
29+
/** Trezor illustration left bleed past the frame, as a fraction of the sheet width (Figma device frames). */
2830
private const val HW_DEVICE_TREZOR_BLEED_RATIO = 84f / 375f
31+
32+
/** Ledger illustration right bleed past the frame, as a fraction of the sheet width (Figma device frames). */
2933
private const val HW_DEVICE_LEDGER_BLEED_RATIO = 53f / 375f
34+
35+
/** Vertical stagger between the two device illustrations, as a fraction of the sheet width. */
3036
private const val HW_DEVICE_STAGGER_RATIO = 12f / 375f
3137

3238
@Composable

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import to.bitkit.ui.shared.modifiers.sheetHeight
3737
import to.bitkit.ui.utils.composableWithDefaultTransitions
3838
import to.bitkit.viewmodels.AppViewModel
3939

40+
/** Runtime nearby-devices permissions needed to BLE-scan: SCAN + CONNECT on Android 12+, else fine location. */
4041
private val bluetoothPermissions: List<String>
4142
get() = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
4243
listOf(

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class HwConnectViewModel @Inject constructor(
3232
private val hwWalletRepo: HwWalletRepo,
3333
) : ViewModel() {
3434
companion object {
35+
/** Delay between scan attempts while searching for a nearby device. */
3536
private val SCAN_INTERVAL = 2.seconds
3637
}
3738

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import to.bitkit.ui.theme.AppThemeSurface
3737
import to.bitkit.ui.theme.Colors
3838
import to.bitkit.ui.utils.withAccent
3939

40-
// Width reuses the shared 256-wide Figma Visual ratio; aspect is the coin_stack_3 asset's intrinsic 756x926.
40+
/** Width reuses the shared 256-wide Figma Visual ratio; aspect is the coin_stack_3 asset's intrinsic 756x926. */
4141
private const val COINS_ASPECT_RATIO = 756f / 926f
4242

4343
@Composable

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,19 @@ import to.bitkit.ui.theme.AppThemeSurface
3737
import to.bitkit.ui.theme.Colors
3838
import to.bitkit.ui.utils.withAccent
3939

40+
/** Diameter of the loading visual (outer dashed ring). */
4041
private val ANIMATION_SIZE = 280.dp
4142

42-
// Relative sizes from the Figma "Loading Animation" HW frame (311 outer ring): arrows 256, inner ring 207.
43+
/** Arrows width as a fraction of the loader — 256 in the 311-wide Figma "Loading Animation" HW ring. */
4344
private const val ARROWS_SIZE_RATIO = 256f / 311f
45+
46+
/** Inner dashed-ring width as a fraction of the loader — 207 in the 311-wide Figma HW ring. */
4447
private const val INNER_RING_SIZE_RATIO = 207f / 311f
4548

46-
// Figma "Loading Animation" HW variants Smart-Animate linearly through their keyframes:
47-
// the arrows rotate 90° per 1s step (a counter-clockwise turn every 4s) while the two dashed
48-
// rings counter-rotate ~180° per 1s step (a turn every ~2s).
49+
/** Arrows rotation period: the Figma HW variants step 90° per 1s, a counter-clockwise turn every 4s. */
4950
private const val ARROWS_SPIN_MS = 4000
51+
52+
/** Dashed-ring rotation period: the two rings counter-rotate ~180° per 1s, a turn every ~2s. */
5053
private const val RING_SPIN_MS = 2000
5154

5255
@Composable

0 commit comments

Comments
 (0)