Moving hiddenitmes option to FilePickerFragment.java

This commit is contained in:
dvrajan 2015-10-31 01:13:01 +05:30
parent ef45d18ae3
commit 25676ceb9a
2 changed files with 21 additions and 10 deletions

View File

@ -77,7 +77,6 @@ public abstract class AbstractFilePickerFragment<T> extends Fragment
protected T mCurrentPath = null;
protected boolean allowCreateDir = false;
protected boolean allowMultiple = false;
protected boolean showHiddenItems = false;
protected OnFilePickedListener mListener;
protected FileItemAdapter<T> mAdapter = null;
protected TextView mCurrentDirView;
@ -405,14 +404,6 @@ public abstract class AbstractFilePickerFragment<T> extends Fragment
return true;
}
public void showHiddenItems(boolean showHiddenItems){
this.showHiddenItems = showHiddenItems;
}
public boolean areHiddenItemsShown(){
return showHiddenItems;
}
/**
* Instantiate and return a new Loader for the given ID.
*

View File

@ -38,10 +38,30 @@ import java.io.File;
public class FilePickerFragment extends AbstractFilePickerFragment<File> {
protected static final int PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE = 1;
protected boolean showHiddenItems = false;
public FilePickerFragment() {
}
/**
* This method is used to dictate whether hidden files and folders should be shown or not
*
* @param showHiddenItems whether hidden items should be shown or not
*/
public void showHiddenItems(boolean showHiddenItems){
this.showHiddenItems = showHiddenItems;
}
/**
* Returns if hidden items are shown or not
*
* @return true if hidden items are shown, otherwise false
*/
public boolean areHiddenItemsShown(){
return showHiddenItems;
}
/**
* @return true if app has been granted permission to write to the SD-card.
*/
@ -308,7 +328,7 @@ public class FilePickerFragment extends AbstractFilePickerFragment<File> {
if(!showHiddenItems && file.isHidden()){
return false;
}
return (isDir(file) || (mode == MODE_FILE || mode == MODE_FILE_AND_DIR);
return (isDir(file) || (mode == MODE_FILE || mode == MODE_FILE_AND_DIR));
}
/**