Hello!
Please, add this widget to your DSL.
Thanks!
Now, with the new com.android.support:design:24.2.0 library, apps force close: java.lang.ClassCastException: android.widget.EditText cannot be cast to android.support.design.widget.TextInputEditText
Any workaround to use before TextInputEditText is added in anko @yanex ?
Define this somewhere:
inline fun ViewManager.textInputEditText() = textInputEditText {}
inline fun ViewManager.textInputEditText(theme: Int = 0, init: TextInputEditText.() -> Unit) = ankoView({ TextInputEditText(it) }, theme, init)
and you'll be able to write this:
textInputLayout {
textInputEditText {
...
}
}
@abond working perfectly, thanks for the help!
@abond Could you please elaborate ? Why does this work ?
@Rahulkr2 The principles of building DSL's in Kotlin well described in this article https://kotlinlang.org/docs/reference/type-safe-builders.html.
Reading it should help you understand how Anko DSL works.
how to make XML android.support.design.widget.TextInputEditText in kotlin?
Most helpful comment
Define this somewhere:
and you'll be able to write this: