Jasmin Fajkic
10/27/2022, 9:42 AMJasmin Fajkic
10/27/2022, 9:42 AMOleksandr Balan
10/27/2022, 11:42 AMModifier.fillMaxWidth()
on the indicator? 🤔Jasmin Fajkic
10/27/2022, 11:44 AMOleksandr Balan
10/27/2022, 11:49 AMColumn {
SomeScrollableRowWithTabs()
Indicator(Modifier.fillMaxWidth())
}
Jasmin Fajkic
10/27/2022, 11:49 AMJasmin Fajkic
10/27/2022, 11:59 AMJasmin Fajkic
10/27/2022, 11:59 AMJasmin Fajkic
10/27/2022, 12:01 PMColumn(modifier = Modifier.background(Style.colors.appBackground).fillMaxWidth()) {
ScrollableTabRow(
selectedTabIndex = pagerState.currentPage,
containerColor = Style.colors.content,
edgePadding = 5.dp,
modifier = Modifier.height(50.dp).widthIn(min = 1000.dp),
divider = {},
indicator = {}
) {
val scope = rememberCoroutineScope()
state.tabs.forEachIndexed { index, tab ->
val isSelected = pagerState.currentPage == index
Tab(
selected = isSelected,
onClick = {
scope.launch {
pagerState.animateScrollToPage(index)
}
},
modifier = Modifier
.background(Style.colors.content)
.height(30.dp)
.clip(RoundedCornerShape(50))
.background(
if (isSelected) Style.colors.inputActive else Style.colors.content
),
text = {
Text(
text = tab.title,
style = Style.typography.bodyBold,
color = if (isSelected) Style.colors.textLink else Style.colors.textStandard,
)
})
}
}
HorizontalPager(
count = state.tabs.size,
state = pagerState
) { page ->
CommunityPage(
tab = state.tabs.elementAt(page),
actionManager = actionManager,
navigateToPostGalleryView = navigateToPostGalleryView,
openComments = openComments
)
}
}
LinearProgressIndicator(
modifier = Modifier.fillMaxWidth(),
trackColor = Style.colors.appBackground,
color = colorResource(
id = R.color.light_blue
),
progress = 0.5f
)
}
Oleksandr Balan
10/27/2022, 12:03 PMScrollableTabRow
and HorizontalPager
?Jasmin Fajkic
10/27/2022, 3:33 PM