mirror of
https://github.com/afollestad/nock-nock.git
synced 2025-08-05 23:48:41 +00:00
Fix long press functions in the main list
This commit is contained in:
parent
cfe9df9225
commit
b36b41ca9d
1 changed files with 12 additions and 5 deletions
|
@ -172,15 +172,22 @@ class MainActivity : AppCompatActivity() {
|
||||||
title(R.string.options)
|
title(R.string.options)
|
||||||
listItems(R.array.site_long_options) { _, i, _ ->
|
listItems(R.array.site_long_options) { _, i, _ ->
|
||||||
when (i) {
|
when (i) {
|
||||||
0 -> checkStatusManager.scheduleCheck(site = model, cancelPrevious = true)
|
0 -> {
|
||||||
1 -> maybeRemoveSite(model) {
|
checkStatusManager.scheduleCheck(
|
||||||
adapter.remove(i)
|
site = model,
|
||||||
emptyText.showOrHide(adapter.itemCount == 0)
|
rightNow = true,
|
||||||
|
cancelPrevious = true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
1 -> {
|
||||||
|
maybeRemoveSite(model) {
|
||||||
|
adapter.remove(model)
|
||||||
|
emptyText.showOrHide(adapter.itemCount == 0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else -> throw IllegalStateException("Unexpected index: $i")
|
else -> throw IllegalStateException("Unexpected index: $i")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
negativeButton(android.R.string.cancel)
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue