From f721c73a1523c1fcf27c6d151a700f480b9b07ff Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Thu, 13 Jun 2024 16:58:16 +1000 Subject: [PATCH] Theming the tab indicator according to designs --- .../thoughtcrime/securesms/ui/components/SessionTabRow.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/components/SessionTabRow.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/components/SessionTabRow.kt index 28446951b5..3d58b74fa4 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/components/SessionTabRow.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/components/SessionTabRow.kt @@ -9,6 +9,7 @@ import androidx.compose.material.MaterialTheme import androidx.compose.material.Tab import androidx.compose.material.TabRow import androidx.compose.material.TabRowDefaults +import androidx.compose.material.TabRowDefaults.tabIndicatorOffset import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.rememberCoroutineScope @@ -34,6 +35,13 @@ fun SessionTabRow(pagerState: PagerState, titles: List) { backgroundColor = Color.Unspecified, selectedTabIndex = pagerState.currentPage, contentColor = LocalColors.current.text, + indicator = { tabPositions -> + TabRowDefaults.Indicator( + Modifier.tabIndicatorOffset(tabPositions[pagerState.currentPage]), + color = LocalColors.current.primary, + height = 5.dp + ) + }, divider = { TabRowDefaults.Divider(color = LocalColors.current.divider) }, modifier = Modifier .height(48.dp)