Fix individual UI components

Change-Id: I7dec3672b9efc3524371811743b06efc1e113a36
pull/1220/head
Don Turner 10 months ago
parent 7dece22697
commit 08dfec01f6

@ -285,16 +285,6 @@ fun NiaOutlinedButtonPreview() {
}
}
@ThemePreviews
@Composable
fun NiaButtonPreview2() {
NiaTheme {
NiaBackground(modifier = Modifier.size(150.dp, 50.dp)) {
NiaButton(onClick = {}, text = { Text("Test button") })
}
}
}
@ThemePreviews
@Composable
fun NiaButtonLeadingIconPreview() {

@ -90,14 +90,15 @@ internal val NiaTypography = Typography(
lineHeight = 20.sp,
letterSpacing = 0.1.sp,
),
// Default text style
bodyLarge = TextStyle(
fontWeight = FontWeight.Normal,
fontSize = 16.sp,
lineHeight = 24.sp,
letterSpacing = 0.5.sp,
lineHeightStyle = LineHeightStyle(
alignment = Alignment.Bottom,
trim = Trim.Both,
alignment = Alignment.Center,
trim = Trim.None,
),
),
bodyMedium = TextStyle(
@ -112,30 +113,37 @@ internal val NiaTypography = Typography(
lineHeight = 16.sp,
letterSpacing = 0.4.sp,
),
// Used for Button
labelLarge = TextStyle(
fontWeight = FontWeight.Medium,
fontSize = 14.sp,
lineHeight = 20.sp,
letterSpacing = 0.1.sp,
lineHeightStyle = LineHeightStyle(
alignment = Alignment.Center,
trim = Trim.LastLineBottom,
),
),
// Used for Navigation items
labelMedium = TextStyle(
fontWeight = FontWeight.Medium,
fontSize = 12.sp,
lineHeight = 16.sp,
letterSpacing = 0.5.sp,
lineHeightStyle = LineHeightStyle(
alignment = Alignment.Bottom,
trim = Trim.None,
alignment = Alignment.Center,
trim = Trim.LastLineBottom,
),
),
// Used for Tag
labelSmall = TextStyle(
fontWeight = FontWeight.Medium,
fontSize = 10.sp,
lineHeight = 14.sp,
letterSpacing = 0.sp,
lineHeightStyle = LineHeightStyle(
alignment = Alignment.Bottom,
trim = Trim.Both,
alignment = Alignment.Center,
trim = Trim.LastLineBottom,
),
),
)

@ -83,27 +83,25 @@ class NavigationScreenshotTests() {
@Composable
private fun NiaNavigationBarExample(label: String = "Item") {
NiaTheme {
NiaNavigationBar {
(0..2).forEach { index ->
NiaNavigationBarItem(
icon = {
Icon(
imageVector = NiaIcons.UpcomingBorder,
contentDescription = "",
)
},
selectedIcon = {
Icon(
imageVector = NiaIcons.Upcoming,
contentDescription = "",
)
},
label = { Text(label) },
selected = index == 0,
onClick = { },
)
}
NiaNavigationBar {
(0..2).forEach { index ->
NiaNavigationBarItem(
icon = {
Icon(
imageVector = NiaIcons.UpcomingBorder,
contentDescription = "",
)
},
selectedIcon = {
Icon(
imageVector = NiaIcons.Upcoming,
contentDescription = "",
)
},
label = { Text(label) },
selected = index == 0,
onClick = { },
)
}
}
}

Loading…
Cancel
Save