mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
add Select all to media screen
This commit is contained in:
parent
c449ce43a5
commit
7fe6d616c0
1 changed files with 8 additions and 2 deletions
|
@ -102,7 +102,6 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
|
||||||
override fun onPrepareActionMode(actionMode: ActionMode?, menu: Menu): Boolean {
|
override fun onPrepareActionMode(actionMode: ActionMode?, menu: Menu): Boolean {
|
||||||
menu.findItem(R.id.cab_rename).isVisible = multiSelector.selectedPositions.size <= 1
|
menu.findItem(R.id.cab_rename).isVisible = multiSelector.selectedPositions.size <= 1
|
||||||
menu.findItem(R.id.cab_edit).isVisible = multiSelector.selectedPositions.size <= 1
|
menu.findItem(R.id.cab_edit).isVisible = multiSelector.selectedPositions.size <= 1
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +169,14 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
|
||||||
}
|
}
|
||||||
|
|
||||||
fun selectAll() {
|
fun selectAll() {
|
||||||
|
val cnt = media.size
|
||||||
|
for (i in 0..cnt - 1) {
|
||||||
|
markedItems.add(i)
|
||||||
|
multiSelector.setSelected(i, 0, true)
|
||||||
|
notifyItemChanged(i)
|
||||||
|
}
|
||||||
|
actMode?.title = cnt.toString()
|
||||||
|
actMode?.invalidate()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun askConfirmDelete() {
|
private fun askConfirmDelete() {
|
||||||
|
|
Loading…
Reference in a new issue