Skip to content

Commit

Permalink
Merge branch 'main-ose' into 728-accountsettingsactivity-make-canacce…
Browse files Browse the repository at this point in the history
…sswifissid-live-capable
  • Loading branch information
ArnyminerZ authored May 3, 2024
2 parents 3d6254c + 39f8f2e commit e7ec996
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 24 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/qualified-bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Qualified Bug Report
description: "[Developers only] For qualified bug reports. (Use Discussions if unsure.)"
labels: ["bug"]
body:
- type: checkboxes
attributes:
label: Problem scope
description: Use Discussions if you're unsure which component (DAVx⁵, calendar app, server, …) causes your problem.
options:
- label: I'm sure that this is a DAVx⁵ problem.
required: true
- type: checkboxes
attributes:
label: App version
options:
- label: I'm using the latest available DAVx⁵ version.
required: true
- type: input
attributes:
label: Android version and device/firmware type
placeholder: "Android 13 (Samsung A32)"
- type: textarea
attributes:
label: Steps to reproduce
description: Provide detailed steps to reproduce the problem.
placeholder: |
1. Create DAVx⁵ account with Some Server (Version).
2. Sync Some Calendar.
3. SomeException appears.
- type: textarea
attributes:
label: Expected result
description: Describe what you would expect DAVx⁵ to avoid/solve the problem.
placeholder: "Some Property in source file should be ignored even if faulty and sync should continue instead of showing an error."
- type: textarea
attributes:
label: Further info
description: Debug info, links to further information, …
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/qualified-feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Qualified Feature Request
description: "[Developers only] For qualified feature requests. (Use Discussions if unsure.)"
labels: ["feature"]
body:
- type: checkboxes
attributes:
label: Scope
description: Use this form only for features that have been discussed in Discussions or if you're a DAVx5 developer.
options:
- label: I'm sure that this feature request belongs here and not into Discussions.
required: true
- type: textarea
attributes:
label: Description
description: Describe the requested feature and why it is desired.
- type: textarea
attributes:
label: Further info
description: How this could be implemented, links to further information, …
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import at.bitfire.dav4jvm.exception.DavException
import at.bitfire.dav4jvm.exception.HttpException
import at.bitfire.davdroid.db.Credentials
import at.bitfire.davdroid.ui.setup.LoginInfo
import at.bitfire.vcard4android.GroupMethod
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runInterruptible
import kotlinx.coroutines.withContext
Expand Down Expand Up @@ -107,7 +108,8 @@ class NextcloudLoginFlow(
credentials = Credentials(
username = json.getString("loginName"),
password = json.getString("appPassword")
)
),
suggestedGroupMethod = GroupMethod.CATEGORIES
)
}

Expand Down
23 changes: 12 additions & 11 deletions app/src/main/kotlin/at/bitfire/davdroid/ui/account/AccountScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 })

Expand Down Expand Up @@ -298,32 +298,33 @@ fun AccountScreen(
Column {
if (nrPages > 0) {
TabRow(selectedTabIndex = pagerState.currentPage) {
if (idxCardDav != null)
if (idxCalDav != null) {
Tab(
selected = pagerState.currentPage == idxCardDav,
selected = pagerState.currentPage == idxCalDav,
onClick = {
scope.launch {
pagerState.scrollToPage(idxCardDav)
pagerState.scrollToPage(idxCalDav)
}
}
) {
Text(
stringResource(R.string.account_carddav),
stringResource(R.string.account_caldav),
modifier = Modifier.padding(8.dp)
)
}
}

if (idxCalDav != null) {
if (idxCardDav != null) {
Tab(
selected = pagerState.currentPage == idxCalDav,
selected = pagerState.currentPage == idxCardDav,
onClick = {
scope.launch {
pagerState.scrollToPage(idxCalDav)
pagerState.scrollToPage(idxCardDav)
}
}
) {
Text(
stringResource(R.string.account_caldav),
stringResource(R.string.account_carddav),
modifier = Modifier.padding(8.dp)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.Checkbox
import androidx.compose.material.MaterialTheme
import androidx.compose.material.OutlinedButton
import androidx.compose.material.Text
import androidx.compose.material3.Checkbox
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
Expand Down Expand Up @@ -126,7 +126,7 @@ class OpenSourcePage : IntroPage {
)
Text(
text = stringResource(R.string.intro_open_source_dont_show),
style = MaterialTheme.typography.body2,
style = MaterialTheme.typography.bodyMedium,
modifier = Modifier
.clickable { onChangeDontShow(!dontShow) }
.weight(1f)
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/kotlin/at/bitfire/davdroid/ui/intro/WelcomePage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand Down Expand Up @@ -69,7 +69,7 @@ class WelcomePage: IntroPage {
Text(
text = stringResource(R.string.intro_slogan1),
color = Color.White,
style = MaterialTheme.typography.subtitle1.copy(fontSize = 34.sp),
style = MaterialTheme.typography.bodyMedium.copy(fontSize = 34.sp),
lineHeight = 38.sp,
textAlign = TextAlign.Center,
modifier = Modifier
Expand All @@ -81,7 +81,7 @@ class WelcomePage: IntroPage {
Text(
text = stringResource(R.string.intro_slogan2),
color = Color.White,
style = MaterialTheme.typography.h5.copy(fontSize = 48.sp),
style = MaterialTheme.typography.labelLarge.copy(fontSize = 48.sp),
lineHeight = 52.sp,
textAlign = TextAlign.Center,
modifier = Modifier
Expand Down Expand Up @@ -132,7 +132,7 @@ class WelcomePage: IntroPage {
Text(
text = stringResource(R.string.intro_slogan1),
color = Color.White,
style = MaterialTheme.typography.subtitle1.copy(fontSize = 34.sp),
style = MaterialTheme.typography.bodyMedium.copy(fontSize = 34.sp),
lineHeight = 38.sp,
textAlign = TextAlign.Center,
modifier = Modifier.fillMaxWidth()
Expand All @@ -141,7 +141,7 @@ class WelcomePage: IntroPage {
Text(
text = stringResource(R.string.intro_slogan2),
color = Color.White,
style = MaterialTheme.typography.h5.copy(fontSize = 48.sp),
style = MaterialTheme.typography.labelLarge.copy(fontSize = 48.sp),
lineHeight = 52.sp,
textAlign = TextAlign.Center,
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ class LoginActivity @Inject constructor(): AppCompatActivity() {
super.onCreate(savedInstanceState)

// start with login info from Intent
model.updateLoginInfo(loginInfoFromIntent(intent))
if (savedInstanceState == null) {
val loginInfo = loginInfoFromIntent(intent)
if (loginInfo.baseUri != null) {
model.updateLoginInfo(loginInfo)
model.navToPage(LoginScreenModel.Page.LoginDetails)
}
}

setContent {
LoginScreen(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ class LoginScreenModel @Inject constructor(

// navigation events

fun navToPage(toPage: Page) {
page = toPage
}

fun navToNextPage() {
when (page) {
Page.LoginType -> {
Expand Down Expand Up @@ -80,6 +84,7 @@ class LoginScreenModel @Inject constructor(
?: loginInfo.baseUri?.host
?: ""
updateAccountNameAndEmails(initialAccountName, emails)
updateGroupMethod(loginInfo.suggestedGroupMethod)
page = Page.AccountDetails
}

Expand Down

0 comments on commit e7ec996

Please sign in to comment.