GithubHelp home page GithubHelp logo

hhy5277 / filelisterdialog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from firzenyogesh/filelisterdialog

0.0 2.0 0.0 420 KB

A simple file/ directory picker dialog for android

License: Apache License 2.0

Java 100.00%

filelisterdialog's Introduction

FileListerDialog

FileListerDialog helps you to list and pick file/directory. Library is built for Android

Getting Started

Installing

To use this library simply import it by placing the following line under dependencies in your app module's build.gradle file

This library is posted in jCenter

   dependencies {
      implementation 'yogesh.firzen:FilesLister:1.0.1.f'
   }

If any problem occured while importing please add this line to your app module's build. gradle file

   repositories {
      maven {url "https://dl.bintray.com/firzenyogesh/maven"}
   }

This library has dependencies

   dependencies {
      implementation 'com.android.support:appcompat-v7:26.0.0-beta2'
      implementation 'com.android.support:design:26.0.0-beta2'
      implementation 'com.android.support:recyclerview-v7:26.0.0-beta2'
      implementation 'yogesh.firzen:MukkiyaSevaigal:1.0.6'
   }

Usage

After importing the library you can use FileListerDialog to list the files and pick one among them. Simply follow the steps

  1. Create an instance of FileListerDialog by using the static method createFileListerDialog()

    Default Instance:

       FileListerDialog fileListerDialog = FileListerDialog.createFileListerDialog(context);
    

    Instance with a theme for Dialog:

       FileListerDialog fileListerDialog = FileListerDialog.createFileListerDialog(context, themeId);
    
  2. Set OnFileSelectedListener so that you get what file/ directory has been selected

       filelister.setOnFileSelectedListener(new OnFileSelectedListener() {
             @Override
             public void onFileSelected(File file, String path) {
                   //your code here
             }
       });
    
  3. Set the default directory to load when showing the dialog:

    Using a file

       fileListerDialog.setDefaultDir(file);
    

    Using a file path

       fileListerDialog.setDefaultDir(path);
    
  4. Set the File Filter type to filter the type of files to be listed:

       fileListerDialog.setFileFilter(FileListerDialog.FILE_FILTER.ALL_FILES);
    

    Possible values are:

       FileListerDialog.FILE_FILTER.ALL_FILES
       FileListerDialog.FILE_FILTER.DIRECTORY_ONLY
       FileListerDialog.FILE_FILTER.IMAGE_ONLY
       FileListerDialog.FILE_FILTER.VIDEO_ONLY
       FileListerDialog.FILE_FILTER.AUDIO_ONLY
    

Screenshots

FileListerDialog

Create a new folder

When a Directory is picked

When a file is picked

Authors

License

Copyright 2017 Yogesh Sundaresan

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

filelisterdialog's People

Contributors

firzenyogesh avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.