Привет, я новичок в kotlin и MVVM и хотел бы перейти на него, но у меня есть несколько проблем с привязкой некоторых библиотек, которые мне нравились, когда я кодировал в MVP android - java вот здесь.
Я использую эту библиотеку с открытым исходным кодом для своего пин-кода https://github.com/poovamraj/PinEditTextField
Как я могу привязать onTextCompleteListener к моему xml?
val linePinField = findViewById<LinePinField>(R.id.pf_input_passcode_lineField)
linePinField.onTextCompleteListener = object : OnTextCompleteListener {
override fun onTextComplete(@NotNull enteredText: String): Boolean {
// toast(enteredText)
return true // Return true to keep the keyboard open else return false to close the keyboard
}
}
Вот мой XML
<com.poovam.pinedittextfield.LinePinField
android:id="@+id/pf_input_passcode_lineField"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:inputType="text"
android:textSelectHandle="@drawable/text_handle"
android:textSize="25sp"
app:distanceInBetween="5sp"
app:highlightColor="@color/colorAccent"
app:highlightEnabled="true"
app:highlightType="currentField"
app:isCursorEnabled="true"
app:lineThickness="1sp"
app:noOfFields="6" />
Пожалуйста, помогите / проведите меня: (