Skip to content

Documentation

kamyar haqqani edited this page Dec 3, 2019 · 10 revisions

This page documents and explains public properties of easiFileManager classes and Interfaces;

Classes:

  1. easyFileManager

Interfaces:

  1. File_action_event_listener
  2. File_item_evens_listener
  3. FileManager_states_listener
  4. Option_item_events_listener

easiFileManager

easiFileManager extends Fragment

Properties:

  • public String SDCARD_Path

    The external storage directory path of the OS; The default value is "/sdcard".

  • public static final int MODE_SINGLE_FILE_SELECTION

    If passed as the mode the FileManager wouldn't allow selection of multiple files and there is no OptionsBar;

  • public static final int MODE_REGULAR_FILE_MANAGMENT

    If passed as the mode the FileManager allows regular file managing; multiple files and folders can be selected; OptionsBar is available and new actions to be performed on selected files can be added as Options;

  • public static final String OPTION_DELETE_ID

    Option id of the defualt delete option;

  • public static final String OPTION_COPY_ID

    Option id of the defualt copy option;

  • public static final String OPTION_MOVE_ID

    Option id of the defualt move option;

  • public static final String OPTION_NEW_FOLDER_ID

    Option id of the defualt new-folder option;

  • public static final int STATE_BROWSING_DIRS_TO_SELECT_COPY_OR_CUT_DESTINATION

    If default options are added and the user clicks on copy or move the file manager would navigate to the sdcard directory so the destination folder can be selected; the state property then becomes equal to this value;

  • public static final int STATE_BROWSING_DIRS

    If state value equals this value it means user is browsing directories;

  • public int state

    Holds the state of FileManager

  • public boolean FileManager_is_ready

    Holds true if the FileManager fragment is commited and brought to view; otherwise Holds false; Calling methods that interact with UI while this value is false would throw an exception.

  • public List allowed_file_extentions_list

    This List contains the only file extensions which are allowed; If it holds any items then no files other than the ones whose extensions match any of this list's items will be displayed;

  • public List allowed_folder_extentions_list

    This List contains the only folder extensions which are allowed; If it holds any items then no folder other than the ones whose extensions match any of this list's items willbe displayed;

  • public List excluded_file_extentions_list

    This List contains the file extensions which are not allowed; If allowed_file_extentions_list holds any items then this list is un-effective;

  • public List excluded_folder_extentions_list

    This List contains the folder extensions which are not allowed; If allowed_folder_extentions_list holds any items then this list is un-effective;

Methods:

  • public void add_on_FileItem_EventListener(File_item_evens_listener file_item_evens_listener)

    Adds or overwrites the current FileItem event Listener.

    file_item_evens_listener: the FileItem event Listener.

  • public void add_Icon_for_file_type(Bitmap icon,String File_Extention)

    Associates an icon with a file extention; file extentions which are reserved for images files will not be associated with any icon; A lower quality of image would be used as icon instead;

    icon: Bitmap of the icon.

    File_Extention: The file extension which would be associated with the icon.

  • public easyFileManager(Activity activity, String directory_to_browse, int mode, FileManager_states_listener fileManager_states_listener) throws Exception

    The constructor.

    activity: The activity instance in which the fragment is being created.

    directory_to_browse: The directory path which is going to be browsed.

    mode: The mode of file managment; either MODE_SINGLE_FILE_SELECTION or MODE_REGULAR_FILE_MANAGMENT can be passed.

    fileManager_states_listener: The listener which would be called after the file manager becomes ready.

  • public void add_common_options_and_operations()

    Adds common File managing options like copy, cut, delete, new-folder options to the OptionsBar; each of these options can be removed or over-rided later.

  • public void unselect_all_file_items() throws Exception

    Un-selects all the files which are currently selected by user.

  • public boolean is_file_extention_allowed(File file)

    Returns true if file passed as argument has an extension which is allowed to be displayed;

    file: The file that is to be determined if it extension is allowed.

  • public void navigate_to_parent_directory()

    Navigates the FileManager to the parent directory.

  • public void navigate_to_directory(File f) throws IOException

    Navigates the FileManager to this folder.

    file: The file that is to be determined if it extension is allowed.

  • public List get_list_of_option_IDs()

    Returns a list current options option IDs in OptionsBar.

  • public void show_pic(final File image_File)

    Displays the Image passed as file;

    image_File: The file which is to be displayed.

  • public void add_folder() throws Exception

    Displays a dialog to input the new folder's name and then adds a new folder with that name.

  • public void add_Option_to_OptionsBar(Bitmap option_icon_bitmap, final Option_item_events_listener option_item_events_listener, String Option_ID, boolean is_available_only_when_files_are_selected)throws Exception

    Adds a new option to OptionsBar.

    option_icon_bitmap: Option's icon.

    option_item_events_listener: Event listeners of the option which are called if options is clicked on.

    Option_ID: The option's ID. If an options with the same ID exists, it would be overwriten.

    is_available_only_when_files_are_selected: If set to true, the option would only appear when at least one file or folder is selected.

  • public void remove_Option_from_OptionsBar(String Option_ID)throws Exception

    Removes the option with the option id passed as argument.

    Option_ID: the option id which is to be removed.

  • public String get_current_path()

    Returns the current directory path being browsed by user.

  • public List get_selected_Files_list()

    Returns a list of the files and folders selected by user.

  • public void handle_Back_button_pressed_event()

  • public void show_OptionsBar(boolean b)

  • public static String getFileType(File file)

  • public static String get_FileName_Extention(String s)

  • public static File return_nonexisting_file(String dir, String name, String ext)

  • public static String add_num_to_name(String name, int i1)

  • public static void perform_action_on_file_or_folder(File Folder_or_File,File_action_event_listener action)

File_action_event_listener

Methods:

  • void on_File_about_to_be_processed(File f)
  • void on_Overall_progress_changed(int amount_of_progress_done, int amount_of_all_the_progress)

File_item_evens_listener

Methods:

  • void FileItem_onClickListener(File file);
  • void FileItem_onLongClickListener(File file);

FileManager_states_listener

Methods:

  • void onFile_Manager_Ready(easyFileManager fileManager);

Option_item_events_listener

Methods:

  • void Option_item_OnClickListener(List selected_Files_list);
  • void Option_item_OnlongClickListener(List selected_Files_list);

Clone this wiki locally