-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Securing screen #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a8b2de8
feat: Add SecuringAccountScreen with empty viewmodel
baillyjamy 97e1393
feat: Add magic function on viewmodel to skip screen
baillyjamy 91453f5
feat: Add PersonKAuthAuthenticator illustration
baillyjamy f4b6b18
fix: Apply clear navigation when launch HomeScreen
baillyjamy 3dcca75
chore: Use updated core branch
baillyjamy d006169
fix: Apply review comment
baillyjamy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
.../com/infomaniak/auth/ui/images/illus/personKAuthAuthenticator/PersonKAuthAuthenticator.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| /* | ||
| * Infomaniak Authenticator - Android | ||
| * Copyright (C) 2026 Infomaniak Network SA | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
| package com.infomaniak.auth.ui.images.illus.personKAuthAuthenticator | ||
|
|
||
| import androidx.compose.foundation.Image | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.size | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import com.infomaniak.auth.ui.images.AppImages | ||
| import com.infomaniak.auth.ui.images.AppImages.AppIllus | ||
| import com.infomaniak.auth.ui.theme.AuthenticatorTheme | ||
| import com.infomaniak.core.ui.compose.preview.PreviewLightAndDark | ||
| import com.infomaniak.core.ui.compose.theme.ThemedImage | ||
|
|
||
| @Suppress("UnusedReceiverParameter") | ||
| val AppIllus.PersonKAuthAuthenticator: ThemedImage | ||
| get() = _personKAuthAuthenticator ?: object : ThemedImage { | ||
| override val light = AppIllus.PersonKAuthAuthenticatorLight | ||
| override val dark = AppIllus.PersonKAuthAuthenticatorDark | ||
| }.also { _personKAuthAuthenticator = it } | ||
|
|
||
| private var _personKAuthAuthenticator: ThemedImage? = null | ||
|
|
||
| @PreviewLightAndDark | ||
| @Composable | ||
| private fun Preview() { | ||
| AuthenticatorTheme { | ||
| Box { | ||
| Image( | ||
| imageVector = AppIllus.PersonKAuthAuthenticator.image(), | ||
| contentDescription = null, | ||
| modifier = Modifier.size(AppImages.previewSize), | ||
| ) | ||
| } | ||
| } | ||
| } |
885 changes: 885 additions & 0 deletions
885
.../infomaniak/auth/ui/images/illus/personKAuthAuthenticator/PersonKAuthAuthenticatorDark.kt
Large diffs are not rendered by default.
Oops, something went wrong.
885 changes: 885 additions & 0 deletions
885
...infomaniak/auth/ui/images/illus/personKAuthAuthenticator/PersonKAuthAuthenticatorLight.kt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
app/src/main/kotlin/com/infomaniak/auth/ui/screen/securingaccount/SecuringAccountScreen.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| /* | ||
| * Infomaniak Authenticator - Android | ||
| * Copyright (C) 2026 Infomaniak Network SA | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
| package com.infomaniak.auth.ui.screen.securingaccount | ||
|
|
||
| import androidx.compose.foundation.clickable | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.fillMaxHeight | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.rememberScrollState | ||
| import androidx.compose.foundation.verticalScroll | ||
| import androidx.compose.material3.LinearProgressIndicator | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.LaunchedEffect | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.res.stringResource | ||
| import androidx.lifecycle.viewmodel.compose.viewModel | ||
| import com.infomaniak.auth.R | ||
| import com.infomaniak.auth.ui.components.IllustrationWithHalo | ||
| import com.infomaniak.auth.ui.components.InfomaniakAuthenticatorTopAppBar | ||
| import com.infomaniak.auth.ui.images.AppImages | ||
| import com.infomaniak.auth.ui.images.illus.infomaniakValidated.InfomaniakValidated | ||
| import com.infomaniak.auth.ui.images.illus.personKAuthAuthenticator.PersonKAuthAuthenticator | ||
| import com.infomaniak.auth.ui.theme.AuthenticatorTheme | ||
| import com.infomaniak.core.ui.compose.bottomstickybuttonscaffolds.SinglePaneScaffold | ||
| import com.infomaniak.core.ui.compose.margin.Margin | ||
| import com.infomaniak.core.ui.compose.preview.PreviewSmallWindow | ||
|
|
||
| @Composable | ||
| fun SecuringAccountScreen( | ||
| viewModel: SecuringAccountViewModel = viewModel(), | ||
| onFinish: () -> Unit | ||
| ) { | ||
| LaunchedEffect(viewModel) { | ||
| viewModel.doMagicThing(onFinish) | ||
| } | ||
|
|
||
| SinglePaneScaffold( | ||
| topBar = { | ||
| InfomaniakAuthenticatorTopAppBar() | ||
| } | ||
| ) { | ||
| Column( | ||
| modifier = Modifier | ||
| .fillMaxHeight() | ||
| .verticalScroll(rememberScrollState()) | ||
| // TODO[ik-auth]: Remove this when magic thing become not magic | ||
| .clickable(onClick = onFinish), | ||
| horizontalAlignment = Alignment.CenterHorizontally, | ||
| verticalArrangement = Arrangement.Center, | ||
| ) { | ||
| IllustrationWithHalo(AppImages.AppIllus.PersonKAuthAuthenticator) | ||
| Text(text = stringResource(R.string.onBoardingSecuringAccount)) | ||
| Spacer(modifier = Modifier.padding(Margin.Medium)) | ||
| LinearProgressIndicator() | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @PreviewSmallWindow | ||
| @Composable | ||
| fun SecuringAccountScreenPreview() { | ||
| AuthenticatorTheme { | ||
| SecuringAccountScreen(onFinish = { }) | ||
| } | ||
| } |
37 changes: 37 additions & 0 deletions
37
...src/main/kotlin/com/infomaniak/auth/ui/screen/securingaccount/SecuringAccountViewModel.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /* | ||
| * Infomaniak Authenticator - Android | ||
| * Copyright (C) 2026 Infomaniak Network SA | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
| package com.infomaniak.auth.ui.screen.securingaccount | ||
|
|
||
| import androidx.lifecycle.ViewModel | ||
| import dagger.hilt.android.lifecycle.HiltViewModel | ||
| import javax.inject.Inject | ||
| import kotlinx.coroutines.flow.MutableStateFlow | ||
| import kotlinx.coroutines.flow.asStateFlow | ||
| import kotlinx.coroutines.launch | ||
| import androidx.lifecycle.viewModelScope | ||
| import kotlinx.coroutines.delay | ||
|
|
||
| @HiltViewModel | ||
| class SecuringAccountViewModel @Inject constructor() : ViewModel() { | ||
| fun doMagicThing(onFinish: () -> Unit) { | ||
| viewModelScope.launch { | ||
| delay(5000L) | ||
| onFinish() | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.