|
| 1 | +package to.bitkit.ui.onboarding |
| 2 | + |
| 3 | +import androidx.compose.foundation.Image |
| 4 | +import androidx.compose.foundation.layout.Column |
| 5 | +import androidx.compose.foundation.layout.Spacer |
| 6 | +import androidx.compose.foundation.layout.fillMaxSize |
| 7 | +import androidx.compose.foundation.layout.fillMaxWidth |
| 8 | +import androidx.compose.foundation.layout.height |
| 9 | +import androidx.compose.foundation.layout.padding |
| 10 | +import androidx.compose.foundation.layout.size |
| 11 | +import androidx.compose.material.icons.Icons |
| 12 | +import androidx.compose.material.icons.automirrored.filled.ArrowBack |
| 13 | +import androidx.compose.material3.ExperimentalMaterial3Api |
| 14 | +import androidx.compose.material3.Icon |
| 15 | +import androidx.compose.material3.IconButton |
| 16 | +import androidx.compose.material3.TopAppBar |
| 17 | +import androidx.compose.runtime.Composable |
| 18 | +import androidx.compose.ui.Modifier |
| 19 | +import androidx.compose.ui.layout.ContentScale |
| 20 | +import androidx.compose.ui.res.painterResource |
| 21 | +import androidx.compose.ui.res.stringResource |
| 22 | +import androidx.compose.ui.tooling.preview.Preview |
| 23 | +import androidx.compose.ui.unit.dp |
| 24 | +import to.bitkit.R |
| 25 | +import to.bitkit.ui.components.BodyM |
| 26 | +import to.bitkit.ui.components.Display |
| 27 | +import to.bitkit.ui.components.PrimaryButton |
| 28 | +import to.bitkit.ui.theme.AppThemeSurface |
| 29 | +import to.bitkit.ui.theme.Colors |
| 30 | +import to.bitkit.ui.utils.withAccent |
| 31 | + |
| 32 | +@OptIn(ExperimentalMaterial3Api::class) |
| 33 | +@Composable |
| 34 | +fun WarningMultipleDevicesScreen( |
| 35 | + onBackClick: () -> Unit, |
| 36 | + onConfirmClick: () -> Unit, |
| 37 | +) { |
| 38 | + |
| 39 | + Column( |
| 40 | + modifier = Modifier.fillMaxSize() |
| 41 | + ) { |
| 42 | + |
| 43 | + TopAppBar( |
| 44 | + title = {}, |
| 45 | + navigationIcon = { |
| 46 | + IconButton(onClick = onBackClick) { |
| 47 | + Icon( |
| 48 | + imageVector = Icons.AutoMirrored.Default.ArrowBack, |
| 49 | + contentDescription = stringResource(R.string.back), |
| 50 | + modifier = Modifier.size(24.dp) |
| 51 | + ) |
| 52 | + } |
| 53 | + }, |
| 54 | + ) |
| 55 | + |
| 56 | + Column( |
| 57 | + modifier = Modifier |
| 58 | + .fillMaxSize() |
| 59 | + .padding(horizontal = 32.dp) |
| 60 | + ) { |
| 61 | + Image( |
| 62 | + painter = painterResource(id = R.drawable.phone), |
| 63 | + contentDescription = null, |
| 64 | + contentScale = ContentScale.Fit, |
| 65 | + modifier = Modifier |
| 66 | + .fillMaxWidth() |
| 67 | + .weight(1f) |
| 68 | + ) |
| 69 | + |
| 70 | + Display( |
| 71 | + text = stringResource(R.string.onboarding__multiple_header).withAccent(accentColor = Colors.Yellow), |
| 72 | + ) |
| 73 | + |
| 74 | + Spacer(modifier = Modifier.height(8.dp)) |
| 75 | + |
| 76 | + BodyM( |
| 77 | + text = stringResource(R.string.onboarding__multiple_text), |
| 78 | + color = Colors.White64, |
| 79 | + ) |
| 80 | + |
| 81 | + Spacer(modifier = Modifier.height(32.dp)) |
| 82 | + |
| 83 | + PrimaryButton( |
| 84 | + text = stringResource(R.string.common__understood), |
| 85 | + onClick = onConfirmClick, |
| 86 | + ) |
| 87 | + |
| 88 | + Spacer(modifier = Modifier.height(24.dp)) |
| 89 | + } |
| 90 | + } |
| 91 | +} |
| 92 | + |
| 93 | + |
| 94 | +@Preview(showBackground = true) |
| 95 | +@Composable |
| 96 | +private fun Preview() { |
| 97 | + AppThemeSurface { |
| 98 | + WarningMultipleDevicesScreen( |
| 99 | + onBackClick = {}, |
| 100 | + onConfirmClick = {} |
| 101 | + ) |
| 102 | + } |
| 103 | +} |
0 commit comments