make sure we are selecting existing indexes at media and directory adapters
This commit is contained in:
parent
498cd10ba6
commit
7ad578ec2e
2 changed files with 8 additions and 4 deletions
|
@ -45,8 +45,10 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
|
||||||
|
|
||||||
fun toggleItemSelection(select: Boolean, pos: Int) {
|
fun toggleItemSelection(select: Boolean, pos: Int) {
|
||||||
if (select) {
|
if (select) {
|
||||||
itemViews[pos]?.dir_check?.background?.setColorFilter(primaryColor, PorterDuff.Mode.SRC_IN)
|
if (itemViews[pos] != null) {
|
||||||
selectedPositions.add(pos)
|
itemViews[pos].dir_check?.background?.setColorFilter(primaryColor, PorterDuff.Mode.SRC_IN)
|
||||||
|
selectedPositions.add(pos)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
selectedPositions.remove(pos)
|
selectedPositions.remove(pos)
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,8 +42,10 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
|
||||||
|
|
||||||
fun toggleItemSelection(select: Boolean, pos: Int) {
|
fun toggleItemSelection(select: Boolean, pos: Int) {
|
||||||
if (select) {
|
if (select) {
|
||||||
itemViews[pos]?.medium_check?.background?.setColorFilter(primaryColor, PorterDuff.Mode.SRC_IN)
|
if (itemViews[pos] != null) {
|
||||||
selectedPositions.add(pos)
|
itemViews[pos].medium_check?.background?.setColorFilter(primaryColor, PorterDuff.Mode.SRC_IN)
|
||||||
|
selectedPositions.add(pos)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
selectedPositions.remove(pos)
|
selectedPositions.remove(pos)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue