(Library that provides file or path selection on Android, automatically apply for storage permission, support Android 4.4 to 13, support Android/data and Android/obb directory access, support custom UI,support SD card.The Keyword:file selector operator android/data android 11 android 13)
Copyright [2020] molihuan
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.
mlhfileselector
Andriod上提供文件或路径选择的第三方库
自动申请存储权限,支持安卓4.4 ~ 13,支持Android/data和Android/obb目录访问,
支持自定义UI,支持SD卡。
(Library that provides file or path selection on Android, automatically apply for storage permission, support Android 4.4 to 13, support Android/data and Android/obb directory access, support custom UI,support SD card.The Keyword:file selector operator android/data android 11 android 13)
语言(Language)
中文 | English
为什么选择我
自动申请存储权限,支持 Android4.4 ~ 13,再也不用为了适配各种版本而苦恼了,快速集成,一句代码搞定,完善的文档,支持无root权限访问和操作Android/data和Android/obb目录(适配Android 13),支持SD卡,高度自定义UI满足你的所有需求,使用非常灵活,支持国际化,对于Android文件选择你只需要关注你的业务代码即可其他的都交给它。
特性
前言
在开始之前可以给项目一个Star吗?非常感谢,你的支持是我唯一的动力。欢迎Star和Issues!
我们需要你的Pr,注意(请提交到dev分支)
项目地址:
Github地址
Gitee地址
demo演示:
系统版本:Android 13
下载链接:体验APP
一、快速开始
第1步:添加仓库:
如果你的项目 Gradle 配置是在
7.0 以下
,需要在build.gradle
文件中加入如果你的 Gradle 配置是
7.0 及以上
,则需要在settings.gradle
文件中加入第2步:添加远程依赖:
配置完远程仓库后,在项目 app 模块下的
build.gradle
文件中加入远程依赖最新发布版:
第3步:基本用法示范:
二、基本设置
打开调试模式
1、Activity构建模式:
2、Fragment构建模式:
第1步:在你需要显示的布局文件xml中使用FrameLayout占位
第2步:编写代码
第3步:重写onBackPressed()方法让路径选择器优先处理返回按钮点击事件
非常重要!!!
非常重要!!!
非常重要!!!
重要的事情说三遍
3、Dialog构建模式 & 常用设置:
三、高级设置(自定义UI)
UI布局:
1、自定义选项样式(以HandleItem为例子)
方式1:通过FontBean来设置样式
什么?这种方式还不能满足你,那么试试方式2
方式2:重写CommonItemListener的setViewStyle方法来自定义样式
什么?什么?这种方式还不能满足你,那么你来写UI它来帮你添加,试试高度自定义UI
2、高度自定义UI(以Titlebar为例子):
第1步:新建一个布局文件,如:fragment_custom_titlebar.xml
第2步:新建一个类,如:CustomTitlebarFragment.class使其继承AbstractTitlebarFragment并关联第1步中的布局文件
第3步:编写代码
3、自定义列表item图标
四、接口与方法(尽量看源码,都写了注释,懒得写文档)
IConfigDataBuilder
五、!!!特别注意 !!!
分区存储
该库以及适配了分区存储,不需要额外适配,你只需要写你的业务代码即可,其他的交给它。
注意该库已经在库的
AndroidManifest.xml
中添加了:可能会报错:
请在你的项目中的
AndroidManifest.xml
设置一致包含Android Support库
如果你的项目使用Androidx库,因为此库引用了getActivity/XXPermissions库,其包含旧版Support库,会导致冲突而报错。解决办法为在project主目录下的gradle.properties中添加
版本升级
体积过大
已经集成了Blankj/AndroidUtilCode
如果项目对大小有严格要求请自行下载源码并精简AndroidUtilCode模块
代码混淆
特别鸣谢
开源项目以及其依赖项目。
LICENSE