From 774a99bbf2a23944de4fdfeb126c730f7e8bba06 Mon Sep 17 00:00:00 2001 From: Raja Jawahar Date: Wed, 10 Jan 2024 12:04:07 +0530 Subject: [PATCH 1/8] TUIFloatingNavigationButton created --- .../uicomponents/components/TUITextRow.kt | 2 +- .../components/tab/TUIFloatingNavButton.kt | 115 ++++++++++++++++++ 2 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt diff --git a/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/TUITextRow.kt b/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/TUITextRow.kt index 9b41c504..231db87e 100644 --- a/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/TUITextRow.kt +++ b/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/TUITextRow.kt @@ -68,7 +68,7 @@ import com.tarkalabs.uicomponents.theme.TUITheme @Composable fun TUITextRow( title: String, style: TextRowStyle = Title, - modifier: Modifier = Modifier.fillMaxWidth(), + modifier: Modifier = Modifier, iconOne: TarkaIcon? = null, iconTwo: TarkaIcon? = null, buttonTitle: String? = null, diff --git a/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt b/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt new file mode 100644 index 00000000..070851a3 --- /dev/null +++ b/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt @@ -0,0 +1,115 @@ +package com.tarkalabs.uicomponents.components.tab + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.wrapContentSize +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Icon +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.tarkalabs.tarkaicons.ChevronDown24 +import com.tarkalabs.tarkaicons.Diversity24 +import com.tarkalabs.tarkaicons.TarkaIcon +import com.tarkalabs.tarkaicons.TarkaIcons +import com.tarkalabs.uicomponents.components.VerticalSpacer +import com.tarkalabs.uicomponents.components.tab.TUIFloatingNavButtonStyle.BURGER +import com.tarkalabs.uicomponents.components.tab.TUIFloatingNavButtonStyle.NAVIGATION +import com.tarkalabs.uicomponents.extentions.clickableWithoutRipple +import com.tarkalabs.uicomponents.theme.TUITheme + +enum class TUIFloatingNavButtonStyle { + NAVIGATION, + LIST, + BURGER; + + companion object { + val defaultStyle: TUIFloatingNavButtonStyle = NAVIGATION + } +} + +sealed class TUIFloatingNavButtonContentType { + data class List( + val iconOne: TarkaIcon, + val onIconOneClick: (() -> Unit)? = null, + val iconTwo: TarkaIcon, + val onIconTwoClick: (() -> Unit)? = null, + val iconThree: TarkaIcon, + val onIconFourClick: (() -> Unit)? = null + ) : TUIFloatingNavButtonContentType() + + data class Navigation(val text: String) : TUIFloatingNavButtonContentType() + object Burger : TUIFloatingNavButtonContentType() +} + +@Composable fun TUIFloatingNavButton( + modifier: Modifier = Modifier, + style: TUIFloatingNavButtonStyle = TUIFloatingNavButtonStyle.defaultStyle, + leadingIcon: TarkaIcon? = null, + title: String, + onClicked: () -> Unit +) { + + Row(modifier a w2 = modifier + .wrapContentSize() + .clickableWithoutRipple { + if (style == NAVIGATION || style == BURGER) onClicked() + } + .background(shape = RoundedCornerShape(32.dp), color = TUITheme.colors.primaryAltHover) + .testTag("")) { + + Row( + modifier = Modifier.padding(horizontal = 16.dp, vertical = 16.dp), + verticalAlignment = Alignment.CenterVertically + ) { + + if (leadingIcon != null) Icon( + painter = painterResource(id = leadingIcon.iconRes), + contentDescription = leadingIcon.contentDescription, + tint = TUITheme.colors.primary, + ) + + Text( + modifier = Modifier.padding(horizontal = 8.dp), + text = title, + style = TUITheme.typography.heading6, + color = TUITheme.colors.primary + ) + Icon( + painter = painterResource(id = TarkaIcons.Filled.ChevronDown24.iconRes), + contentDescription = TarkaIcons.Filled.ChevronDown24.contentDescription, + tint = TUITheme.colors.primary, + ) + + } + + } +} + +@Preview @Composable fun TUIFloatingNavButtonPreview() { + TUITheme { + + var currentTabItem by remember { + mutableStateOf(0) + } + + Column(modifier = Modifier.wrapContentSize(Alignment.Center)) { + VerticalSpacer(space = 40) + TUIFloatingNavButton(leadingIcon = TarkaIcons.Filled.Diversity24, title = "Overview") { + + } + VerticalSpacer(space = 40) + } + } +} \ No newline at end of file From 4ac620a3b8550a0f8b99aae2a648667a8985e971 Mon Sep 17 00:00:00 2001 From: Megna Date: Tue, 23 Jan 2024 16:03:40 +0530 Subject: [PATCH 2/8] Changed bg color for floatingNavBar --- .../tarkalabs/uicomponents/components/tab/TUIFloatingNavBar.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavBar.kt b/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavBar.kt index 731d6a88..f54196c3 100644 --- a/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavBar.kt +++ b/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavBar.kt @@ -44,7 +44,7 @@ import com.tarkalabs.uicomponents.theme.TUITheme horizontalArrangement = Arrangement.SpaceAround, modifier = modifier .horizontalScroll(rememberScrollState()) - .background(color = TUITheme.colors.onPrimary, shape = RoundedCornerShape(32.dp)) + .background(color = TUITheme.colors.primaryAltHover, shape = RoundedCornerShape(32.dp)) .border( width = 1.dp, color = TUITheme.colors.primaryAltHover, From abe04bb1d72da6cf2c541dd2bdce0dc1e3aa196f Mon Sep 17 00:00:00 2001 From: Megna Date: Tue, 23 Jan 2024 16:04:14 +0530 Subject: [PATCH 3/8] Removed unwanted args. --- .../java/com/tarkalabs/uicomponents/TUISearchBarTest.kt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tarkaui/src/androidTest/java/com/tarkalabs/uicomponents/TUISearchBarTest.kt b/tarkaui/src/androidTest/java/com/tarkalabs/uicomponents/TUISearchBarTest.kt index 056a2b69..0044cc44 100644 --- a/tarkaui/src/androidTest/java/com/tarkalabs/uicomponents/TUISearchBarTest.kt +++ b/tarkaui/src/androidTest/java/com/tarkalabs/uicomponents/TUISearchBarTest.kt @@ -37,7 +37,6 @@ class TUISearchBarTest { searchBarTags = searchBarTags, trailingIcon = TarkaIcons.Regular.Dismiss24, leadingIcon = TarkaIcons.Regular.Search24, - showKeyboard = false ) } composable.onNodeWithTag(searchBarTags.parentTag).assertIsDisplayed() @@ -54,7 +53,6 @@ class TUISearchBarTest { onLeadingIconClick = {}, searchBarTags = searchBarTags, trailingIcon = TarkaIcons.Regular.Dismiss24, - showKeyboard = false ) } composable.onNodeWithTag(trailingIconTags.parentTag, useUnmergedTree = true).assertIsDisplayed() @@ -72,7 +70,6 @@ class TUISearchBarTest { searchBarTags = searchBarTags, trailingIcon = TarkaIcons.Regular.Dismiss24, leadingIcon = TarkaIcons.Regular.Search24, - showKeyboard = false ) } composable.onNodeWithTag(leadingIconTags.parentTag, useUnmergedTree = true) @@ -89,7 +86,6 @@ class TUISearchBarTest { onLeadingIconClick = {}, searchBarTags = searchBarTags, trailingIcon = TarkaIcons.Regular.Dismiss24, - showKeyboard = false ) } composable.onNodeWithTag(trailingIconTags.parentTag, useUnmergedTree = true) From e7939e899a1febeb5ba1f9a51c15251e51b2bf2d Mon Sep 17 00:00:00 2001 From: Megna Date: Tue, 23 Jan 2024 16:04:38 +0530 Subject: [PATCH 4/8] Changed text style. --- .../com/tarkalabs/uicomponents/components/tab/TUIFloatingTab.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingTab.kt b/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingTab.kt index 68fe97ac..a9760044 100644 --- a/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingTab.kt +++ b/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingTab.kt @@ -64,7 +64,7 @@ import com.tarkalabs.uicomponents.theme.TUITheme Text( modifier = Modifier.padding(16.dp), text = title, - style = TUITheme.typography.body6, + style = TUITheme.typography.heading6, color = if (selected) TUITheme.colors.onPrimary else TUITheme.colors.primary ) } From 3d3d00e8480e7500beae7b751392b6bb46b60dd1 Mon Sep 17 00:00:00 2001 From: Megna Date: Tue, 23 Jan 2024 16:11:11 +0530 Subject: [PATCH 5/8] Floating Navigation button component. --- .../components/tab/TUIFloatingNavButton.kt | 203 ++++++++++++++---- 1 file changed, 162 insertions(+), 41 deletions(-) diff --git a/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt b/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt index 070851a3..fa5c8faa 100644 --- a/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt +++ b/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt @@ -9,28 +9,34 @@ import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember -import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.painterResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import com.tarkalabs.tarkaicons.CalendarRtl24 import com.tarkalabs.tarkaicons.ChevronDown24 +import com.tarkalabs.tarkaicons.Directions24 import com.tarkalabs.tarkaicons.Diversity24 +import com.tarkalabs.tarkaicons.Map24 +import com.tarkalabs.tarkaicons.Navigation24 import com.tarkalabs.tarkaicons.TarkaIcon import com.tarkalabs.tarkaicons.TarkaIcons import com.tarkalabs.uicomponents.components.VerticalSpacer +import com.tarkalabs.uicomponents.components.tab.TUIFloatingNavButtonContentType.Burger +import com.tarkalabs.uicomponents.components.tab.TUIFloatingNavButtonContentType.List +import com.tarkalabs.uicomponents.components.tab.TUIFloatingNavButtonContentType.Navigation import com.tarkalabs.uicomponents.components.tab.TUIFloatingNavButtonStyle.BURGER +import com.tarkalabs.uicomponents.components.tab.TUIFloatingNavButtonStyle.LIST import com.tarkalabs.uicomponents.components.tab.TUIFloatingNavButtonStyle.NAVIGATION +import com.tarkalabs.uicomponents.components.tab.TUIFloatingNavButtonStyle.VIEW_TOGGLE import com.tarkalabs.uicomponents.extentions.clickableWithoutRipple import com.tarkalabs.uicomponents.theme.TUITheme enum class TUIFloatingNavButtonStyle { NAVIGATION, + VIEW_TOGGLE, LIST, BURGER; @@ -41,75 +47,190 @@ enum class TUIFloatingNavButtonStyle { sealed class TUIFloatingNavButtonContentType { data class List( - val iconOne: TarkaIcon, + val iconOne: TarkaIcon? = null, val onIconOneClick: (() -> Unit)? = null, - val iconTwo: TarkaIcon, + val iconTwo: TarkaIcon? = null, val onIconTwoClick: (() -> Unit)? = null, - val iconThree: TarkaIcon, - val onIconFourClick: (() -> Unit)? = null + val iconThree: TarkaIcon? = null, + val onIconThreeClick: (() -> Unit)? = null + ) : TUIFloatingNavButtonContentType() + + data class Navigation( + val leadingIcon: TarkaIcon? = null, + val text: String, ) : TUIFloatingNavButtonContentType() - data class Navigation(val text: String) : TUIFloatingNavButtonContentType() object Burger : TUIFloatingNavButtonContentType() } @Composable fun TUIFloatingNavButton( modifier: Modifier = Modifier, style: TUIFloatingNavButtonStyle = TUIFloatingNavButtonStyle.defaultStyle, - leadingIcon: TarkaIcon? = null, - title: String, - onClicked: () -> Unit + contentType: TUIFloatingNavButtonContentType, + onClicked: (() -> Unit)? = null, + tags: TUIFloatingNavButtonTags = TUIFloatingNavButtonTags() ) { - - Row(modifier a w2 = modifier + Row(modifier = modifier .wrapContentSize() .clickableWithoutRipple { - if (style == NAVIGATION || style == BURGER) onClicked() + if (style != LIST && onClicked != null) { + onClicked() + } } .background(shape = RoundedCornerShape(32.dp), color = TUITheme.colors.primaryAltHover) - .testTag("")) { + .testTag(tags.parentTag)) { - Row( - modifier = Modifier.padding(horizontal = 16.dp, vertical = 16.dp), - verticalAlignment = Alignment.CenterVertically - ) { + when (contentType) { + is Burger -> { + TUIFloatingNavBurgerButton() + } - if (leadingIcon != null) Icon( - painter = painterResource(id = leadingIcon.iconRes), - contentDescription = leadingIcon.contentDescription, - tint = TUITheme.colors.primary, - ) + is Navigation -> { + TUIFloatingNavTypeButton(contentType, style) + } - Text( - modifier = Modifier.padding(horizontal = 8.dp), - text = title, - style = TUITheme.typography.heading6, - color = TUITheme.colors.primary - ) + is List -> { + TUIFloatingNavListButton(contentType) + } + } + } +} + +@Composable +private fun TUIFloatingNavTypeButton( + contentType: Navigation, + style: TUIFloatingNavButtonStyle, + tags: TUIFloatingNavButtonTags = TUIFloatingNavButtonTags(), +) { + Row( + modifier = Modifier.padding(horizontal = 16.dp, vertical = 16.dp), + verticalAlignment = Alignment.CenterVertically + ) { + + if (contentType.leadingIcon != null) Icon( + modifier = Modifier.testTag(tags.leadingIconTag), + painter = painterResource(id = contentType.leadingIcon.iconRes), + contentDescription = contentType.leadingIcon.contentDescription, + tint = TUITheme.colors.primary, + ) + + Text( + modifier = Modifier.padding(horizontal = 8.dp), + text = contentType.text, + style = TUITheme.typography.heading6, + color = TUITheme.colors.primary + ) + + if (style == NAVIGATION) { Icon( + modifier = Modifier.testTag(tags.trailingIconTag), painter = painterResource(id = TarkaIcons.Filled.ChevronDown24.iconRes), contentDescription = TarkaIcons.Filled.ChevronDown24.contentDescription, tint = TUITheme.colors.primary, ) - } + } +} +@Composable fun TUIFloatingNavListButton( + contentType: List, + tags: TUIFloatingNavButtonTags = TUIFloatingNavButtonTags(), +) { + Row( + modifier = Modifier + .padding(horizontal = 4.dp, vertical = 4.dp), + verticalAlignment = Alignment.CenterVertically + ) { + if (contentType.iconOne != null) { + Icon( + modifier = Modifier + .padding(12.dp) + .clickableWithoutRipple { + if (contentType.onIconOneClick != null) { + contentType.onIconOneClick.invoke() + } + } + .testTag(tags.iconOneTag), + painter = painterResource(id = contentType.iconOne.iconRes), + contentDescription = contentType.iconOne.contentDescription, + tint = TUITheme.colors.primary + ) + } + if (contentType.iconTwo != null) { + Icon( + modifier = Modifier + .padding(12.dp) + .clickableWithoutRipple { + if (contentType.onIconTwoClick != null) { + contentType.onIconTwoClick.invoke() + } + } + .testTag(tags.iconTwoTag), + painter = painterResource(id = contentType.iconTwo.iconRes), + contentDescription = contentType.iconTwo.contentDescription, + tint = TUITheme.colors.primary, + ) + } + if (contentType.iconThree != null) { + Icon( + modifier = Modifier + .padding(12.dp) + .clickableWithoutRipple { + if (contentType.onIconThreeClick != null) { + contentType.onIconThreeClick.invoke() + } + } + .testTag(tags.iconThreeTag), + painter = painterResource(id = contentType.iconThree.iconRes), + contentDescription = contentType.iconThree.contentDescription, + tint = TUITheme.colors.primary + ) + } } } -@Preview @Composable fun TUIFloatingNavButtonPreview() { - TUITheme { +@Composable fun TUIFloatingNavBurgerButton() { + Icon( + modifier = Modifier.padding(12.dp), + painter = painterResource(id = TarkaIcons.Filled.Navigation24.iconRes), + contentDescription = TarkaIcons.Filled.Navigation24.contentDescription, + tint = TUITheme.colors.primary + ) +} - var currentTabItem by remember { - mutableStateOf(0) - } - Column(modifier = Modifier.wrapContentSize(Alignment.Center)) { - VerticalSpacer(space = 40) - TUIFloatingNavButton(leadingIcon = TarkaIcons.Filled.Diversity24, title = "Overview") { +data class TUIFloatingNavButtonTags( + val parentTag: String = "TUIFloatingNavButton", + val leadingIconTag: String = "TUIFloatingNavButton_LeadingIcon", + val trailingIconTag: String = "TUIFloatingNavButton_TrailingIcon", + val iconOneTag: String = "TUIFloatingNavButton_Icon_One", + val iconTwoTag: String = "TUIFloatingNavButton_Icon_Two", + val iconThreeTag: String = "TUIFloatingNavButton_Icon_Three", +) - } +@Preview @Composable fun TUIFloatingNavButtonPreview() { + TUITheme { + Column( + horizontalAlignment = Alignment.CenterHorizontally + ) { + VerticalSpacer(space = 40) + TUIFloatingNavButton( + contentType = Navigation(leadingIcon = TarkaIcons.Filled.Diversity24, "Overview"), + ) + VerticalSpacer(space = 40) + TUIFloatingNavButton( + contentType = List( + iconOne = TarkaIcons.Regular.CalendarRtl24, iconTwo = TarkaIcons.Regular.Map24, + iconThree = TarkaIcons.Regular.Directions24 + ), style = LIST + ) + VerticalSpacer(space = 40) + TUIFloatingNavButton( + contentType = Navigation(leadingIcon = TarkaIcons.Filled.Diversity24, "Overview"), + style = VIEW_TOGGLE + ) VerticalSpacer(space = 40) + TUIFloatingNavButton(contentType = Burger, style = BURGER) } } } \ No newline at end of file From 348a473b37d4519baa2aa45f2343819be75cf8c5 Mon Sep 17 00:00:00 2001 From: Megna Date: Wed, 24 Jan 2024 11:44:44 +0530 Subject: [PATCH 6/8] TUIFloatingNavButton documentation added --- .../components/tab/TUIFloatingNavButton.kt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt b/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt index fa5c8faa..59cf2c2c 100644 --- a/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt +++ b/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt @@ -63,18 +63,25 @@ sealed class TUIFloatingNavButtonContentType { object Burger : TUIFloatingNavButtonContentType() } +/** + * TUIFloatingNavButton is a reusable compose function which can be used to create floating navigation button of different styles. + * @param modifier The modifier to be applied to this button. + * @param style The style of the button. Default being [TUIFloatingNavButtonStyle.defaultStyle] + * @param contentType The type of content to be displayed in the button. + * @param onClick The callback function to be invoked when the button is clicked. + * @param tags The tags to be applied to the button for testing.**/ @Composable fun TUIFloatingNavButton( modifier: Modifier = Modifier, style: TUIFloatingNavButtonStyle = TUIFloatingNavButtonStyle.defaultStyle, contentType: TUIFloatingNavButtonContentType, - onClicked: (() -> Unit)? = null, + onClick: (() -> Unit)? = null, tags: TUIFloatingNavButtonTags = TUIFloatingNavButtonTags() ) { Row(modifier = modifier .wrapContentSize() .clickableWithoutRipple { - if (style != LIST && onClicked != null) { - onClicked() + if (style != LIST && onClick != null) { + onClick() } } .background(shape = RoundedCornerShape(32.dp), color = TUITheme.colors.primaryAltHover) From 4ce7ba5ba1d385d7c996772baf21cf8c82f8392a Mon Sep 17 00:00:00 2001 From: Megna Date: Wed, 24 Jan 2024 12:25:46 +0530 Subject: [PATCH 7/8] opacity added for floating nav button bg color --- .../uicomponents/components/tab/TUIFloatingNavButton.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt b/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt index 59cf2c2c..0b684582 100644 --- a/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt +++ b/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt @@ -84,7 +84,7 @@ sealed class TUIFloatingNavButtonContentType { onClick() } } - .background(shape = RoundedCornerShape(32.dp), color = TUITheme.colors.primaryAltHover) + .background(shape = RoundedCornerShape(32.dp), color = TUITheme.colors.primaryAltHover.copy(alpha = 0.3f)) .testTag(tags.parentTag)) { when (contentType) { @@ -215,7 +215,7 @@ data class TUIFloatingNavButtonTags( val iconThreeTag: String = "TUIFloatingNavButton_Icon_Three", ) -@Preview @Composable fun TUIFloatingNavButtonPreview() { +@Preview(showBackground = true, showSystemUi = true) @Composable fun TUIFloatingNavButtonPreview() { TUITheme { Column( horizontalAlignment = Alignment.CenterHorizontally From 17535fdb17e153431c6037f5b807c0987a11fe6c Mon Sep 17 00:00:00 2001 From: Raja Jawahar Date: Wed, 24 Jan 2024 16:33:39 +0530 Subject: [PATCH 8/8] Update tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt Co-authored-by: Younes Charfaoui --- .../components/tab/TUIFloatingNavButton.kt | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt b/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt index 0b684582..fe7a6aa0 100644 --- a/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt +++ b/tarkaui/src/main/java/com/tarkalabs/uicomponents/components/tab/TUIFloatingNavButton.kt @@ -88,17 +88,9 @@ sealed class TUIFloatingNavButtonContentType { .testTag(tags.parentTag)) { when (contentType) { - is Burger -> { - TUIFloatingNavBurgerButton() - } - - is Navigation -> { - TUIFloatingNavTypeButton(contentType, style) - } - - is List -> { - TUIFloatingNavListButton(contentType) - } + is Burger -> TUIFloatingNavBurgerButton() + is Navigation -> TUIFloatingNavTypeButton(contentType, style) + is List -> TUIFloatingNavListButton(contentType) } } }