From 727834d285182571da61cdad38df0f81114d29a8 Mon Sep 17 00:00:00 2001 From: sam muigai Date: Wed, 27 Sep 2023 09:18:21 +0300 Subject: [PATCH] Prevent word splitting in the tab section and use ellipsis for overflow --- .idea/kotlinc.xml | 6 ++++++ .../main/java/com/brandyodhiambo/quench/ui/MainScreen.kt | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .idea/kotlinc.xml diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 0000000..b1077fb --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/brandyodhiambo/quench/ui/MainScreen.kt b/app/src/main/java/com/brandyodhiambo/quench/ui/MainScreen.kt index 5c31d5d..f3af851 100644 --- a/app/src/main/java/com/brandyodhiambo/quench/ui/MainScreen.kt +++ b/app/src/main/java/com/brandyodhiambo/quench/ui/MainScreen.kt @@ -32,6 +32,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.brandyodhiambo.designsystem.theme.primaryColor @@ -135,7 +136,7 @@ fun CustomTab( pagerState.animateScrollToPage(index) } }, - text = { Text(text = tabItem.title, fontFamily = roboto) } + text = { Text(text = tabItem.title, maxLines = 1, overflow = TextOverflow.Ellipsis, fontFamily = roboto) } ) } }