mirror of
https://github.com/bitfireAT/davx5-ose
synced 2024-10-06 19:34:23 +00:00
Switched CalDAV and CardDAV tab positions (#769)
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
This commit is contained in:
parent
c9fd66bd63
commit
e40fa6e0fb
|
@ -216,12 +216,12 @@ fun AccountScreen(
|
|||
var nextIdx = -1
|
||||
|
||||
@Suppress("KotlinConstantConditions")
|
||||
val idxCardDav: Int? = if (hasCardDav) ++nextIdx else null
|
||||
val idxCalDav: Int? = if (hasCalDav) ++nextIdx else null
|
||||
val idxCardDav: Int? = if (hasCardDav) ++nextIdx else null
|
||||
val idxWebcal: Int? = if (hasWebcal) ++nextIdx else null
|
||||
val nrPages =
|
||||
(if (idxCardDav != null) 1 else 0) +
|
||||
(if (idxCalDav != null) 1 else 0) +
|
||||
(if (idxCalDav != null) 1 else 0) +
|
||||
(if (idxCardDav != null) 1 else 0) +
|
||||
(if (idxWebcal != null) 1 else 0)
|
||||
val pagerState = rememberPagerState(pageCount = { nrPages })
|
||||
|
||||
|
@ -298,21 +298,6 @@ fun AccountScreen(
|
|||
Column {
|
||||
if (nrPages > 0) {
|
||||
TabRow(selectedTabIndex = pagerState.currentPage) {
|
||||
if (idxCardDav != null)
|
||||
Tab(
|
||||
selected = pagerState.currentPage == idxCardDav,
|
||||
onClick = {
|
||||
scope.launch {
|
||||
pagerState.scrollToPage(idxCardDav)
|
||||
}
|
||||
}
|
||||
) {
|
||||
Text(
|
||||
stringResource(R.string.account_carddav),
|
||||
modifier = Modifier.padding(8.dp)
|
||||
)
|
||||
}
|
||||
|
||||
if (idxCalDav != null) {
|
||||
Tab(
|
||||
selected = pagerState.currentPage == idxCalDav,
|
||||
|
@ -329,6 +314,22 @@ fun AccountScreen(
|
|||
}
|
||||
}
|
||||
|
||||
if (idxCardDav != null) {
|
||||
Tab(
|
||||
selected = pagerState.currentPage == idxCardDav,
|
||||
onClick = {
|
||||
scope.launch {
|
||||
pagerState.scrollToPage(idxCardDav)
|
||||
}
|
||||
}
|
||||
) {
|
||||
Text(
|
||||
stringResource(R.string.account_carddav),
|
||||
modifier = Modifier.padding(8.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (idxWebcal != null) {
|
||||
Tab(
|
||||
selected = pagerState.currentPage == idxWebcal,
|
||||
|
|
Loading…
Reference in a new issue