Android 检索手机目录方式的文件选择器,轻量且界面友好,定制性高。This is a lightweight file selector, it can select files by retrieve phone directory

Min SDK   14
Latest Commit   2017-10-17 08:59:30
License   

Github   https://github.com/leonHua/LFilePicker

         

标签

使用APP客户端扫描二维码运行Demo


...

leonHua

北京

https://leonhua.github.io/
资深菜鸟攻城狮 (邮箱可能不能及时回复,有问题欢迎在博客下留言~~~)

         

类似的还有....
CharacterPickerView 可实现三级联动的选择器,高仿iOS的滚轮控件,字体大小自适应
android-calendar-view 显示阳历,农历,节假日和二十四节气 实现对某月日期的单选或者多选的andorid 日历控件库。Easy to use, powerful, easy to expand the android calendar view library.
CalendarView Android上一个优雅、高度自定义、性能高效的日历控件,支持标记、自定义颜色、农历等。Canvas绘制,速度快、占用内存低
README

README.md


中文文档

This is a lightweight file selector, it can select files by retrieve phone directory. At the same time contains:

  • A variety of interface style
  • Support file multiple-choice or radio
  • Support the file type filter
  • Support the fragments
  • custom title text and color
  • Internationalization (switch in both Chinese and English)
  • Maximum quantity limitation (withMaxNum)
  • All or all cancel

version update:

V1.4.0

  • Maximum quantity limitation
  • All or all cancel

Running effect:

dynamic effect(If the picture can't display properly, you can view the screenshot GIF files in the folder)

the page:

Quick to use

1. add reference

compile 'com.leon:lfilepickerlibrary:1.4.0'

or

  Download aar

2. add permission

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

3. open Activity

int REQUESTCODE_FROM_ACTIVITY = 1000;
new LFilePicker()
            .withActivity(MainActivity.this)
            .withRequestCode(REQUESTCODE_FROM_ACTIVITY)
            .start();

4. accept the results of the return

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == RESULT_OK) {
        if (requestCode == REQUESTCODE_FROM_ACTIVITY) {
            //List<String> list = data.getStringArrayListExtra(Constant.RESULT_INFO);//Constant.RESULT_INFO == "paths"
            List<String> list = data.getStringArrayListExtra("paths");
            Toast.makeText(getApplicationContext(), "选中了" + list.size() + "个文件", Toast.LENGTH_SHORT).show();
        }
    }
}

Interface methods

method statement

method statement
withActivity(Activity activity) bind Activity
withFragment(Fragment fragment) bind Fragment
withSupportFragment(Fragment supportFragment) bind V4 Fragment
withRequestCode(int requestCode) set the request code
withTitle(String title) Set the title
withTitleColor(String color) Set the title color
withBackgroundColor(String color) Set the title background color
withIconStyle(int style) set the list icon style
withBackIcon(int backStyle) set back icon style
withFileFilter(String[] arrs) set the file type filter
withMutilyMode(boolean isMutily) setting a multiple-choice or radio mode
withAddText(String text) set the multiselect mode selected text
withNotFoundBooks(String text) Set the prompt information when no file selected
withMaxNum(int num) Set the max number of files

Provide style

withIconStyle(int style) Value model:

  • Constant.BACKICON_STYLEONE
  • Constant.BACKICON_STYLETWO
  • Constant.BACKICON_STYLETHREE

withBackIcon(int backStyle) Value model:

  • Constant.ICON_STYLE_YELLOW
  • Constant.ICON_STYLE_BLUE
  • Constant.ICON_STYLE_GREEN

withFileFilter(String[] arrs) Value model:

 withFileFilter(new String[]{".txt", ".png", ".docx"})

More detailed usage:简书:LFilePicker---文件选择利器,各种样式有它就够了

Thanks


If the library is useful to you, welcome to star or fork! Welcome to visit [blog] 4 for more articles.