Skip to content

Commit 6630b7d

Browse files
author
molihuan
committed
fix bug
1 parent d28b9b5 commit 6630b7d

File tree

20 files changed

+736
-314
lines changed

20 files changed

+736
-314
lines changed

app/build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ android {
2020
release {
2121
minifyEnabled true // 开启代码混淆
2222
zipAlignEnabled false // 开启Zip压缩优化
23-
shrinkResources false // 移除未被使用的资源
23+
shrinkResources true // 移除未被使用的资源
2424
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
2525
}
2626
}
@@ -37,7 +37,7 @@ dependencies {
3737

3838
implementation fileTree(dir: "libs", includes: ["*.aar","*.jar"] )//工具依赖
3939
//集成用
40-
//implementation 'io.github.molihuan:pathselector:1.0.7'
40+
//implementation 'io.github.molihuan:pathselector:1.0.10'
4141
//调试用
4242
implementation project(path: ':pathselector')
4343
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.6'
@@ -50,7 +50,9 @@ dependencies {
5050
implementation 'androidx.appcompat:appcompat:1.1.0'
5151
implementation 'com.google.android.material:material:1.1.0'
5252
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
53-
implementation project(path: ':fileselectorlib')//参考库
53+
//implementation project(path: ':fileselectorlib')//参考库 与原库有依赖冲突
54+
//使用这个包遍历Android/data目录
55+
implementation 'androidx.documentfile:documentfile:1.0.1'
5456

5557
testImplementation 'junit:junit:4.12'
5658

app/release/app-release.apk

-88.5 KB
Binary file not shown.

app/src/main/AndroidManifest.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
34
package="com.molihuan.pathselectdemo">
45

56

6-
<!-- 联网权限 -->
77
<uses-permission android:name="android.permission.INTERNET" />
88

9+
10+
11+
912
<!-- 访问网络状态 -->
1013
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
1114
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
1215

13-
<uses-permission android:name="android.permission.INTERNET" />
16+
17+
18+
1419
<application
1520
android:name="com.molihuan.pathselectdemo.MyApp"
1621
android:allowBackup="true"
@@ -25,6 +30,8 @@
2530
<category android:name="android.intent.category.LAUNCHER" />
2631
</intent-filter>
2732
</activity>
33+
34+
2835
</application>
2936

3037
</manifest>

app/src/main/java/com/molihuan/pathselectdemo/activity/MainActivity.java

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import com.molihuan.pathselector.fragments.PathSelectFragment;
2020
import com.molihuan.pathselector.utils.Constants;
2121
import com.molihuan.pathselector.utils.Mtools;
22-
import com.zlylib.mlhfileselectorlib.FileSelector;
2322

2423
import java.util.List;
2524

@@ -89,7 +88,6 @@ public void onClick(View v) {
8988
switch (v.getId()){
9089
case R.id.btn_dialog_selector :
9190
dialogSelectShow();
92-
//cs();
9391
break;
9492
case R.id.btn_fragment_selector :
9593
fragmentSelectShow();
@@ -98,36 +96,13 @@ public void onClick(View v) {
9896
activitySelectShow();
9997
break;
10098
case R.id.btn_custom_toolbar_selector :
101-
//customToolbarSelectShow();
102-
otherOpen();
99+
customToolbarSelectShow();
100+
103101
break;
104102
}
105103
}
106104

107-
private void otherOpen() {
108-
FileSelector.from(this)
109-
.start();
110-
}
111-
112105

113-
public void cs(){
114-
115-
// List list = UriTools.data2UriMimeTypeData(Arrays.asList(new String[]{"txt"}));
116-
//
117-
// Uri p1 = Uri.parse(UriTools.URI_M5);
118-
// Mtools.log(p1.toString());
119-
//
120-
// String filepath = UriTools.uri2File(p1);
121-
//
122-
//
123-
// Mtools.log(filepath);
124-
// Uri uri = UriTools.file2Uri(filepath);
125-
// if (uri!=null)
126-
// Mtools.log(uri.toString());
127-
128-
// UriUtils.uri2File()
129-
//UriTools.traverseDirByUri(this,UriTools.URI_MOLI,);
130-
}
131106

132107
/**
133108
* 自定义Toolbar方式 详细选项设置请看本类中{@link #activitySelectShow()} 传送门
@@ -169,6 +144,7 @@ public void onOptionClick(View view, String currentPath, List<FileBean> fileBean
169144
private void dialogSelectShow(){
170145
//获取PathSelectFragment实例onBackPressed中处理返回按钮点击事件
171146
mPathSelectFragment = PathSelector.build(MainActivity.this, Constants.BUILD_DIALOG)
147+
.isSingle()
172148
.frameLayoutID(R.id.fragment_select_show_area)//加载位置FrameLayout的ID
173149
.requestCode(10011)//请求码
174150
.showToolBarFragment(true)//是否显示ToolbarFragment
@@ -250,7 +226,9 @@ public void onItemsClick(View view, String currentPath, List<FileBean> fileBeanL
250226
.setFileItemListener(new com.molihuan.pathselector.dao.SelectOptions.onFileItemListener() {
251227
@Override
252228
public boolean onFileItemClick(View view, String currentPath, List<com.molihuan.pathselector.entities.FileBean> fileBeanList, List<String> callBackData, TabbarFileListAdapter tabbarAdapter, com.molihuan.pathselector.adapters.FileListAdapter fileAdapter,FileBean fileBean) {
253-
Mtools.toast(getBaseContext(),currentPath);
229+
230+
231+
254232
return false;
255233
}
256234
@Override

0 commit comments

Comments
 (0)