diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputButton.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputButton.kt index 216f54e3fd..aeb6919321 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputButton.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputButton.kt @@ -16,10 +16,10 @@ class InputButton() : Element() { override fun addToLayout(root: LinearLayout) { root.addView( - Button(root.context).apply { - text = text - setOnClickListener { runnable?.run() } - gravity = Gravity.CENTER_HORIZONTAL + Button(root.context).also { + it.text = text + it.setOnClickListener { runnable?.run() } + it.gravity = Gravity.CENTER_HORIZONTAL }) } } \ No newline at end of file