-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edured-77: Authentication flow implemented.
Not available ATM: 1 - Multiple identities to select from 2 - Fallback when no network available: OTP via PIN 3 - Offer biometric upgrade when it wasn't asked for the current identity and biometric capabilities are available Known issue: showing dialogs for authentication failure
- Loading branch information
Iulia Stana
committed
Apr 6, 2023
1 parent
ba69eff
commit b0a7231
Showing
10 changed files
with
622 additions
and
33 deletions.
There are no files selected for viewing
This file contains 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 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
71 changes: 71 additions & 0 deletions
71
app/src/main/kotlin/nl/eduid/screens/authorize/AuthenticationCompletedScreen.kt
This file contains 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,71 @@ | ||
package nl.eduid.screens.authorize | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.wrapContentSize | ||
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 | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import nl.eduid.R | ||
import nl.eduid.ui.EduIdTopAppBar | ||
import nl.eduid.ui.PrimaryButton | ||
import nl.eduid.ui.theme.EduidAppAndroidTheme | ||
import nl.eduid.ui.theme.TextGreen | ||
|
||
@Composable | ||
fun AuthenticationCompletedScreen(goHome: () -> Unit = {}) = EduIdTopAppBar( | ||
withBackIcon = false | ||
) { | ||
Column(modifier = Modifier.fillMaxSize()) { | ||
Text( | ||
style = MaterialTheme.typography.titleLarge.copy( | ||
textAlign = TextAlign.Start, color = TextGreen | ||
), text = stringResource(R.string.authorize_title), modifier = Modifier.fillMaxWidth() | ||
) | ||
Column( | ||
modifier = Modifier.weight(1f), | ||
verticalArrangement = Arrangement.Center, | ||
horizontalAlignment = Alignment.CenterHorizontally | ||
) { | ||
Image( | ||
painter = painterResource(R.drawable.ic_authorize_confirmed), | ||
contentDescription = "", | ||
modifier = Modifier.wrapContentSize(), | ||
alignment = Alignment.Center | ||
) | ||
|
||
Text( | ||
text = stringResource(R.string.authorize_confirmed_subtitle), | ||
style = MaterialTheme.typography.titleLarge.copy( | ||
color = TextGreen | ||
), | ||
modifier = Modifier.fillMaxWidth(), | ||
textAlign = TextAlign.Center | ||
) | ||
} | ||
PrimaryButton( | ||
modifier = Modifier.fillMaxWidth(), | ||
text = stringResource(R.string.button_ok), | ||
onClick = goHome, | ||
) | ||
Spacer(Modifier.height(24.dp)) | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
private fun PreviewAuthorizeConfirmedScreen() = EduidAppAndroidTheme { | ||
AuthenticationCompletedScreen() | ||
} |
Oops, something went wrong.