Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class ExternalCredentialSkipFragment : Fragment(R.layout.fragment_external_crede
private fun initViews(credentialTypes: List<ExternalCredentialType>) = with(binding) {
mapOf(
title to IDR.string.mfid_skip_title,
skipReasonHasNumberNoId to IDR.string.mfid_skip_reason_has_number_no_id,
skipReasonDoesNotHaveDocument to IDR.string.mfid_skip_reason_does_not_have,
skipReasonDidNotBring to IDR.string.mfid_skip_reason_did_not_bring,
skipReasonIncorrect to IDR.string.mfid_skip_reason_incorrect,
Expand All @@ -67,7 +68,9 @@ class ExternalCredentialSkipFragment : Fragment(R.layout.fragment_external_crede
reasonTextInput.text.toString().isNotEmpty()
}

else -> true
else -> {
true
}
}
buttonSkip.isEnabled = isSkipButtonEnabled
}
Expand Down Expand Up @@ -95,6 +98,7 @@ class ExternalCredentialSkipFragment : Fragment(R.layout.fragment_external_crede
}

private fun viewIdToOption(checkedId: Int) = when (checkedId) {
R.id.skipReasonHasNumberNoId -> ExternalCredentialSelectionEvent.SkipReason.HAS_NUMBER_NO_ID
R.id.skipReasonDoesNotHaveDocument -> ExternalCredentialSelectionEvent.SkipReason.DOES_NOT_HAVE_ID
R.id.skipReasonDidNotBring -> ExternalCredentialSelectionEvent.SkipReason.DID_NOT_BRING_ID
R.id.skipReasonIncorrect -> ExternalCredentialSelectionEvent.SkipReason.BROUGHT_INCORRECT_ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<com.google.android.material.radiobutton.MaterialRadioButton
android:id="@+id/skipReasonHasNumberNoId"
style="@style/Widget.Simprints.RadioButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="Has number, no document (Booklet)" />

<com.google.android.material.radiobutton.MaterialRadioButton
android:id="@+id/skipReasonDoesNotHaveDocument"
style="@style/Widget.Simprints.RadioButton"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ internal data class ApiExternalCredentialSelectionPayload(

@Keep
enum class ApiExternalCredentialSkipReason {
HAS_NUMBER_NO_ID,
DOES_NOT_HAVE_ID,
DID_NOT_BRING_ID,
BROUGHT_INCORRECT_ID,
Expand All @@ -41,6 +42,7 @@ internal data class ApiExternalCredentialSelectionPayload(
}

internal fun SkipReason.toApiExternalCredentialSkipReason(): ApiExternalCredentialSkipReason = when (this) {
SkipReason.HAS_NUMBER_NO_ID -> ApiExternalCredentialSkipReason.HAS_NUMBER_NO_ID
SkipReason.DOES_NOT_HAVE_ID -> ApiExternalCredentialSkipReason.DOES_NOT_HAVE_ID
SkipReason.DID_NOT_BRING_ID -> ApiExternalCredentialSkipReason.DID_NOT_BRING_ID
SkipReason.BROUGHT_INCORRECT_ID -> ApiExternalCredentialSkipReason.BROUGHT_INCORRECT_ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ data class ExternalCredentialSelectionEvent(

@Keep
enum class SkipReason {
HAS_NUMBER_NO_ID,
DOES_NOT_HAVE_ID,
DID_NOT_BRING_ID,
BROUGHT_INCORRECT_ID,
Expand Down
1 change: 1 addition & 0 deletions infra/resources/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@

<string name="mfid_add_document_title">Add this %1$s?</string>
<string name="mfid_skip_title">Why did you skip the %1$s scan?</string>
<string name="mfid_skip_reason_has_number_no_id">Has number, no %1$s (Booklet)</string>
Comment thread
BurningAXE marked this conversation as resolved.
<string name="mfid_skip_reason_does_not_have">Does not have %1$s</string>
<string name="mfid_skip_reason_did_not_bring">Did not bring %1$s</string>
<string name="mfid_skip_reason_incorrect">Brought incorrect %1$s</string>
Expand Down