Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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),
)
}
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ sealed interface NavDestination : NavKey {
@Serializable
data object Onboarding : NavDestination

@Serializable
data object SecuringAccount : NavDestination

@Serializable
data object Ready : NavDestination
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,27 @@ import androidx.navigation3.runtime.entryProvider
import com.infomaniak.auth.ui.screen.home.HomeScreen
import com.infomaniak.auth.ui.screen.onboarding.OnboardingScreen
import com.infomaniak.auth.ui.screen.ready.ReadyScreen
import com.infomaniak.auth.ui.screen.securingaccount.SecuringAccountScreen

fun baseEntryProvider(backStack: NavBackStack<NavKey>): (NavKey) -> NavEntry<NavKey> = entryProvider {
entry<NavDestination.Home> {
HomeScreen()
}
entry<NavDestination.Onboarding> {
OnboardingScreen(
onLogin = { backStack.add(NavDestination.Ready) },
onLogin = { backStack.add(NavDestination.SecuringAccount) },
onCreateAccount = {}
)
}
entry<NavDestination.SecuringAccount> {
SecuringAccountScreen(
onFinish = { backStack.add(NavDestination.Ready) }
)
}
entry<NavDestination.Ready> {
ReadyScreen(
navigateToHome = {
//backStack.clear()
backStack.clear()
backStack.add(NavDestination.Home)
}
)
Expand Down
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 = { })
}
}
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()
}
}
}
Loading