From edcf5a70bb0d9844e8563f9d58977d30375331e2 Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Fri, 14 Jun 2024 22:47:23 +0200 Subject: [PATCH] Restructure integration settings screen --- .../launcher2/ui/settings/SettingsActivity.kt | 12 + .../settings/google/GoogleSettingsScreen.kt | 157 +++++++++++++ .../settings/google/GoogleSettingsScreenVM.kt | 44 ++++ .../IntegrationsSettingsScreen.kt | 91 ++------ .../IntegrationsSettingsScreenVM.kt | 1 - .../nextcloud/NextcloudSettingsScreenVM.kt | 44 ++++ .../nextcloud/owncloudSettingsScreen.kt | 146 ++++++++++++ .../owncloud/OwncloudSettingsScreen.kt | 144 ++++++++++++ .../owncloud/OwncloudSettingsScreenVM.kt | 44 ++++ .../java/de/mm20/launcher2/icons/Icons.kt | 220 ++++++++++++++++++ core/i18n/src/main/res/values/strings.xml | 1 + 11 files changed, 836 insertions(+), 68 deletions(-) create mode 100644 app/ui/src/main/java/de/mm20/launcher2/ui/settings/google/GoogleSettingsScreen.kt create mode 100644 app/ui/src/main/java/de/mm20/launcher2/ui/settings/google/GoogleSettingsScreenVM.kt create mode 100644 app/ui/src/main/java/de/mm20/launcher2/ui/settings/nextcloud/NextcloudSettingsScreenVM.kt create mode 100644 app/ui/src/main/java/de/mm20/launcher2/ui/settings/nextcloud/owncloudSettingsScreen.kt create mode 100644 app/ui/src/main/java/de/mm20/launcher2/ui/settings/owncloud/OwncloudSettingsScreen.kt create mode 100644 app/ui/src/main/java/de/mm20/launcher2/ui/settings/owncloud/OwncloudSettingsScreenVM.kt diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/SettingsActivity.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/SettingsActivity.kt index baa76e92..ada2bcab 100644 --- a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/SettingsActivity.kt +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/SettingsActivity.kt @@ -44,6 +44,7 @@ import de.mm20.launcher2.ui.settings.favorites.FavoritesSettingsScreen import de.mm20.launcher2.ui.settings.filesearch.FileSearchSettingsScreen import de.mm20.launcher2.ui.settings.filterbar.FilterBarSettingsScreen import de.mm20.launcher2.ui.settings.gestures.GestureSettingsScreen +import de.mm20.launcher2.ui.settings.google.GoogleSettingsScreen import de.mm20.launcher2.ui.settings.hiddenitems.HiddenItemsSettingsScreen import de.mm20.launcher2.ui.settings.homescreen.HomescreenSettingsScreen import de.mm20.launcher2.ui.settings.icons.IconsSettingsScreen @@ -53,6 +54,8 @@ import de.mm20.launcher2.ui.settings.locations.LocationsSettingsScreen import de.mm20.launcher2.ui.settings.log.LogScreen import de.mm20.launcher2.ui.settings.main.MainSettingsScreen import de.mm20.launcher2.ui.settings.media.MediaIntegrationSettingsScreen +import de.mm20.launcher2.ui.settings.nextcloud.NextcloudSettingsScreen +import de.mm20.launcher2.ui.settings.owncloud.OwncloudSettingsScreen import de.mm20.launcher2.ui.settings.plugins.PluginSettingsScreen import de.mm20.launcher2.ui.settings.plugins.PluginsSettingsScreen import de.mm20.launcher2.ui.settings.search.SearchSettingsScreen @@ -186,6 +189,15 @@ class SettingsActivity : BaseActivity() { composable("settings/integrations") { IntegrationsSettingsScreen() } + composable("settings/integrations/nextcloud") { + NextcloudSettingsScreen() + } + composable("settings/integrations/owncloud") { + OwncloudSettingsScreen() + } + composable("settings/integrations/google") { + GoogleSettingsScreen() + } composable("settings/plugins") { PluginsSettingsScreen() } diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/google/GoogleSettingsScreen.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/google/GoogleSettingsScreen.kt new file mode 100644 index 00000000..63fc4df0 --- /dev/null +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/google/GoogleSettingsScreen.kt @@ -0,0 +1,157 @@ +package de.mm20.launcher2.ui.settings.google + +import androidx.appcompat.app.AppCompatActivity +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.rounded.Logout +import androidx.compose.material3.Button +import androidx.compose.material3.ButtonDefaults +import androidx.compose.material3.HorizontalDivider +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.compose.LocalLifecycleOwner +import androidx.lifecycle.repeatOnLifecycle +import androidx.lifecycle.viewmodel.compose.viewModel +import de.mm20.launcher2.ui.R +import de.mm20.launcher2.ui.component.preferences.PreferenceScreen +import de.mm20.launcher2.ui.component.preferences.SwitchPreference +import de.mm20.launcher2.ui.locals.LocalNavController +import de.mm20.launcher2.ui.settings.integrations.GoogleSigninButton + +@Composable +fun GoogleSettingsScreen() { + + val viewModel: GoogleSettingsScreenVM = viewModel() + val lifecycleOwner = LocalLifecycleOwner.current + val navController = LocalNavController.current + + val googleUser by viewModel.googleUser + val loading by viewModel.loading + val searchFiles by viewModel.searchFiles.collectAsState(null) + + LaunchedEffect(null) { + lifecycleOwner.repeatOnLifecycle(Lifecycle.State.RESUMED) { + viewModel.onResume() + } + } + PreferenceScreen(title = stringResource(R.string.preference_google)) { + if (loading) return@PreferenceScreen + + if (googleUser != null) { + item { + Column( + modifier = Modifier + .background(MaterialTheme.colorScheme.secondaryContainer) + .fillParentMaxWidth() + .padding(vertical = 64.dp), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center + ) { + Box( + contentAlignment = Alignment.Center, + modifier = Modifier + .size(72.dp) + .background(MaterialTheme.colorScheme.secondary, CircleShape) + .border( + 2.dp, + MaterialTheme.colorScheme.onSecondaryContainer, + CircleShape + ), + ) { + Text( + text = googleUser!!.userName.split(" ") + .map { it.first() } + .joinToString("").let { + if (it.length >= 2) it.first().toString() + it.last().toString() + else it.first().toString() + }, + color = MaterialTheme.colorScheme.onSecondary, + style = MaterialTheme.typography.headlineMedium, + ) + } + Text( + modifier = Modifier.padding(top = 24.dp), + text = stringResource( + R.string.preference_signin_user, + googleUser!!.userName + ), + color = MaterialTheme.colorScheme.onSecondaryContainer, + style = MaterialTheme.typography.bodyLarge, + ) + Button( + modifier = Modifier.padding(top = 32.dp), + onClick = { + viewModel.signOut() + }, + contentPadding = ButtonDefaults.ButtonWithIconContentPadding, + ) { + Icon( + Icons.AutoMirrored.Rounded.Logout, + modifier = Modifier + .padding(end = ButtonDefaults.IconSpacing) + .size(ButtonDefaults.IconSize), + contentDescription = null + ) + Text(text = stringResource(R.string.preference_signout)) + } + } + } + item { + HorizontalDivider() + } + + item { + SwitchPreference( + title = stringResource(R.string.plugin_type_filesearch), + summary = stringResource( + R.string.preference_search_cloud_summary, + googleUser!!.userName + ), + value = searchFiles == true, + onValueChanged = { + viewModel.setSearchFiles(it) + }, + iconPadding = false, + ) + } + } else { + item { + val activity = LocalContext.current as AppCompatActivity + Column( + modifier = Modifier + .fillParentMaxWidth() + .padding(vertical = 64.dp, horizontal = 24.dp), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center + ) { + GoogleSigninButton( + onClick = { + viewModel.signIn(activity) + } + ) + } + } + item { + HorizontalDivider() + } + } + } +} \ No newline at end of file diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/google/GoogleSettingsScreenVM.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/google/GoogleSettingsScreenVM.kt new file mode 100644 index 00000000..2b93282e --- /dev/null +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/google/GoogleSettingsScreenVM.kt @@ -0,0 +1,44 @@ +package de.mm20.launcher2.ui.settings.google + +import androidx.appcompat.app.AppCompatActivity +import androidx.compose.runtime.mutableStateOf +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import de.mm20.launcher2.accounts.Account +import de.mm20.launcher2.accounts.AccountType +import de.mm20.launcher2.accounts.AccountsRepository +import de.mm20.launcher2.preferences.search.FileSearchSettings +import kotlinx.coroutines.launch +import org.koin.core.component.KoinComponent +import org.koin.core.component.inject + +class GoogleSettingsScreenVM: ViewModel(), KoinComponent { + private val accountsRepository: AccountsRepository by inject() + private val fileSearchSettings: FileSearchSettings by inject() + + val googleUser = mutableStateOf(null) + val loading = mutableStateOf(true) + + fun onResume() { + viewModelScope.launch { + loading.value = true + googleUser.value = accountsRepository.getCurrentlySignedInAccount(AccountType.Google) + loading.value = false + } + } + + fun signIn(activity: AppCompatActivity) { + accountsRepository.signin(activity, AccountType.Google) + } + + fun signOut() { + accountsRepository.signout(AccountType.Google) + googleUser.value = null + } + + val searchFiles = fileSearchSettings.gdriveFiles + + fun setSearchFiles(value: Boolean) { + fileSearchSettings.setGdriveFiles(value) + } +} \ No newline at end of file diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/integrations/IntegrationsSettingsScreen.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/integrations/IntegrationsSettingsScreen.kt index b220fa8a..801b3978 100644 --- a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/integrations/IntegrationsSettingsScreen.kt +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/integrations/IntegrationsSettingsScreen.kt @@ -34,6 +34,9 @@ import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import androidx.lifecycle.viewmodel.compose.viewModel import de.mm20.launcher2.accounts.AccountType +import de.mm20.launcher2.icons.Google +import de.mm20.launcher2.icons.Nextcloud +import de.mm20.launcher2.icons.Owncloud import de.mm20.launcher2.ui.R import de.mm20.launcher2.ui.component.preferences.Preference import de.mm20.launcher2.ui.component.preferences.PreferenceCategory @@ -55,7 +58,6 @@ fun IntegrationsSettingsScreen() { val owncloudUser by viewModel.owncloudUser val nextcloudUser by viewModel.nextcloudUser - val msUser by viewModel.msUser val googleUser by viewModel.googleUser val loading by viewModel.loading @@ -83,73 +85,28 @@ fun IntegrationsSettingsScreen() { navController?.navigate("settings/integrations/media") } ) - } - item { - PreferenceCategory( - title = stringResource(id = R.string.preference_category_accounts) - ) { - - Preference( - title = if (nextcloudUser != null) { - stringResource(R.string.preference_nextcloud) - } else { - stringResource(R.string.preference_nextcloud_signin) - }, - summary = nextcloudUser?.let { - stringResource(R.string.preference_signin_user, it.userName) - } ?: stringResource(R.string.preference_nextcloud_signin_summary), - onClick = { - if (nextcloudUser != null) { - viewModel.signOut(AccountType.Nextcloud) - } else { - viewModel.signIn(context as AppCompatActivity, AccountType.Nextcloud) - } - }, - enabled = !loading, - ) - - Preference( - title = if (owncloudUser != null) { - stringResource(R.string.preference_owncloud) - } else { - stringResource(R.string.preference_owncloud_signin) - }, - summary = owncloudUser?.let { - stringResource(R.string.preference_signin_user, it.userName) - } ?: stringResource(R.string.preference_owncloud_signin_summary), - onClick = { - if (owncloudUser != null) { - viewModel.signOut(AccountType.Owncloud) - } else { - viewModel.signIn(context as AppCompatActivity, AccountType.Owncloud) - } - }, - enabled = !loading, - ) - - if (viewModel.isGoogleAvailable) { - Preference( - title = if (googleUser != null) { - stringResource(R.string.preference_google) - } else { - stringResource(R.string.preference_google_signin) - }, - summary = googleUser?.let { - stringResource(R.string.preference_signin_user, it.userName) - } ?: stringResource(R.string.preference_google_signin_summary), - onClick = { - if (googleUser != null) { - viewModel.signOut(AccountType.Google) - } else { - viewModel.signIn( - context as AppCompatActivity, - AccountType.Google - ) - } - }, - enabled = !loading, - ) + Preference( + title = stringResource(R.string.preference_nextcloud), + icon = Icons.Rounded.Nextcloud, + onClick = { + navController?.navigate("settings/integrations/nextcloud") } + ) + Preference( + title = stringResource(R.string.preference_owncloud), + icon = Icons.Rounded.Owncloud, + onClick = { + navController?.navigate("settings/integrations/owncloud") + } + ) + if (viewModel.isGoogleAvailable) { + Preference( + title = stringResource(R.string.preference_google), + icon = Icons.Rounded.Google, + onClick = { + navController?.navigate("settings/integrations/google") + } + ) } } } diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/integrations/IntegrationsSettingsScreenVM.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/integrations/IntegrationsSettingsScreenVM.kt index 97574426..57d3e1e7 100644 --- a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/integrations/IntegrationsSettingsScreenVM.kt +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/integrations/IntegrationsSettingsScreenVM.kt @@ -17,7 +17,6 @@ class IntegrationsSettingsScreenVM : ViewModel(), KoinComponent { val isGoogleAvailable = accountsRepository.isSupported(AccountType.Google) val googleUser = mutableStateOf(null) - val msUser= mutableStateOf(null) val nextcloudUser = mutableStateOf(null) val owncloudUser = mutableStateOf(null) diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/nextcloud/NextcloudSettingsScreenVM.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/nextcloud/NextcloudSettingsScreenVM.kt new file mode 100644 index 00000000..20b1dd9a --- /dev/null +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/nextcloud/NextcloudSettingsScreenVM.kt @@ -0,0 +1,44 @@ +package de.mm20.launcher2.ui.settings.nextcloud + +import androidx.appcompat.app.AppCompatActivity +import androidx.compose.runtime.mutableStateOf +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import de.mm20.launcher2.accounts.Account +import de.mm20.launcher2.accounts.AccountType +import de.mm20.launcher2.accounts.AccountsRepository +import de.mm20.launcher2.preferences.search.FileSearchSettings +import kotlinx.coroutines.launch +import org.koin.core.component.KoinComponent +import org.koin.core.component.inject + +class NextcloudSettingsScreenVM: ViewModel(), KoinComponent { + private val accountsRepository: AccountsRepository by inject() + private val fileSearchSettings: FileSearchSettings by inject() + + val nextcloudUser = mutableStateOf(null) + val loading = mutableStateOf(true) + + fun onResume() { + viewModelScope.launch { + loading.value = true + nextcloudUser.value = accountsRepository.getCurrentlySignedInAccount(AccountType.Nextcloud) + loading.value = false + } + } + + fun signIn(activity: AppCompatActivity) { + accountsRepository.signin(activity, AccountType.Nextcloud) + } + + fun signOut() { + accountsRepository.signout(AccountType.Nextcloud) + nextcloudUser.value = null + } + + val searchFiles = fileSearchSettings.nextcloudFiles + + fun setSearchFiles(value: Boolean) { + fileSearchSettings.setNextcloudFiles(value) + } +} \ No newline at end of file diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/nextcloud/owncloudSettingsScreen.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/nextcloud/owncloudSettingsScreen.kt new file mode 100644 index 00000000..a2e2f4dc --- /dev/null +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/nextcloud/owncloudSettingsScreen.kt @@ -0,0 +1,146 @@ +package de.mm20.launcher2.ui.settings.nextcloud + +import androidx.appcompat.app.AppCompatActivity +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.aspectRatio +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.rounded.Login +import androidx.compose.material.icons.automirrored.rounded.Logout +import androidx.compose.material.icons.rounded.Logout +import androidx.compose.material3.Button +import androidx.compose.material3.ButtonDefaults +import androidx.compose.material3.HorizontalDivider +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.compose.LocalLifecycleOwner +import androidx.lifecycle.repeatOnLifecycle +import androidx.lifecycle.viewmodel.compose.viewModel +import de.mm20.launcher2.ui.R +import de.mm20.launcher2.ui.component.preferences.Preference +import de.mm20.launcher2.ui.component.preferences.PreferenceScreen +import de.mm20.launcher2.ui.component.preferences.SwitchPreference +import de.mm20.launcher2.ui.locals.LocalNavController + +@Composable +fun NextcloudSettingsScreen() { + + val viewModel: NextcloudSettingsScreenVM = viewModel() + val lifecycleOwner = LocalLifecycleOwner.current + val navController = LocalNavController.current + + val nextcloudUser by viewModel.nextcloudUser + val loading by viewModel.loading + val searchFiles by viewModel.searchFiles.collectAsState(null) + + LaunchedEffect(null) { + lifecycleOwner.repeatOnLifecycle(Lifecycle.State.RESUMED) { + viewModel.onResume() + } + } + PreferenceScreen(title = stringResource(R.string.preference_nextcloud)) { + if (loading) return@PreferenceScreen + + if (nextcloudUser != null) { + item { + Column( + modifier = Modifier + .background(MaterialTheme.colorScheme.secondaryContainer) + .fillParentMaxWidth() + .padding(vertical = 64.dp) + , + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center + ) { + Box( + contentAlignment = Alignment.Center, + modifier = Modifier + .size(72.dp) + .background(MaterialTheme.colorScheme.secondary, CircleShape) + .border(2.dp, MaterialTheme.colorScheme.onSecondaryContainer, CircleShape), + ) { + Text( + text = nextcloudUser!!.userName.split(" ") + .map { it.first() } + .joinToString("").let { + if (it.length >= 2) it.first().toString() + it.last().toString() + else it.first().toString() + } + , + color = MaterialTheme.colorScheme.onSecondary, + style = MaterialTheme.typography.headlineMedium, + ) + } + Text( + modifier = Modifier.padding(top = 24.dp), + text = stringResource(R.string.preference_signin_user, nextcloudUser!!.userName), + color = MaterialTheme.colorScheme.onSecondaryContainer, + style = MaterialTheme.typography.bodyLarge, + ) + Button( + modifier = Modifier.padding(top = 32.dp), + onClick = { + viewModel.signOut() + }, + contentPadding = ButtonDefaults.ButtonWithIconContentPadding, + ) { + Icon( + Icons.AutoMirrored.Rounded.Logout, + modifier = Modifier + .padding(end = ButtonDefaults.IconSpacing) + .size(ButtonDefaults.IconSize), + contentDescription = null) + Text(text = stringResource(R.string.preference_signout)) + } + } + } + item { + HorizontalDivider() + } + + item { + SwitchPreference( + title = stringResource(R.string.plugin_type_filesearch), + summary = stringResource(R.string.preference_search_cloud_summary, nextcloudUser!!.userName), + value = searchFiles == true, + onValueChanged = { + viewModel.setSearchFiles(it) + }, + iconPadding = false, + ) + } + } else { + item { + val activity = LocalContext.current as AppCompatActivity + Preference( + title = stringResource(R.string.preference_nextcloud_signin), + summary = stringResource(R.string.preference_nextcloud_signin_summary), + icon = Icons.AutoMirrored.Rounded.Login, + onClick = { + viewModel.signIn(activity) + } + ) + } + item { + HorizontalDivider() + } + } + } +} \ No newline at end of file diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/owncloud/OwncloudSettingsScreen.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/owncloud/OwncloudSettingsScreen.kt new file mode 100644 index 00000000..e3308006 --- /dev/null +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/owncloud/OwncloudSettingsScreen.kt @@ -0,0 +1,144 @@ +package de.mm20.launcher2.ui.settings.owncloud + +import androidx.appcompat.app.AppCompatActivity +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.rounded.Login +import androidx.compose.material.icons.automirrored.rounded.Logout +import androidx.compose.material3.Button +import androidx.compose.material3.ButtonDefaults +import androidx.compose.material3.HorizontalDivider +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.compose.LocalLifecycleOwner +import androidx.lifecycle.repeatOnLifecycle +import androidx.lifecycle.viewmodel.compose.viewModel +import de.mm20.launcher2.ui.R +import de.mm20.launcher2.ui.component.preferences.Preference +import de.mm20.launcher2.ui.component.preferences.PreferenceScreen +import de.mm20.launcher2.ui.component.preferences.SwitchPreference +import de.mm20.launcher2.ui.locals.LocalNavController + +@Composable +fun OwncloudSettingsScreen() { + + val viewModel: OwncloudSettingsScreenVM = viewModel() + val lifecycleOwner = LocalLifecycleOwner.current + val navController = LocalNavController.current + + val owncloudUser by viewModel.owncloudUser + val loading by viewModel.loading + val searchFiles by viewModel.searchFiles.collectAsState(null) + + LaunchedEffect(null) { + lifecycleOwner.repeatOnLifecycle(Lifecycle.State.RESUMED) { + viewModel.onResume() + } + } + PreferenceScreen(title = stringResource(R.string.preference_owncloud)) { + if (loading) return@PreferenceScreen + + if (owncloudUser != null) { + item { + Column( + modifier = Modifier + .background(MaterialTheme.colorScheme.secondaryContainer) + .fillParentMaxWidth() + .padding(vertical = 64.dp) + , + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center + ) { + Box( + contentAlignment = Alignment.Center, + modifier = Modifier + .size(72.dp) + .background(MaterialTheme.colorScheme.secondary, CircleShape) + .border(2.dp, MaterialTheme.colorScheme.onSecondaryContainer, CircleShape), + ) { + Text( + text = owncloudUser!!.userName.split(" ") + .map { it.first() } + .joinToString("").let { + if (it.length >= 2) it.first().toString() + it.last().toString() + else it.first().toString() + } + , + color = MaterialTheme.colorScheme.onSecondary, + style = MaterialTheme.typography.headlineMedium, + ) + } + Text( + modifier = Modifier.padding(top = 24.dp), + text = stringResource(R.string.preference_signin_user, owncloudUser!!.userName), + color = MaterialTheme.colorScheme.onSecondaryContainer, + style = MaterialTheme.typography.bodyLarge, + ) + Button( + modifier = Modifier.padding(top = 32.dp), + onClick = { + viewModel.signOut() + }, + contentPadding = ButtonDefaults.ButtonWithIconContentPadding, + ) { + Icon( + Icons.AutoMirrored.Rounded.Logout, + modifier = Modifier + .padding(end = ButtonDefaults.IconSpacing) + .size(ButtonDefaults.IconSize), + contentDescription = null) + Text(text = stringResource(R.string.preference_signout)) + } + } + } + item { + HorizontalDivider() + } + + item { + SwitchPreference( + title = stringResource(R.string.plugin_type_filesearch), + summary = stringResource(R.string.preference_search_cloud_summary, owncloudUser!!.userName), + value = searchFiles == true, + onValueChanged = { + viewModel.setSearchFiles(it) + }, + iconPadding = false, + ) + } + } else { + item { + val activity = LocalContext.current as AppCompatActivity + Preference( + title = stringResource(R.string.preference_owncloud_signin), + summary = stringResource(R.string.preference_owncloud_signin_summary), + icon = Icons.AutoMirrored.Rounded.Login, + onClick = { + viewModel.signIn(activity) + } + ) + } + item { + HorizontalDivider() + } + } + } +} \ No newline at end of file diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/owncloud/OwncloudSettingsScreenVM.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/owncloud/OwncloudSettingsScreenVM.kt new file mode 100644 index 00000000..35d74c3c --- /dev/null +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/owncloud/OwncloudSettingsScreenVM.kt @@ -0,0 +1,44 @@ +package de.mm20.launcher2.ui.settings.owncloud + +import androidx.appcompat.app.AppCompatActivity +import androidx.compose.runtime.mutableStateOf +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import de.mm20.launcher2.accounts.Account +import de.mm20.launcher2.accounts.AccountType +import de.mm20.launcher2.accounts.AccountsRepository +import de.mm20.launcher2.preferences.search.FileSearchSettings +import kotlinx.coroutines.launch +import org.koin.core.component.KoinComponent +import org.koin.core.component.inject + +class OwncloudSettingsScreenVM: ViewModel(), KoinComponent { + private val accountsRepository: AccountsRepository by inject() + private val fileSearchSettings: FileSearchSettings by inject() + + val owncloudUser = mutableStateOf(null) + val loading = mutableStateOf(true) + + fun onResume() { + viewModelScope.launch { + loading.value = true + owncloudUser.value = accountsRepository.getCurrentlySignedInAccount(AccountType.Owncloud) + loading.value = false + } + } + + fun signIn(activity: AppCompatActivity) { + accountsRepository.signin(activity, AccountType.Owncloud) + } + + fun signOut() { + accountsRepository.signout(AccountType.Owncloud) + owncloudUser.value = null + } + + val searchFiles = fileSearchSettings.owncloudFiles + + fun setSearchFiles(value: Boolean) { + fileSearchSettings.setOwncloudFiles(value) + } +} \ No newline at end of file diff --git a/core/base/src/main/java/de/mm20/launcher2/icons/Icons.kt b/core/base/src/main/java/de/mm20/launcher2/icons/Icons.kt index 59c11516..731dc3a1 100644 --- a/core/base/src/main/java/de/mm20/launcher2/icons/Icons.kt +++ b/core/base/src/main/java/de/mm20/launcher2/icons/Icons.kt @@ -1428,3 +1428,223 @@ private val _Candle = materialIcon("Icons.Rounded.Candle") { val Icons.Rounded.Candle get() = _Candle + +private val _Nextcloud = materialIcon("Icons.Rounded.Nextcloud") { + materialPath { + moveTo(11.999888f, 7.437f) + curveTo(9.920569f, 7.437f, 8.172661f, 8.8561823f, 7.6293348f, 10.767446f) + curveTo(7.1564978f, 9.7557586f, 6.1414535f, 9.0410206f, 4.9588016f, 9.0410206f) + curveTo(3.3341937f, 9.0410206f, 2.000046f, 10.375392f, 2.000046f, 12f) + curveToRelative(0f, 1.624608f, 1.3341477f, 2.958979f, 2.9587556f, 2.958979f) + curveToRelative(1.1826519f, 0f, 2.1976962f, -0.714738f, 2.6705332f, -1.726425f) + curveTo(8.172661f, 15.143818f, 9.920569f, 16.563f, 11.999888f, 16.563f) + curveToRelative(2.079319f, 0f, 3.827227f, -1.419182f, 4.370553f, -3.330446f) + curveToRelative(0.472837f, 1.011687f, 1.487882f, 1.726425f, 2.670534f, 1.726425f) + curveToRelative(1.624608f, 0f, 2.958979f, -1.334371f, 2.958979f, -2.958979f) + curveToRelative(0f, -1.624608f, -1.334371f, -2.9589794f, -2.958979f, -2.9589794f) + curveToRelative(-1.182652f, 0f, -2.197697f, 0.714738f, -2.670534f, 1.7264254f) + curveTo(15.827115f, 8.8561823f, 14.079207f, 7.437f, 11.999888f, 7.437f) + close() + moveToRelative(0f, 1.7613346f) + curveToRelative(1.557028f, 0f, 2.801666f, 1.2446374f, 2.801666f, 2.8016654f) + curveToRelative(0f, 1.557028f, -1.244638f, 2.801665f, -2.801666f, 2.801665f) + curveToRelative(-1.557028f, 0f, -2.8016653f, -1.244637f, -2.8016653f, -2.801665f) + curveToRelative(0f, -1.557028f, 1.2446373f, -2.8016654f, 2.8016653f, -2.8016654f) + close() + moveTo(4.9588016f, 10.798103f) + curveToRelative(0.6733396f, 0f, 1.2018966f, 0.528557f, 1.2018966f, 1.201897f) + curveToRelative(0f, 0.67334f, -0.528557f, 1.201897f, -1.2018966f, 1.201897f) + curveTo(4.285462f, 13.201897f, 3.756905f, 12.67334f, 3.756905f, 12f) + curveToRelative(0f, -0.67334f, 0.528557f, -1.201897f, 1.2018966f, -1.201897f) + close() + moveToRelative(14.0821734f, 0f) + curveToRelative(0.673339f, 0f, 1.201896f, 0.528557f, 1.201896f, 1.201897f) + curveToRelative(0f, 0.67334f, -0.528557f, 1.201897f, -1.201896f, 1.201897f) + curveToRelative(-0.67334f, 0f, -1.201897f, -0.528557f, -1.201897f, -1.201897f) + curveToRelative(0f, -0.67334f, 0.528557f, -1.201897f, 1.201897f, -1.201897f) + close() + } +} + +val Icons.Rounded.Nextcloud + get() = _Nextcloud + +private val _Owncloud = materialIcon("Icons.Rounded.Owncloud") { + materialPath { + moveTo(15.751538f, 13.867862f) + curveToRelative(0.0048f, -0.06458f, 0.0081f, -0.12959f, 0.0099f, -0.194825f) + curveToRelative(0.000878f, -0.03229f, 0.0024f, -0.06458f, 0.0024f, -0.09708f) + curveToRelative(0f, -0.540766f, -0.115314f, -1.054955f, -0.321341f, -1.520383f) + curveToRelative(-0.02109f, -0.04744f, -0.04261f, -0.09445f, -0.06545f, -0.141012f) + curveToRelative(-0.02262f, -0.04547f, -0.04547f, -0.09071f, -0.06963f, -0.135302f) + curveToRelative(-0.333201f, -0.611711f, -0.831356f, -1.120848f, -1.433843f, -1.468766f) + curveToRelative(-0.04459f, -0.02592f, -0.08983f, -0.05074f, -0.135521f, -0.0749f) + curveToRelative(-0.04569f, -0.02372f, -0.09159f, -0.04722f, -0.138376f, -0.06919f) + curveToRelative(-0.462573f, -0.2185468f, -0.976322f, -0.345282f, -1.517967f, -0.3575822f) + curveToRelative(-0.02921f, -0.0006589f, -0.05821f, -0.00242f, -0.08742f, -0.00242f) + curveToRelative(-0.03624f, 0f, -0.07182f, 0.00176f, -0.107846f, 0.00286f) + curveToRelative(-0.06502f, 0.00176f, -0.129371f, 0.00527f, -0.193287f, 0.010323f) + curveToRelative(-0.59414f, 0.047224f, -1.149842f, 0.2319452f, -1.635038f, 0.5236342f) + curveToRelative(-0.04503f, 0.02724f, -0.089396f, 0.05557f, -0.1333247f, 0.08456f) + curveToRelative(-0.044368f, 0.02921f, -0.087858f, 0.05952f, -0.1309084f, 0.09049f) + curveToRelative(-0.251275f, 0.181426f, -0.4794862f, 0.392725f, -0.6791435f, 0.629282f) + curveToRelative(-0.033386f, 0.03954f, -0.065894f, 0.07995f, -0.097742f, 0.120805f) + curveToRelative(-0.031409f, 0.04041f, -0.06194f, 0.08149f, -0.091592f, 0.123002f) + curveToRelative(-0.4403883f, 0.616982f, -0.700448f, 1.370804f, -0.700448f, 2.184589f) + curveToRelative(0f, 0.214813f, 0.019109f, 0.425233f, 0.053813f, 0.630162f) + curveToRelative(0.00988f, 0.05887f, 0.021086f, 0.11773f, 0.033825f, 0.175716f) + curveToRelative(0.013838f, 0.06326f, 0.029432f, 0.125857f, 0.046345f, 0.188016f) + curveToRelative(0.094008f, 0.343964f, 0.2350203f, 0.66838f, 0.4166667f, 0.96556f) + curveToRelative(0.027456f, 0.04503f, 0.05601f, 0.0894f, 0.085442f, 0.133105f) + curveToRelative(0.029432f, 0.04393f, 0.060183f, 0.08698f, 0.091372f, 0.12959f) + curveToRelative(0.070506f, 0.09621f, 0.145405f, 0.188895f, 0.2244772f, 0.277851f) + curveToRelative(0.043051f, 0.04832f, 0.087199f, 0.09577f, 0.1326656f, 0.142111f) + curveToRelative(0.041733f, 0.04239f, 0.084563f, 0.08368f, 0.1280531f, 0.124319f) + curveToRelative(0.672553f, 0.621595f, 1.570901f, 1.002679f, 2.556668f, 1.002679f) + curveToRelative(0.949965f, 0f, 1.818003f, -0.353848f, 2.48177f, -0.935688f) + curveToRelative(0.03822f, -0.0336f, 0.07556f, -0.06787f, 0.112458f, -0.103013f) + curveToRelative(0.03778f, -0.0358f, 0.0749f, -0.07226f, 0.110921f, -0.109603f) + curveToRelative(0.551749f, -0.56932f, 0.925585f, -1.311281f, 1.032113f, -2.136048f) + curveToRelative(0.0083f, -0.06392f, 0.01494f, -0.128053f, 0.01999f, -0.192849f) + moveTo(8.5517923f, 15.752197f) + curveTo(8.5227992f, 15.706511f, 8.4946846f, 15.660386f, 8.4676682f, 15.613382f) + curveTo(8.260543f, 15.256239f, 8.1059128f, 14.86527f, 8.0147601f, 14.450581f) + curveTo(7.9178967f, 14.430373f, 7.8175189f, 14.41983f, 7.714725f, 14.41983f) + curveToRelative(-0.010982f, 0f, -0.021525f, 0.0011f, -0.032288f, 0.0015f) + curveToRelative(-0.051617f, 0.0011f, -0.1023546f, 0.0048f, -0.1524337f, 0.0112f) + curveToRelative(-0.051177f, 0.0064f, -0.1016956f, 0.01559f, -0.1511158f, 0.02702f) + curveToRelative(-0.4344579f, 0.101916f, -0.7946758f, 0.395801f, -0.9870849f, 0.787428f) + curveToRelative(-0.022623f, 0.04613f, -0.04305f, 0.09357f, -0.060842f, 0.14233f) + curveToRelative(-0.017791f, 0.04854f, -0.032947f, 0.09818f, -0.045686f, 0.1487f) + curveToRelative(-0.028334f, 0.114215f, -0.045247f, 0.233263f, -0.045247f, 0.356264f) + curveToRelative(0f, 0.283342f, 0.081928f, 0.547575f, 0.220963f, 0.772491f) + curveToRelative(0.027236f, 0.04415f, 0.056668f, 0.08654f, 0.088078f, 0.127395f) + curveToRelative(0.03097f, 0.03998f, 0.063697f, 0.07841f, 0.098621f, 0.115094f) + curveToRelative(0.2688455f, 0.282463f, 0.647294f, 0.459497f, 1.0670357f, 0.459497f) + curveToRelative(0.6246705f, 0f, 1.1586277f, -0.391188f, 1.3730012f, -0.94074f) + curveToRelative(-0.1636358f, -0.166932f, -0.3129945f, -0.34748f, -0.446319f, -0.540109f) + curveToRelative(-0.03075f, -0.04459f, -0.060402f, -0.08984f, -0.089615f, -0.135741f) + moveTo(19.987392f, 14.365798f) + curveToRelative(-0.0022f, -0.05337f, -0.0057f, -0.106309f, -0.01054f, -0.159023f) + curveToRelative(-0.0051f, -0.0525f, -0.0112f, -0.104771f, -0.01889f, -0.156388f) + curveToRelative(-0.205368f, -1.372562f, -1.368169f, -2.435424f, -2.78466f, -2.486382f) + curveToRelative(-0.03536f, -0.0013f, -0.07051f, -0.0026f, -0.106308f, -0.0026f) + curveToRelative(-0.0156f, 0f, -0.03097f, 0.000879f, -0.04657f, 0.0011f) + curveToRelative(-0.05118f, 0.000659f, -0.102135f, 0.0031f, -0.152873f, 0.0064f) + curveToRelative(-0.416886f, 0.02833f, -0.809831f, 0.144087f, -1.161044f, 0.329468f) + curveToRelative(0.211518f, 0.465647f, 0.337814f, 0.97764f, 0.3589f, 1.516429f) + curveToRelative(0.002f, 0.05359f, 0.004f, 0.107187f, 0.004f, 0.16122f) + curveToRelative(0f, 0.01581f, -0.0011f, 0.03141f, -0.0011f, 0.047f) + curveToRelative(-0.000879f, 0.06875f, -0.0033f, 0.137058f, -0.0075f, 0.204929f) + curveToRelative(-0.06216f, 1.013881f, -0.496178f, 1.928264f, -1.167853f, 2.608724f) + curveToRelative(0.535495f, 0.595897f, 1.31172f, 0.971491f, 2.174047f, 0.971491f) + curveToRelative(0.744596f, 0f, 1.424618f, -0.280268f, 1.941442f, -0.740204f) + curveToRelative(0.0391f, -0.03492f, 0.07754f, -0.07051f, 0.114655f, -0.107407f) + curveToRelative(0.03756f, -0.03712f, 0.07424f, -0.07534f, 0.109823f, -0.114435f) + curveToRelative(0.470479f, -0.519022f, 0.757336f, -1.207389f, 0.757336f, -1.961211f) + curveToRelative(0f, -0.03998f, -0.0013f, -0.07951f, -0.0029f, -0.119048f) + moveToRelative(0.538131f, -0.103013f) + curveToRelative(-0.08061f, 0f, -0.159243f, 0.0084f, -0.236338f, 0.02065f) + curveToRelative(0.004f, 0.06677f, 0.0068f, 0.133764f, 0.0068f, 0.201414f) + curveToRelative(0f, 0.857495f, -0.336716f, 1.637454f, -0.884072f, 2.216219f) + curveToRelative(0.270603f, 0.312335f, 0.66882f, 0.510894f, 1.113601f, 0.510894f) + curveTo(21.338429f, 17.211958f, 22f, 16.550388f, 22f, 15.737481f) + curveTo(22f, 14.924355f, 21.338429f, 14.262784f, 20.525523f, 14.262784f) + moveTo(8.3971622f, 9.7091029f) + curveToRelative(0.00857f, 0.054252f, 0.019329f, 0.1076261f, 0.03097f, 0.1607802f) + curveToRelative(0.027456f, 0.1221226f, 0.062599f, 0.2413899f, 0.1056493f, 0.3567039f) + curveToRelative(0.019109f, 0.05118f, 0.040195f, 0.101256f, 0.062379f, 0.150896f) + curveToRelative(0.021745f, 0.04876f, 0.044808f, 0.09664f, 0.069408f, 0.143867f) + curveToRelative(0.071604f, 0.137937f, 0.1546302f, 0.269065f, 0.2479793f, 0.391847f) + curveToRelative(0.1880162f, -0.217229f, 0.3979968f, -0.414909f, 0.6273063f, -0.588429f) + curveToRelative(0.04305f, -0.03251f, 0.087199f, -0.06392f, 0.131787f, -0.09511f) + curveToRelative(0.044368f, -0.03075f, 0.089395f, -0.06062f, 0.1350817f, -0.08962f) + curveToRelative(0.6183012f, -0.3949218f, 1.3492792f, -0.6277456f, 2.1336322f, -0.6378492f) + curveToRelative(0.01779f, -0.0002197f, 0.03536f, -0.00132f, 0.05293f, -0.00132f) + curveToRelative(0.05096f, 0f, 0.101476f, 0.00198f, 0.152214f, 0.00373f) + curveToRelative(0.06963f, 0.00264f, 0.139035f, 0.00703f, 0.207784f, 0.013179f) + curveToRelative(0.4707f, 0.041293f, 0.918336f, 0.1631963f, 1.329731f, 0.3514321f) + curveToRelative(0.04195f, -0.1884554f, 0.0648f, -0.3839395f, 0.0648f, -0.5846951f) + curveToRelative(0f, -0.1493586f, -0.01274f, -0.2956422f, -0.03624f, -0.4386312f) + curveToRelative(-0.0086f, -0.050293f, -0.01823f, -0.1003726f, -0.02943f, -0.1500123f) + curveToRelative(-0.0112f, -0.050079f, -0.02372f, -0.099499f, -0.03778f, -0.1482605f) + curveToRelative(-0.321341f, -1.127438f, -1.360042f, -1.9557196f, -2.589395f, -1.9557196f) + curveToRelative(-1.014102f, 0f, -1.8988319f, 0.5638289f, -2.3578901f, 1.3943069f) + curveToRelative(-0.025699f, 0.046126f, -0.050079f, 0.093349f, -0.072922f, 0.1412318f) + curveToRelative(-0.023722f, 0.04964f, -0.045686f, 0.1005974f, -0.066333f, 0.1519943f) + curveTo(8.433187f, 8.590231f, 8.3633398f, 8.929363f, 8.3633398f, 9.284529f) + curveToRelative(0f, 0.090054f, 0.00461f, 0.1790107f, 0.013179f, 0.2666491f) + curveToRelative(0.00549f, 0.053154f, 0.0123f, 0.1056493f, 0.020647f, 0.1579248f) + moveTo(15.57077f, 11.624627f) + curveToRelative(0.38943f, -0.204709f, 0.825426f, -0.331883f, 1.287559f, -0.361535f) + curveToRelative(-0.119267f, -1.375198f, -1.276138f, -2.4578285f, -2.681646f, -2.4578285f) + curveToRelative(-0.05381f, 0f, -0.107187f, 0.00198f, -0.160122f, 0.00505f) + curveToRelative(0.0246f, 0.1546301f, 0.03778f, 0.3127746f, 0.03778f, 0.4742137f) + curveToRelative(0f, 0.2503954f, -0.03119f, 0.4933228f, -0.0894f, 0.7261468f) + curveToRelative(0.675848f, 0.374934f, 1.234406f, 0.935907f, 1.605825f, 1.613952f) + moveToRelative(-9.4344104f, 3.44777f) + curveToRelative(0.2416096f, -0.462353f, 0.6806801f, -0.806098f, 1.2045335f, -0.918556f) + curveToRelative(0.04964f, -0.01054f, 0.099938f, -0.01889f, 0.1508962f, -0.02526f) + curveToRelative(0.050299f, -0.0064f, 0.1012563f, -0.01076f, 0.1526533f, -0.01274f) + curveToRelative(0.023502f, -0.000878f, 0.046784f, -0.0018f, 0.070286f, -0.0018f) + curveToRelative(0.082586f, 0f, 0.1636356f, 0.0061f, 0.2433667f, 0.01691f) + curveToRelative(-0.02482f, -0.181646f, -0.038658f, -0.366587f, -0.038658f, -0.555043f) + curveToRelative(0f, -0.904938f, 0.2967405f, -1.741785f, 0.7977508f, -2.418731f) + curveToRelative(-0.1135556f, -0.14123f, -0.2148119f, -0.292785f, -0.3015717f, -0.453565f) + curveToRelative(-0.024161f, -0.04503f, -0.047443f, -0.09093f, -0.069408f, -0.137498f) + curveToRelative(-0.022184f, -0.04635f, -0.042831f, -0.09357f, -0.062599f, -0.141232f) + curveToRelative(-0.078194f, -0.189554f, -0.1370585f, -0.388772f, -0.1752768f, -0.595238f) + curveToRelative(-0.06787f, -0.00461f, -0.1361799f, -0.00791f, -0.2053681f, -0.00791f) + curveToRelative(-0.5060622f, 0f, -0.9822527f, 0.1293709f, -1.3978211f, 0.3562642f) + curveToRelative(-0.045906f, 0.02526f, -0.090933f, 0.05184f, -0.1353014f, 0.07929f) + curveToRelative(-0.043929f, 0.02702f, -0.08676f, 0.05535f, -0.1289316f, 0.08478f) + curveToRelative(-0.473994f, 0.328809f, -0.8462924f, 0.794017f, -1.060007f, 1.338517f) + curveToRelative(-0.01867f, 0.04788f, -0.036241f, 0.09642f, -0.052715f, 0.145625f) + curveToRelative(-0.016254f, 0.04876f, -0.03119f, 0.09818f, -0.044808f, 0.14826f) + curveToRelative(-0.067211f, 0.245783f, -0.1038921f, 0.503866f, -0.1038921f, 0.770515f) + curveToRelative(0f, 0.948867f, 0.4544456f, 1.792963f, 1.1568705f, 2.327359f) + moveToRelative(-0.1208042f, 0.290371f) + curveToRelative(-0.8120278f, -0.586892f, -1.341592f, -1.54125f, -1.341592f, -2.61773f) + curveToRelative(0f, -0.274996f, 0.034704f, -0.542084f, 0.099719f, -0.797092f) + curveToRelative(-0.027016f, -0.000879f, -0.053813f, -0.0022f, -0.081049f, -0.0022f) + curveTo(3.2078281f, 11.945748f, 2f, 13.153796f, 2f, 14.638597f) + curveToRelative(0f, 1.484801f, 1.2078281f, 2.692848f, 2.6926287f, 2.692848f) + curveToRelative(0.5660253f, 0f, 1.0914163f, -0.175935f, 1.5252153f, -0.475312f) + curveToRelative(-0.1790107f, -0.277631f, -0.2833422f, -0.607757f, -0.2833422f, -0.961825f) + curveToRelative(0f, -0.185161f, 0.028334f, -0.363513f, 0.081049f, -0.531541f) + moveTo(6.3243718f, 9.9298462f) + curveTo(6.2079599f, 9.7257959f, 6.1407485f, 9.4903364f, 6.1407485f, 9.2392821f) + curveToRelative(0f, -0.7724916f, 0.6284045f, -1.4008961f, 1.4006766f, -1.4008961f) + curveToRelative(0.2857582f, 0f, 0.5515287f, 0.08654f, 0.7731505f, 0.233922f) + curveToRelative(-0.1645141f, 0.3709804f, -0.256765f, 0.7808381f, -0.256765f, 1.212221f) + curveToRelative(0f, 0.079512f, 0.00395f, 0.1579248f, 0.010104f, 0.2356791f) + curveToRelative(-0.054692f, -0.00264f, -0.1096029f, -0.00417f, -0.1649535f, -0.00417f) + curveToRelative(-0.5732736f, 0f, -1.1116236f, 0.1508961f, -1.578589f, 0.4138113f) + } +} + +val Icons.Rounded.Owncloud + get() = _Owncloud + +private val _Google = materialIcon("Icons.Rounded.Google") { + materialPath { + moveTo(2f, 12f) + curveTo(2f, 6.486f, 6.486f, 2f, 12f, 2f) + curveToRelative(2.22695f, 0f, 4.33476f, 0.716476f, 6.09562f, 2.072f) + lineTo(15.77181f, 7.09067f) + curveTo(14.68305f, 6.252571f, 13.37876f, 5.809524f, 12f, 5.809524f) + curveTo(8.58657f, 5.809524f, 5.809524f, 8.58657f, 5.809524f, 12f) + curveToRelative(0f, 3.41343f, 2.777046f, 6.19048f, 6.190476f, 6.19048f) + curveToRelative(2.74924f, 0f, 5.08552f, -1.80124f, 5.89067f, -4.28572f) + horizontalLineTo(12f) + verticalLineTo(10.09524f) + horizontalLineTo(22f) + verticalLineTo(12f) + curveTo(22f, 17.514f, 17.514f, 22f, 12f, 22f) + curveTo(6.486f, 22f, 2f, 17.514f, 2f, 12f) + close() + } +} + +val Icons.Rounded.Google + get() = _Google \ No newline at end of file diff --git a/core/i18n/src/main/res/values/strings.xml b/core/i18n/src/main/res/values/strings.xml index 1df2cb0b..0c5f23c5 100644 --- a/core/i18n/src/main/res/values/strings.xml +++ b/core/i18n/src/main/res/values/strings.xml @@ -510,6 +510,7 @@ Manage connected accounts and services Google Signed in as %1$s + Sign out You are currently not logged in Pentagon Wallpaper