Skip to content

Commit 12d0f42

Browse files
author
Justin Kirk
committed
Fix DeSugaring in Instrumented test. Using "apply" does work in the example app. Using the DSL is preferred.
1 parent cd1c573 commit 12d0f42

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

form/src/androidTest/java/com/thejuki/kformmaster/FormActivityTest.kt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -235,18 +235,17 @@ class FormActivityTest : AppCompatActivity() {
235235
}
236236
}
237237

238-
val disabledButton = FormButtonElement(Disabled.ordinal).apply {
239-
value = "Disabled Button"
240-
visible = true
241-
enabled = false
242-
addValueObserver { _, _ ->
243-
val confirmAlert = AlertDialog.Builder(this@FormActivityTest).create()
244-
confirmAlert.setTitle("Disabled?")
245-
confirmAlert.setButton(AlertDialog.BUTTON_POSITIVE, this@FormActivityTest.getString(android.R.string.ok)) { _, _ ->
238+
val disabledButton = FormButtonElement(Disabled.ordinal)
239+
disabledButton.value = "Disabled Button"
240+
disabledButton.visible = true
241+
disabledButton.enabled = false
242+
disabledButton.addValueObserver { _, _ ->
243+
val confirmAlert = AlertDialog.Builder(this@FormActivityTest).create()
244+
confirmAlert.setTitle("Disabled?")
245+
confirmAlert.setButton(AlertDialog.BUTTON_POSITIVE, this@FormActivityTest.getString(android.R.string.ok)) { _, _ ->
246246

247-
}
248-
confirmAlert.show()
249247
}
248+
confirmAlert.show()
250249
}
251250

252251
formBuilder.addFormElement(disabledButton)

0 commit comments

Comments
 (0)