Compare commits

..

2 commits

Author SHA1 Message Date
b2abe5ee84 ui: wizard: Make download details nullable
All checks were successful
/ build-debug (push) Successful in 5m11s
2024-11-20 21:03:42 -05:00
67c9612627 ui: wizard: Restrict inputs to single lines 2024-11-20 21:00:50 -05:00
3 changed files with 15 additions and 9 deletions

View file

@ -19,9 +19,9 @@ class DownloadWizardActivity: BaseEuiccAccessActivity() {
var currentStepFragmentClassName: String?,
var selectedLogicalSlot: Int,
var smdp: String,
var matchingId: String,
var confirmationCode: String,
var imei: String,
var matchingId: String?,
var confirmationCode: String?,
var imei: String?,
)
private lateinit var state: DownloadWizardState
@ -53,9 +53,9 @@ class DownloadWizardActivity: BaseEuiccAccessActivity() {
null,
intent.getIntExtra("selectedLogicalSlot", 0),
"",
"",
"",
""
null,
null,
null
)
progressBar = requireViewById(R.id.progress)

View file

@ -24,9 +24,10 @@ class DownloadWizardDetailsFragment : DownloadWizardActivity.DownloadWizardStepF
override fun beforeNext() {
state.smdp = smdp.editText!!.text.toString().trim()
state.matchingId = matchingId.editText!!.text.toString().trim()
state.confirmationCode = confirmationCode.editText!!.text.toString().trim()
state.imei = imei.editText!!.text.toString()
// Treat empty inputs as null -- this is important for the download step
state.matchingId = matchingId.editText!!.text.toString().trim().ifBlank { null }
state.confirmationCode = confirmationCode.editText!!.text.toString().trim().ifBlank { null }
state.imei = imei.editText!!.text.toString().ifBlank { null }
}
override fun createNextFragment(): DownloadWizardActivity.DownloadWizardStepFragment =

View file

@ -32,6 +32,8 @@
android:hint="@string/profile_download_server">
<com.google.android.material.textfield.TextInputEditText
android:maxLines="1"
android:inputType="text"
android:layout_width="match_parent"
android:layout_height="match_parent" />
@ -44,6 +46,7 @@
android:hint="@string/profile_download_code">
<com.google.android.material.textfield.TextInputEditText
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="textPassword" />
@ -57,6 +60,7 @@
android:hint="@string/profile_download_confirmation_code">
<com.google.android.material.textfield.TextInputEditText
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="textPassword" />
@ -73,6 +77,7 @@
app:passwordToggleEnabled="true">
<com.google.android.material.textfield.TextInputEditText
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="textPassword" />