mirror of
https://github.com/bitfireAT/davx5-ose
synced 2024-07-22 03:01:24 +00:00
Backport changes from build variants
This commit is contained in:
parent
079c3efdfd
commit
b63cd67e9c
|
@ -104,6 +104,7 @@ class SettingsManager internal constructor(
|
|||
/*** SETTINGS ACCESS ***/
|
||||
|
||||
fun containsKey(key: String) = providers.any { it.contains(key) }
|
||||
fun containsKeyLive(key: String) = SettingLiveData { containsKey(key) }
|
||||
|
||||
private fun<T> getValue(key: String, reader: (SettingsProvider) -> T?): T? {
|
||||
Logger.log.fine("Looking up setting $key")
|
||||
|
|
|
@ -99,9 +99,12 @@ fun LoginScreen(
|
|||
loginTypesProvider.LoginTypePage(
|
||||
selectedLoginType = selectedLoginType,
|
||||
onSelectLoginType = { selectedLoginType = it },
|
||||
loginInfo = loginInfo,
|
||||
onUpdateLoginInfo = { loginInfo = it },
|
||||
onContinue = {
|
||||
phase = LoginActivity.Phase.LOGIN_DETAILS
|
||||
}
|
||||
},
|
||||
onFinish = onFinish
|
||||
)
|
||||
|
||||
LoginActivity.Phase.LOGIN_DETAILS -> {
|
||||
|
@ -115,7 +118,8 @@ fun LoginScreen(
|
|||
onUpdateLoginInfo = { loginInfo = it },
|
||||
onDetectResources = {
|
||||
phase = LoginActivity.Phase.DETECT_RESOURCES
|
||||
}
|
||||
},
|
||||
onFinish = onFinish
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ interface LoginType {
|
|||
loginInfo: LoginInfo,
|
||||
onUpdateLoginInfo: (newLoginInfo: LoginInfo) -> Unit,
|
||||
onDetectResources: () -> Unit,
|
||||
onFinish: () -> Unit
|
||||
)
|
||||
|
||||
}
|
|
@ -63,7 +63,8 @@ object LoginTypeAdvanced : LoginType {
|
|||
snackbarHostState: SnackbarHostState,
|
||||
loginInfo: LoginInfo,
|
||||
onUpdateLoginInfo: (newLoginInfo: LoginInfo) -> Unit,
|
||||
onDetectResources: () -> Unit
|
||||
onDetectResources: () -> Unit,
|
||||
onFinish: () -> Unit
|
||||
) {
|
||||
LoginTypeAdvanced_Content(
|
||||
snackbarHostState = snackbarHostState,
|
||||
|
|
|
@ -53,7 +53,8 @@ object LoginTypeEmail : LoginType {
|
|||
snackbarHostState: SnackbarHostState,
|
||||
loginInfo: LoginInfo,
|
||||
onUpdateLoginInfo: (newLoginInfo: LoginInfo) -> Unit,
|
||||
onDetectResources: () -> Unit
|
||||
onDetectResources: () -> Unit,
|
||||
onFinish: () -> Unit
|
||||
) {
|
||||
LoginTypeEmail_Content(
|
||||
loginInfo = loginInfo,
|
||||
|
|
|
@ -144,6 +144,7 @@ object LoginTypeGoogle : LoginType {
|
|||
loginInfo: LoginInfo,
|
||||
onUpdateLoginInfo: (newLoginInfo: LoginInfo) -> Unit,
|
||||
onDetectResources: () -> Unit,
|
||||
onFinish: () -> Unit
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
val scope = rememberCoroutineScope()
|
||||
|
|
|
@ -106,7 +106,8 @@ object LoginTypeNextcloud : LoginType {
|
|||
snackbarHostState: SnackbarHostState,
|
||||
loginInfo: LoginInfo,
|
||||
onUpdateLoginInfo: (newLoginInfo: LoginInfo) -> Unit,
|
||||
onDetectResources: () -> Unit
|
||||
onDetectResources: () -> Unit,
|
||||
onFinish: () -> Unit
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
val locale = Locale.current
|
||||
|
@ -393,7 +394,8 @@ fun NextcloudLoginScreen(
|
|||
singleLine = true
|
||||
)
|
||||
LaunchedEffect(Unit) {
|
||||
focusRequester.requestFocus()
|
||||
if (loginInfo.baseUri == null)
|
||||
focusRequester.requestFocus()
|
||||
}
|
||||
|
||||
if (error != null)
|
||||
|
|
|
@ -52,7 +52,8 @@ object LoginTypeUrl : LoginType {
|
|||
snackbarHostState: SnackbarHostState,
|
||||
loginInfo: LoginInfo,
|
||||
onUpdateLoginInfo: (newLoginInfo: LoginInfo) -> Unit,
|
||||
onDetectResources: () -> Unit
|
||||
onDetectResources: () -> Unit,
|
||||
onFinish: () -> Unit
|
||||
) {
|
||||
LoginTypeUrl_Content(
|
||||
loginInfo = loginInfo,
|
||||
|
|
|
@ -13,7 +13,10 @@ interface LoginTypesProvider {
|
|||
fun LoginTypePage(
|
||||
selectedLoginType: LoginType,
|
||||
onSelectLoginType: (LoginType) -> Unit,
|
||||
onContinue: () -> Unit
|
||||
loginInfo: LoginInfo,
|
||||
onUpdateLoginInfo: (newLoginInfo: LoginInfo) -> Unit,
|
||||
onContinue: () -> Unit,
|
||||
onFinish: () -> Unit
|
||||
)
|
||||
|
||||
}
|
|
@ -28,7 +28,14 @@ class StandardLoginTypesProvider @Inject constructor() : LoginTypesProvider {
|
|||
LoginTypeUrl
|
||||
|
||||
@Composable
|
||||
override fun LoginTypePage(selectedLoginType: LoginType, onSelectLoginType: (LoginType) -> Unit, onContinue: () -> Unit) {
|
||||
override fun LoginTypePage(
|
||||
selectedLoginType: LoginType,
|
||||
onSelectLoginType: (LoginType) -> Unit,
|
||||
loginInfo: LoginInfo,
|
||||
onUpdateLoginInfo: (newLoginInfo: LoginInfo) -> Unit,
|
||||
onContinue: () -> Unit,
|
||||
onFinish: () -> Unit
|
||||
) {
|
||||
StandardLoginTypePage(
|
||||
selectedLoginType = selectedLoginType,
|
||||
onSelectLoginType = onSelectLoginType,
|
||||
|
|
Loading…
Reference in a new issue