Fix some warnings

This commit is contained in:
ganfra
2023-10-20 20:38:27 +02:00
parent 5fc04bd079
commit 710b2c52f1
8 changed files with 16 additions and 15 deletions

View File

@@ -95,7 +95,7 @@ class SetupPinPresenter @Inject constructor(
choosePinEntry = choosePinEntry,
confirmPinEntry = confirmPinEntry,
isConfirmationStep = isConfirmationStep,
SetupPinFailure = setupPinFailure,
setupPinFailure = setupPinFailure,
appName = buildMeta.applicationName,
eventSink = ::handleEvents
)

View File

@@ -23,11 +23,10 @@ data class SetupPinState(
val choosePinEntry: PinEntry,
val confirmPinEntry: PinEntry,
val isConfirmationStep: Boolean,
val SetupPinFailure: SetupPinFailure?,
val setupPinFailure: SetupPinFailure?,
val appName: String,
val eventSink: (SetupPinEvents) -> Unit
) {
val pinSize = choosePinEntry.size
val activePinEntry = if (isConfirmationStep) {
confirmPinEntry
} else {

View File

@@ -54,7 +54,7 @@ fun aSetupPinState(
choosePinEntry = choosePinEntry,
confirmPinEntry = confirmPinEntry,
isConfirmationStep = isConfirmationStep,
SetupPinFailure = creationFailure,
setupPinFailure = creationFailure,
appName = "Element",
eventSink = {}
)

View File

@@ -114,11 +114,11 @@ private fun SetupPinContent(
.padding(top = 36.dp)
.fillMaxWidth()
)
if (state.SetupPinFailure != null) {
if (state.setupPinFailure != null) {
ErrorDialog(
modifier = modifier,
title = state.SetupPinFailure.title(),
content = state.SetupPinFailure.content(),
title = state.setupPinFailure.title(),
content = state.setupPinFailure.content(),
onDismiss = {
state.eventSink(SetupPinEvents.ClearFailure)
}

View File

@@ -30,7 +30,7 @@ import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.launch
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)
@ContributesBinding(AppScope::class)

View File

@@ -127,9 +127,9 @@ fun PinUnlockView(
@Composable
fun PinUnlockCompactView(
modifier: Modifier = Modifier,
header: @Composable () -> Unit,
footer: @Composable () -> Unit,
modifier: Modifier = Modifier,
content: @Composable BoxWithConstraintsScope.() -> Unit,
) {
Row(modifier = modifier) {
@@ -151,9 +151,9 @@ fun PinUnlockCompactView(
@Composable
fun PinUnlockExpandedView(
modifier: Modifier = Modifier,
header: @Composable () -> Unit,
footer: @Composable () -> Unit,
modifier: Modifier = Modifier,
content: @Composable BoxWithConstraintsScope.() -> Unit,
) {
Column(

View File

@@ -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.theme.components.Icon
import io.element.android.libraries.theme.ElementTheme
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.persistentListOf
private val spaceBetweenPinKey = 8.dp
private val maxSizePinKey = 80.dp
@@ -74,28 +76,28 @@ fun PinKeypad(
pinKeySize = pinKeySize,
verticalAlignment = verticalAlignment,
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,
)
PinKeypadRow(
pinKeySize = pinKeySize,
verticalAlignment = verticalAlignment,
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,
)
PinKeypadRow(
pinKeySize = pinKeySize,
verticalAlignment = verticalAlignment,
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,
)
PinKeypadRow(
pinKeySize = pinKeySize,
verticalAlignment = verticalAlignment,
horizontalArrangement = horizontalArrangement,
models = listOf(PinKeypadModel.Empty, PinKeypadModel.Number('0'), PinKeypadModel.Back),
models = persistentListOf(PinKeypadModel.Empty, PinKeypadModel.Number('0'), PinKeypadModel.Back),
onClick = onClick,
)
}
@@ -103,7 +105,7 @@ fun PinKeypad(
@Composable
private fun PinKeypadRow(
models: List<PinKeypadModel>,
models: ImmutableList<PinKeypadModel>,
onClick: (PinKeypadModel) -> Unit,
pinKeySize: Dp,
modifier: Modifier = Modifier,