From 2373612f98a71e45061665911ed02d7d81323781 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 533df09b44..06493b3f0a 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 @@ -8,6 +8,7 @@ import androidx.compose.foundation.pager.rememberPagerState 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)