Skip to content

Instantly share code, notes, and snippets.

@Nublo
Created July 23, 2019 10:03
Show Gist options
  • Save Nublo/320e3291580fc71af9d970f1a7c58dce to your computer and use it in GitHub Desktop.
Save Nublo/320e3291580fc71af9d970f1a7c58dce to your computer and use it in GitHub Desktop.
private fun createActualInput(lengthCount: Int) = EditText(context)
.apply {
inputType = InputType.TYPE_CLASS_NUMBER
isClickable = false
maxHeight = 0
maxWidth = 0
alpha = 0F
addOrUpdateFilter(InputFilter.LengthFilter(lengthCount))
}
private fun createPinItems(count: Int) {
actualText = createActualInput(count)
actualText.textChanges()
.subscribe {
updatePins(it.toString())
pinChangesRelay.accept(it)
}
overlay.clicks().subscribe { focus() }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment