Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
molihuan committed Aug 13, 2022
1 parent d28b9b5 commit 6630b7d
Show file tree
Hide file tree
Showing 20 changed files with 736 additions and 314 deletions.
8 changes: 5 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ android {
release {
minifyEnabled true // 开启代码混淆
zipAlignEnabled false // 开启Zip压缩优化
shrinkResources false // 移除未被使用的资源
shrinkResources true // 移除未被使用的资源
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Expand All @@ -37,7 +37,7 @@ dependencies {

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

testImplementation 'junit:junit:4.12'

Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
11 changes: 9 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.molihuan.pathselectdemo">


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




<!-- 访问网络状态 -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

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



<application
android:name="com.molihuan.pathselectdemo.MyApp"
android:allowBackup="true"
Expand All @@ -25,6 +30,8 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>


</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.molihuan.pathselector.fragments.PathSelectFragment;
import com.molihuan.pathselector.utils.Constants;
import com.molihuan.pathselector.utils.Mtools;
import com.zlylib.mlhfileselectorlib.FileSelector;

import java.util.List;

Expand Down Expand Up @@ -89,7 +88,6 @@ public void onClick(View v) {
switch (v.getId()){
case R.id.btn_dialog_selector :
dialogSelectShow();
//cs();
break;
case R.id.btn_fragment_selector :
fragmentSelectShow();
Expand All @@ -98,36 +96,13 @@ public void onClick(View v) {
activitySelectShow();
break;
case R.id.btn_custom_toolbar_selector :
//customToolbarSelectShow();
otherOpen();
customToolbarSelectShow();

break;
}
}

private void otherOpen() {
FileSelector.from(this)
.start();
}


public void cs(){

// List list = UriTools.data2UriMimeTypeData(Arrays.asList(new String[]{"txt"}));
//
// Uri p1 = Uri.parse(UriTools.URI_M5);
// Mtools.log(p1.toString());
//
// String filepath = UriTools.uri2File(p1);
//
//
// Mtools.log(filepath);
// Uri uri = UriTools.file2Uri(filepath);
// if (uri!=null)
// Mtools.log(uri.toString());

// UriUtils.uri2File()
//UriTools.traverseDirByUri(this,UriTools.URI_MOLI,);
}

/**
* 自定义Toolbar方式 详细选项设置请看本类中{@link #activitySelectShow()} 传送门
Expand Down Expand Up @@ -169,6 +144,7 @@ public void onOptionClick(View view, String currentPath, List<FileBean> fileBean
private void dialogSelectShow(){
//获取PathSelectFragment实例onBackPressed中处理返回按钮点击事件
mPathSelectFragment = PathSelector.build(MainActivity.this, Constants.BUILD_DIALOG)
.isSingle()
.frameLayoutID(R.id.fragment_select_show_area)//加载位置FrameLayout的ID
.requestCode(10011)//请求码
.showToolBarFragment(true)//是否显示ToolbarFragment
Expand Down Expand Up @@ -250,7 +226,9 @@ public void onItemsClick(View view, String currentPath, List<FileBean> fileBeanL
.setFileItemListener(new com.molihuan.pathselector.dao.SelectOptions.onFileItemListener() {
@Override
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) {
Mtools.toast(getBaseContext(),currentPath);



return false;
}
@Override
Expand Down
Loading

0 comments on commit 6630b7d

Please sign in to comment.