Skip to content

Commit 4ccc433

Browse files
committed
Fix multiple file chooser unselect action
Dang! wrong branch
1 parent 3ab7c60 commit 4ccc433

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

storagechooser/src/main/java/com/codekidlabs/storagechooser/fragments/SecondaryChooserFragment.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,10 @@ private void handleListMultipleAction(int i, View view) {
483483

484484
} else {
485485
//this item is selected before
486-
secondaryChooserAdapter.selectedPaths.remove(i);
486+
secondaryChooserAdapter.selectedPaths.remove(secondaryChooserAdapter.selectedPaths.indexOf(i));
487487
// reset bg to white
488-
view.setBackgroundColor(Color.WHITE);
489-
mMultipleModeList.remove(i);
488+
view.setBackgroundColor(scheme[Theme.SEC_BG_INDEX]);
489+
mMultipleModeList.remove(mMultipleModeList.indexOf(jointPath));
490490
}
491491

492492
if(mMultipleOnSelectButton.getVisibility() != View.VISIBLE && MODE_MULTIPLE)
@@ -495,8 +495,17 @@ private void handleListMultipleAction(int i, View view) {
495495
if(listView.getOnItemLongClickListener() !=null && MODE_MULTIPLE)
496496
// long click listener in multiple mode ? haha nice joke
497497
listView.setOnItemLongClickListener(null);
498+
499+
if (mMultipleModeList.size() == 0)
500+
bringBackSingleMode();
498501
}
499502

503+
// private int getListIndex(int i) {
504+
// for(int j=0; j<secondaryChooserAdapter.selectedPaths.size(); j++) {
505+
// if()
506+
// }
507+
// }
508+
500509
/**
501510
* brings back the default state of storage-chooser
502511
* */

0 commit comments

Comments
 (0)