Fix lint issues

This commit is contained in:
Jorge Martín 2024-08-12 12:41:04 +02:00
parent 7fd0ad09dc
commit 5239e5ce81
10 changed files with 17 additions and 12 deletions

View file

@ -66,7 +66,7 @@ class ResetIdentityFlowNode @AssistedInject constructor(
buildContext = buildContext,
plugins = plugins,
) {
interface Callback: Plugin {
interface Callback : Plugin {
fun onDone()
}

View file

@ -36,7 +36,6 @@ class ResetIdentityPasswordNode @AssistedInject constructor(
@Assisted plugins: List<Plugin>,
private val coroutineDispatchers: CoroutineDispatchers,
) : Node(buildContext, plugins = plugins) {
data class Inputs(val handle: IdentityPasswordResetHandle) : NodeInputs
private val presenter by lazy {

View file

@ -18,7 +18,6 @@ package io.element.android.features.securebackup.impl.reset.password
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
@ -58,7 +57,12 @@ fun ResetIdentityPasswordView(
title = stringResource(CommonStrings.screen_reset_encryption_password_title),
subTitle = stringResource(CommonStrings.screen_reset_encryption_password_subtitle),
onBackClick = onBack,
content = { Content(textFieldState = passwordState) },
content = {
Content(
text = passwordState.value,
onTextChange = { passwordState.value = it }
)
},
buttons = {
Button(
modifier = Modifier.fillMaxWidth(),
@ -80,14 +84,14 @@ fun ResetIdentityPasswordView(
}
@Composable
private fun Content(textFieldState: MutableState<String>) {
private fun Content(text: String, onTextChange: (String) -> Unit) {
var showPassword by remember { mutableStateOf(false) }
OutlinedTextField(
modifier = Modifier
.fillMaxWidth()
.onTabOrEnterKeyFocusNext(LocalFocusManager.current),
value = textFieldState.value,
onValueChange = { text -> textFieldState.value = text },
value = text,
onValueChange = onTextChange,
label = { Text(stringResource(CommonStrings.common_password)) },
placeholder = { Text(stringResource(CommonStrings.screen_reset_encryption_password_placeholder)) },
singleLine = true,

View file

@ -42,6 +42,7 @@ class ResetIdentityRootNode @AssistedInject constructor(
override fun View(modifier: Modifier) {
val state = presenter.present()
ResetIdentityRootView(
modifier = modifier,
state = state,
onContinue = callback::onContinue,
onBack = ::navigateUp,

View file

@ -47,8 +47,10 @@ fun ResetIdentityRootView(
state: ResetIdentityRootState,
onContinue: () -> Unit,
onBack: () -> Unit,
modifier: Modifier = Modifier,
) {
FlowStepPage(
modifier = modifier,
iconStyle = BigIcon.Style.AlertSolid,
title = stringResource(io.element.android.libraries.ui.strings.R.string.screen_encryption_reset_title),
subTitle = stringResource(io.element.android.libraries.ui.strings.R.string.screen_encryption_reset_subtitle),

View file

@ -23,7 +23,7 @@ import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.test.runTest
import org.junit.Test
class ResetIdentityRootPresenterTests {
class ResetIdentityRootPresenterTest {
@Test
fun `present - initial state`() = runTest {
val presenter = ResetIdentityRootPresenter()