mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Theming the tab indicator according to designs
This commit is contained in:
parent
bd679b0889
commit
2373612f98
@ -8,6 +8,7 @@ import androidx.compose.foundation.pager.rememberPagerState
|
|||||||
import androidx.compose.material.Tab
|
import androidx.compose.material.Tab
|
||||||
import androidx.compose.material.TabRow
|
import androidx.compose.material.TabRow
|
||||||
import androidx.compose.material.TabRowDefaults
|
import androidx.compose.material.TabRowDefaults
|
||||||
|
import androidx.compose.material.TabRowDefaults.tabIndicatorOffset
|
||||||
import androidx.compose.material.Text
|
import androidx.compose.material.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.rememberCoroutineScope
|
import androidx.compose.runtime.rememberCoroutineScope
|
||||||
@ -34,6 +35,13 @@ fun SessionTabRow(pagerState: PagerState, titles: List<Int>) {
|
|||||||
backgroundColor = Color.Unspecified,
|
backgroundColor = Color.Unspecified,
|
||||||
selectedTabIndex = pagerState.currentPage,
|
selectedTabIndex = pagerState.currentPage,
|
||||||
contentColor = LocalColors.current.text,
|
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) },
|
divider = { TabRowDefaults.Divider(color = LocalColors.current.divider) },
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.height(48.dp)
|
.height(48.dp)
|
||||||
|
Loading…
Reference in New Issue
Block a user