Fix some warnings
This commit is contained in:
parent
5fc04bd079
commit
710b2c52f1
8 changed files with 16 additions and 15 deletions
|
|
@ -95,7 +95,7 @@ class SetupPinPresenter @Inject constructor(
|
||||||
choosePinEntry = choosePinEntry,
|
choosePinEntry = choosePinEntry,
|
||||||
confirmPinEntry = confirmPinEntry,
|
confirmPinEntry = confirmPinEntry,
|
||||||
isConfirmationStep = isConfirmationStep,
|
isConfirmationStep = isConfirmationStep,
|
||||||
SetupPinFailure = setupPinFailure,
|
setupPinFailure = setupPinFailure,
|
||||||
appName = buildMeta.applicationName,
|
appName = buildMeta.applicationName,
|
||||||
eventSink = ::handleEvents
|
eventSink = ::handleEvents
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,10 @@ data class SetupPinState(
|
||||||
val choosePinEntry: PinEntry,
|
val choosePinEntry: PinEntry,
|
||||||
val confirmPinEntry: PinEntry,
|
val confirmPinEntry: PinEntry,
|
||||||
val isConfirmationStep: Boolean,
|
val isConfirmationStep: Boolean,
|
||||||
val SetupPinFailure: SetupPinFailure?,
|
val setupPinFailure: SetupPinFailure?,
|
||||||
val appName: String,
|
val appName: String,
|
||||||
val eventSink: (SetupPinEvents) -> Unit
|
val eventSink: (SetupPinEvents) -> Unit
|
||||||
) {
|
) {
|
||||||
val pinSize = choosePinEntry.size
|
|
||||||
val activePinEntry = if (isConfirmationStep) {
|
val activePinEntry = if (isConfirmationStep) {
|
||||||
confirmPinEntry
|
confirmPinEntry
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ fun aSetupPinState(
|
||||||
choosePinEntry = choosePinEntry,
|
choosePinEntry = choosePinEntry,
|
||||||
confirmPinEntry = confirmPinEntry,
|
confirmPinEntry = confirmPinEntry,
|
||||||
isConfirmationStep = isConfirmationStep,
|
isConfirmationStep = isConfirmationStep,
|
||||||
SetupPinFailure = creationFailure,
|
setupPinFailure = creationFailure,
|
||||||
appName = "Element",
|
appName = "Element",
|
||||||
eventSink = {}
|
eventSink = {}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -114,11 +114,11 @@ private fun SetupPinContent(
|
||||||
.padding(top = 36.dp)
|
.padding(top = 36.dp)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
)
|
)
|
||||||
if (state.SetupPinFailure != null) {
|
if (state.setupPinFailure != null) {
|
||||||
ErrorDialog(
|
ErrorDialog(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
title = state.SetupPinFailure.title(),
|
title = state.setupPinFailure.title(),
|
||||||
content = state.SetupPinFailure.content(),
|
content = state.setupPinFailure.content(),
|
||||||
onDismiss = {
|
onDismiss = {
|
||||||
state.eventSink(SetupPinEvents.ClearFailure)
|
state.eventSink(SetupPinEvents.ClearFailure)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ import kotlinx.coroutines.flow.StateFlow
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
private const val GRACE_PERIOD_IN_MILLIS = 90 * 1000L
|
//private const val GRACE_PERIOD_IN_MILLIS = 90 * 1000L
|
||||||
|
|
||||||
@SingleIn(AppScope::class)
|
@SingleIn(AppScope::class)
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
|
|
|
||||||
|
|
@ -127,9 +127,9 @@ fun PinUnlockView(
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun PinUnlockCompactView(
|
fun PinUnlockCompactView(
|
||||||
modifier: Modifier = Modifier,
|
|
||||||
header: @Composable () -> Unit,
|
header: @Composable () -> Unit,
|
||||||
footer: @Composable () -> Unit,
|
footer: @Composable () -> Unit,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
content: @Composable BoxWithConstraintsScope.() -> Unit,
|
content: @Composable BoxWithConstraintsScope.() -> Unit,
|
||||||
) {
|
) {
|
||||||
Row(modifier = modifier) {
|
Row(modifier = modifier) {
|
||||||
|
|
@ -151,9 +151,9 @@ fun PinUnlockCompactView(
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun PinUnlockExpandedView(
|
fun PinUnlockExpandedView(
|
||||||
modifier: Modifier = Modifier,
|
|
||||||
header: @Composable () -> Unit,
|
header: @Composable () -> Unit,
|
||||||
footer: @Composable () -> Unit,
|
footer: @Composable () -> Unit,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
content: @Composable BoxWithConstraintsScope.() -> Unit,
|
content: @Composable BoxWithConstraintsScope.() -> Unit,
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,8 @@ import io.element.android.libraries.designsystem.preview.PreviewsDayNight
|
||||||
import io.element.android.libraries.designsystem.text.toSp
|
import io.element.android.libraries.designsystem.text.toSp
|
||||||
import io.element.android.libraries.designsystem.theme.components.Icon
|
import io.element.android.libraries.designsystem.theme.components.Icon
|
||||||
import io.element.android.libraries.theme.ElementTheme
|
import io.element.android.libraries.theme.ElementTheme
|
||||||
|
import kotlinx.collections.immutable.ImmutableList
|
||||||
|
import kotlinx.collections.immutable.persistentListOf
|
||||||
|
|
||||||
private val spaceBetweenPinKey = 8.dp
|
private val spaceBetweenPinKey = 8.dp
|
||||||
private val maxSizePinKey = 80.dp
|
private val maxSizePinKey = 80.dp
|
||||||
|
|
@ -74,28 +76,28 @@ fun PinKeypad(
|
||||||
pinKeySize = pinKeySize,
|
pinKeySize = pinKeySize,
|
||||||
verticalAlignment = verticalAlignment,
|
verticalAlignment = verticalAlignment,
|
||||||
horizontalArrangement = horizontalArrangement,
|
horizontalArrangement = horizontalArrangement,
|
||||||
models = listOf(PinKeypadModel.Number('1'), PinKeypadModel.Number('2'), PinKeypadModel.Number('3')),
|
models = persistentListOf(PinKeypadModel.Number('1'), PinKeypadModel.Number('2'), PinKeypadModel.Number('3')),
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
)
|
)
|
||||||
PinKeypadRow(
|
PinKeypadRow(
|
||||||
pinKeySize = pinKeySize,
|
pinKeySize = pinKeySize,
|
||||||
verticalAlignment = verticalAlignment,
|
verticalAlignment = verticalAlignment,
|
||||||
horizontalArrangement = horizontalArrangement,
|
horizontalArrangement = horizontalArrangement,
|
||||||
models = listOf(PinKeypadModel.Number('4'), PinKeypadModel.Number('5'), PinKeypadModel.Number('6')),
|
models = persistentListOf(PinKeypadModel.Number('4'), PinKeypadModel.Number('5'), PinKeypadModel.Number('6')),
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
)
|
)
|
||||||
PinKeypadRow(
|
PinKeypadRow(
|
||||||
pinKeySize = pinKeySize,
|
pinKeySize = pinKeySize,
|
||||||
verticalAlignment = verticalAlignment,
|
verticalAlignment = verticalAlignment,
|
||||||
horizontalArrangement = horizontalArrangement,
|
horizontalArrangement = horizontalArrangement,
|
||||||
models = listOf(PinKeypadModel.Number('7'), PinKeypadModel.Number('8'), PinKeypadModel.Number('9')),
|
models = persistentListOf(PinKeypadModel.Number('7'), PinKeypadModel.Number('8'), PinKeypadModel.Number('9')),
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
)
|
)
|
||||||
PinKeypadRow(
|
PinKeypadRow(
|
||||||
pinKeySize = pinKeySize,
|
pinKeySize = pinKeySize,
|
||||||
verticalAlignment = verticalAlignment,
|
verticalAlignment = verticalAlignment,
|
||||||
horizontalArrangement = horizontalArrangement,
|
horizontalArrangement = horizontalArrangement,
|
||||||
models = listOf(PinKeypadModel.Empty, PinKeypadModel.Number('0'), PinKeypadModel.Back),
|
models = persistentListOf(PinKeypadModel.Empty, PinKeypadModel.Number('0'), PinKeypadModel.Back),
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -103,7 +105,7 @@ fun PinKeypad(
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun PinKeypadRow(
|
private fun PinKeypadRow(
|
||||||
models: List<PinKeypadModel>,
|
models: ImmutableList<PinKeypadModel>,
|
||||||
onClick: (PinKeypadModel) -> Unit,
|
onClick: (PinKeypadModel) -> Unit,
|
||||||
pinKeySize: Dp,
|
pinKeySize: Dp,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue