Skip to content

Commit 059fd2c

Browse files
authored
Merge pull request #442 from synonymdev/bitkit-core-serializable
feat: bitkit-core serializable types
2 parents 9e58ac8 + 96f49e0 commit 059fd2c

File tree

7 files changed

+316
-480
lines changed

7 files changed

+316
-480
lines changed

app/src/main/java/to/bitkit/ui/components/settings/SectionHeader.kt

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,21 @@ package to.bitkit.ui.components.settings
22

33
import androidx.compose.foundation.layout.Arrangement
44
import androidx.compose.foundation.layout.Column
5+
import androidx.compose.foundation.layout.PaddingValues
6+
import androidx.compose.foundation.layout.WindowInsets
57
import androidx.compose.foundation.layout.fillMaxWidth
68
import androidx.compose.foundation.layout.height
79
import androidx.compose.foundation.layout.padding
10+
import androidx.compose.foundation.layout.safeContent
11+
import androidx.compose.material3.HorizontalDivider
812
import androidx.compose.runtime.Composable
913
import androidx.compose.ui.Modifier
1014
import androidx.compose.ui.graphics.Color
1115
import androidx.compose.ui.tooling.preview.Preview
16+
import androidx.compose.ui.unit.Dp
1217
import androidx.compose.ui.unit.dp
1318
import to.bitkit.ui.components.Caption13Up
19+
import to.bitkit.ui.shared.util.screen
1420
import to.bitkit.ui.theme.AppThemeSurface
1521
import to.bitkit.ui.theme.Colors
1622

@@ -19,22 +25,51 @@ fun SectionHeader(
1925
title: String,
2026
modifier: Modifier = Modifier,
2127
color: Color = Colors.White64,
28+
padding: PaddingValues = PaddingValues(top = 16.dp),
29+
height: Dp = 50.dp,
2230
) {
2331
Column(
2432
verticalArrangement = Arrangement.Center,
2533
modifier = modifier
2634
.fillMaxWidth()
27-
.padding(top = 16.dp)
28-
.height(50.dp)
35+
.padding(padding)
36+
.height(height)
2937
) {
3038
Caption13Up(text = title, color = color)
3139
}
3240
}
3341

34-
@Preview
42+
@Preview(showSystemUi = true)
3543
@Composable
3644
private fun Preview() {
3745
AppThemeSurface {
38-
SectionHeader("General")
46+
Column(
47+
modifier = Modifier
48+
.screen(insets = WindowInsets.safeContent)
49+
) {
50+
SectionHeader("Default")
51+
HorizontalDivider()
52+
SectionHeader(
53+
title = "Colors.Brand",
54+
color = Colors.Brand,
55+
)
56+
HorizontalDivider()
57+
SectionHeader(
58+
title = "Dp.Unspecified",
59+
height = Dp.Unspecified,
60+
)
61+
HorizontalDivider()
62+
SectionHeader(
63+
title = "PaddingValues.Zero",
64+
padding = PaddingValues.Zero,
65+
)
66+
HorizontalDivider()
67+
SectionHeader(
68+
title = "PaddingValues.Zero + Dp.Unspecified",
69+
padding = PaddingValues.Zero,
70+
height = Dp.Unspecified,
71+
)
72+
HorizontalDivider()
73+
}
3974
}
4075
}

0 commit comments

Comments
 (0)