コード整理
This commit is contained in:
parent
e862523482
commit
b10f77a71f
|
@ -354,16 +354,13 @@ class ActText : AppCompatActivity() {
|
|||
views.btnSearchPrev.isEnabledAlpha = searchResult.size > 1
|
||||
views.btnSearchNext.isEnabledAlpha = searchResult.size > 1
|
||||
|
||||
val idx = when (newPos) {
|
||||
null -> null
|
||||
else -> {
|
||||
val end = views.etText.text?.length ?: 0
|
||||
views.etText.setSelection(
|
||||
newPos.first.clip(0, end),
|
||||
(newPos.last + 1).clip(0, end),
|
||||
)
|
||||
searchResult.indexOf(newPos).takeIf { it >= 0 }
|
||||
}
|
||||
val idx = newPos?.let {
|
||||
val end = views.etText.text?.length ?: 0
|
||||
views.etText.setSelection(
|
||||
newPos.first.clip(0, end),
|
||||
(newPos.last + 1).clip(0, end),
|
||||
)
|
||||
searchResult.indexOf(newPos).takeIf { it >= 0 }
|
||||
}
|
||||
|
||||
views.tvSearchCount.text = getString(
|
||||
|
|
Loading…
Reference in New Issue