Skip to content
This repository was archived by the owner on Mar 8, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,33 +157,33 @@ eg. /sdcard:/mnt:

#### Theme.Black

![Screenshot 1](https://raw.githubusercontent.com/Angads25/android-filepicker/master/screenshots/theme_black.png)
![Screenshot 1](https://raw.githubusercontent.com/Angads25/android-filepicker/release/screenshots/theme_black.png)

#### Theme.Holo

![Screenshot 2](https://raw.githubusercontent.com/Angads25/android-filepicker/master/screenshots/theme_holo.png)
![Screenshot 2](https://raw.githubusercontent.com/Angads25/android-filepicker/release/screenshots/theme_holo.png)

#### Theme.Holo.Light

![Screenshot 3](https://raw.githubusercontent.com/Angads25/android-filepicker/master/screenshots/theme_holo_light.png)
![Screenshot 3](https://raw.githubusercontent.com/Angads25/android-filepicker/release/screenshots/theme_holo_light.png)

#### Theme.Material

![Screenshot 4](https://raw.githubusercontent.com/Angads25/android-filepicker/master/screenshots/theme_material.png)
![Screenshot 4](https://raw.githubusercontent.com/Angads25/android-filepicker/release/screenshots/theme_material.png)

#### Theme.DeviceDefault

![Screenshot 5](https://raw.githubusercontent.com/Angads25/android-filepicker/master/screenshots/theme_device_default.png)
![Screenshot 5](https://raw.githubusercontent.com/Angads25/android-filepicker/release/screenshots/theme_device_default.png)

### Performance

#### GPU Overdraw

![Performance 1](https://raw.githubusercontent.com/Angads25/android-filepicker/master/screenshots/performance_overdraw.png)
![Performance 1](https://raw.githubusercontent.com/Angads25/android-filepicker/release/screenshots/performance_overdraw.png)

#### GPU Rendering

![Performance 2](https://raw.githubusercontent.com/Angads25/android-filepicker/master/screenshots/profile_gpu_rendering.png)
![Performance 2](https://raw.githubusercontent.com/Angads25/android-filepicker/release/screenshots/profile_gpu_rendering.png)

### License
Copyright (C) 2016 Angad Singh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,29 @@ public View getView(final int i, View view, ViewGroup viewGroup) {
holder.fmark.setOnCheckedChangedListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(MaterialCheckbox checkbox, boolean isChecked) {
item.setMarked(isChecked);
if (item.isMarked()) {
if(properties.selection_mode == DialogConfigs.MULTI_MODE) {
MarkedItemList.addSelectedItem(item);
if(properties.selection_mode == DialogConfigs.MULTI_MODE) {
if(isChecked){
if(MarkedItemList.getFileCount() < properties.max_selections){
item.setMarked(isChecked);
MarkedItemList.addSelectedItem(item);
}else{
holder.fmark.setChecked(false);
}
}
else {
else{
item.setMarked(isChecked); //setMarked(false)
MarkedItemList.removeSelectedItem(item.getLocation());
}
} else{ //SINGLE_MODE
item.setMarked(isChecked);
if (item.isMarked()) {
MarkedItemList.addSingleFile(item);
} else {
MarkedItemList.removeSelectedItem(item.getLocation());
}
}
else {
MarkedItemList.removeSelectedItem(item.getLocation());
}
notifyItemChecked.notifyCheckBoxIsClicked();

}
});
return view;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,18 @@ public class DialogProperties {
*/
public String[] extensions;

/** Max Selections limits the maximum number of selections when in MULTI_MODE
*
*/
public int max_selections;

public DialogProperties() {
selection_mode = DialogConfigs.SINGLE_MODE;
selection_type = DialogConfigs.FILE_SELECT;
root = new File(DialogConfigs.DEFAULT_DIR);
error_dir = new File(DialogConfigs.DEFAULT_DIR);
offset = new File(DialogConfigs.DEFAULT_DIR);
extensions = null;
max_selections = 1;
}
}