Skip to content

Commit

Permalink
ui.settings: fix cursor position after applied input constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
SuzukiHonoka committed Sep 21, 2023
1 parent 8f719c3 commit aae93e6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/org/starx/spaceship/util/EditTextUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class EditTextUtil(val et: EditTextPreference) {
et.apply {
setOnBindEditTextListener {
it.inputType = InputType.TYPE_CLASS_NUMBER
it.setSelection(it.text.length)
}
setOnPreferenceChangeListener { _, newValue ->
if (start == end) return@setOnPreferenceChangeListener true
Expand Down Expand Up @@ -44,6 +45,7 @@ class EditTextUtil(val et: EditTextPreference) {
dialogLayoutResource = R.layout.widget_textfield
setOnBindEditTextListener {
it.inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_PASSWORD
it.setSelection(it.text.length)
}
}
setMask(char)
Expand Down

0 comments on commit aae93e6

Please sign in to comment.