-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nages <[email protected]>
- Loading branch information
Showing
11 changed files
with
111 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
*.iml | ||
.idea | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
app/src/main/java/com/aof/mcinabox/utils/dialog/FileSelectUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.aof.mcinabox.utils.dialog; | ||
|
||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
|
||
import androidx.annotation.Nullable; | ||
|
||
/** | ||
* 文件选择器 | ||
*/ | ||
public class FileSelectUtils { | ||
|
||
private static Callback callback = new Callback() { | ||
@Override | ||
public void onResult(int requestCode, int resultCode, @Nullable Intent data) { | ||
|
||
} | ||
}; | ||
|
||
public static Callback getCallback() { | ||
return callback; | ||
} | ||
|
||
public static void setCallback(Callback callback) { | ||
FileSelectUtils.callback = callback; | ||
} | ||
|
||
public static void startActivityForResult(Activity activity, int requestCode, Callback callback) { | ||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT); | ||
intent.addCategory(Intent.CATEGORY_OPENABLE); | ||
intent.setType("application/x-xz"); | ||
activity.startActivityForResult(intent, requestCode); | ||
FileSelectUtils.callback = callback; | ||
} | ||
|
||
public static interface Callback { | ||
void onResult(int requestCode, int resultCode, @Nullable Intent data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<network-security-config> | ||
<!-- 默认配置,是否开启Http流量允许--> | ||
<base-config cleartextTrafficPermitted="true" /> | ||
</network-security-config> |