mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 01:19:33 +00:00
Some renaming.
This commit is contained in:
+2
-2
@@ -76,7 +76,7 @@ class SetupPinPresenter @Inject constructor(
|
|||||||
if (confirmPinEntry == choosePinEntry) {
|
if (confirmPinEntry == choosePinEntry) {
|
||||||
pinCodeManager.createPinCode(confirmPinEntry.toText())
|
pinCodeManager.createPinCode(confirmPinEntry.toText())
|
||||||
} else {
|
} else {
|
||||||
setupPinFailure = SetupPinFailure.PinsDontMatch
|
setupPinFailure = SetupPinFailure.PinsDoNotMatch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ class SetupPinPresenter @Inject constructor(
|
|||||||
}
|
}
|
||||||
SetupPinEvents.ClearFailure -> {
|
SetupPinEvents.ClearFailure -> {
|
||||||
when (setupPinFailure) {
|
when (setupPinFailure) {
|
||||||
is SetupPinFailure.PinsDontMatch -> {
|
is SetupPinFailure.PinsDoNotMatch -> {
|
||||||
choosePinEntry = choosePinEntry.clear()
|
choosePinEntry = choosePinEntry.clear()
|
||||||
confirmPinEntry = confirmPinEntry.clear()
|
confirmPinEntry = confirmPinEntry.clear()
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@ open class SetupPinStateProvider : PreviewParameterProvider<SetupPinState> {
|
|||||||
choosePinEntry = PinEntry.createEmpty(4).fillWith("1789"),
|
choosePinEntry = PinEntry.createEmpty(4).fillWith("1789"),
|
||||||
confirmPinEntry = PinEntry.createEmpty(4).fillWith("1788"),
|
confirmPinEntry = PinEntry.createEmpty(4).fillWith("1788"),
|
||||||
isConfirmationStep = true,
|
isConfirmationStep = true,
|
||||||
creationFailure = SetupPinFailure.PinsDontMatch
|
creationFailure = SetupPinFailure.PinsDoNotMatch
|
||||||
),
|
),
|
||||||
aSetupPinState(
|
aSetupPinState(
|
||||||
choosePinEntry = PinEntry.createEmpty(4).fillWith("1111"),
|
choosePinEntry = PinEntry.createEmpty(4).fillWith("1111"),
|
||||||
|
|||||||
+2
-2
@@ -136,7 +136,7 @@ private fun SetupPinContent(
|
|||||||
private fun SetupPinFailure.content(): String {
|
private fun SetupPinFailure.content(): String {
|
||||||
return when (this) {
|
return when (this) {
|
||||||
SetupPinFailure.ForbiddenPin -> stringResource(id = R.string.screen_app_lock_setup_pin_forbidden_dialog_content)
|
SetupPinFailure.ForbiddenPin -> stringResource(id = R.string.screen_app_lock_setup_pin_forbidden_dialog_content)
|
||||||
SetupPinFailure.PinsDontMatch -> stringResource(id = R.string.screen_app_lock_setup_pin_mismatch_dialog_content)
|
SetupPinFailure.PinsDoNotMatch -> stringResource(id = R.string.screen_app_lock_setup_pin_mismatch_dialog_content)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ private fun SetupPinFailure.content(): String {
|
|||||||
private fun SetupPinFailure.title(): String {
|
private fun SetupPinFailure.title(): String {
|
||||||
return when (this) {
|
return when (this) {
|
||||||
SetupPinFailure.ForbiddenPin -> stringResource(id = R.string.screen_app_lock_setup_pin_forbidden_dialog_title)
|
SetupPinFailure.ForbiddenPin -> stringResource(id = R.string.screen_app_lock_setup_pin_forbidden_dialog_title)
|
||||||
SetupPinFailure.PinsDontMatch -> stringResource(id = R.string.screen_app_lock_setup_pin_mismatch_dialog_title)
|
SetupPinFailure.PinsDoNotMatch -> stringResource(id = R.string.screen_app_lock_setup_pin_mismatch_dialog_title)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -18,5 +18,5 @@ package io.element.android.features.lockscreen.impl.setup.pin.validation
|
|||||||
|
|
||||||
sealed interface SetupPinFailure {
|
sealed interface SetupPinFailure {
|
||||||
data object ForbiddenPin : SetupPinFailure
|
data object ForbiddenPin : SetupPinFailure
|
||||||
data object PinsDontMatch : SetupPinFailure
|
data object PinsDoNotMatch : SetupPinFailure
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -89,7 +89,7 @@ class SetupPinPresenterTest {
|
|||||||
awaitLastSequentialItem().also { state ->
|
awaitLastSequentialItem().also { state ->
|
||||||
state.choosePinEntry.assertText(completePin)
|
state.choosePinEntry.assertText(completePin)
|
||||||
state.confirmPinEntry.assertText(mismatchedPin)
|
state.confirmPinEntry.assertText(mismatchedPin)
|
||||||
assertThat(state.setupPinFailure).isEqualTo(SetupPinFailure.PinsDontMatch)
|
assertThat(state.setupPinFailure).isEqualTo(SetupPinFailure.PinsDoNotMatch)
|
||||||
state.eventSink(SetupPinEvents.ClearFailure)
|
state.eventSink(SetupPinEvents.ClearFailure)
|
||||||
}
|
}
|
||||||
awaitLastSequentialItem().also { state ->
|
awaitLastSequentialItem().also { state ->
|
||||||
|
|||||||
Reference in New Issue
Block a user