mirror of
https://github.com/afollestad/nock-nock.git
synced 2025-04-20 19:45:17 +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)
|
||||
listItems(R.array.site_long_options) { _, i, _ ->
|
||||
when (i) {
|
||||
0 -> checkStatusManager.scheduleCheck(site = model, cancelPrevious = true)
|
||||
1 -> maybeRemoveSite(model) {
|
||||
adapter.remove(i)
|
||||
emptyText.showOrHide(adapter.itemCount == 0)
|
||||
0 -> {
|
||||
checkStatusManager.scheduleCheck(
|
||||
site = model,
|
||||
rightNow = true,
|
||||
cancelPrevious = true
|
||||
)
|
||||
}
|
||||
1 -> {
|
||||
maybeRemoveSite(model) {
|
||||
adapter.remove(model)
|
||||
emptyText.showOrHide(adapter.itemCount == 0)
|
||||
}
|
||||
}
|
||||
else -> throw IllegalStateException("Unexpected index: $i")
|
||||
}
|
||||
}
|
||||
negativeButton(android.R.string.cancel)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue