Fix individual UI components

Change-Id: I7dec3672b9efc3524371811743b06efc1e113a36
pull/1220/head
Don Turner 1 year 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 @ThemePreviews
@Composable @Composable
fun NiaButtonLeadingIconPreview() { fun NiaButtonLeadingIconPreview() {

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

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

Loading…
Cancel
Save