:art: :sparkles: Improve the structure of the code and bring the new click event api. by rosuH · Pull Request #137 · rosuH/AndroidFilePicker · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .gitignore
5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

36 changes: 0 additions & 36 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/kotlinc.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

33 changes: 4 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ It depends on your targetAPI:
- `targetAPI == 29`, please enable `requestLegacyExternalStorage` feature for your project :D
- `targetAPI >= 30`, don't use this lib. We don't support scope storage for now :(
- Unless Google release new external permission or other new feature, we would not consider support scope storage. (or says: "I can't do this")
- Or, ofcouse, you are welcome for give us some ideas. Just create a new issues.
- Or, of course, you are welcomed for give us some ideas. Just create a new issues.

## Download

Expand Down Expand Up @@ -70,24 +70,14 @@ The library requires one permissions:

If you do not have permission to apply, this framework will check and apply at startup.

### Launch 🚀 (Kotlin)
### Launch 🚀

```java
```kotlin
FilePickerManager
.from(this@SampleActivity)
.from(context)
.forResult(FilePickerManager.REQUEST_CODE)
```

Now that you have taken off 🛩️ ... ( there are really only two lines )

You only need to add `.INSTANCE` to use it:

```java
FilePickerManager.INSTANCE
.from(this)
.forResult(FilePickerManager.REQUEST_CODE);
```



### Receive Result
Expand All @@ -111,21 +101,6 @@ override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?)

The result is a path list of the selected file (`ArrayList<String>()`).

## proguard-rules(For pre v0.5.1)

```pro
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
-keepnames class kotlinx.coroutines.android.AndroidExceptionPreHandler {}
-keepnames class kotlinx.coroutines.android.AndroidDispatcherFactory {}

-keepclassmembernames class kotlinx.** {
volatile <fields>;
}

```

Starting with 0.5.2, we removed the coroutine library and implemented it using native threads, so there is no need to add proguard-rules.

## Docs

Expand Down
30 changes: 3 additions & 27 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,27 +73,18 @@ dependencies {

如果您没有提前授予,这个库会自动申请该权限的。

### 开始使用(`Kotlin`)
### 开始使用

简单的链式调用示意:

```java
```kotlin
FilePickerManager
.from(this@SampleActivity)
.from(context)
.forResult(FilePickerManager.REQUEST_CODE)
```

现在你已经起飞了🛩️...(真的只有两行)

如果使用 Java,那么仅需要加入一个`.INSTANCE` 即可使用:

```java
FilePickerManager.INSTANCE
.from(this)
.forResult(FilePickerManager.REQUEST_CODE);
```



### 获取结果

Expand All @@ -114,21 +105,6 @@ override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?)
}
```

## 混淆规则(0.5.1 及以前版本)

```
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
-keepnames class kotlinx.coroutines.android.AndroidExceptionPreHandler {}
-keepnames class kotlinx.coroutines.android.AndroidDispatcherFactory {}

-keepclassmembernames class kotlinx.** {
volatile <fields>;
}

```
从 0.5.2 开始,我们移除掉了协程库,并使用原生线程实现,所以无需加入混淆。

### 更多示例

来翻翻我写的[飞行手册](https://github.com/rosuH/AndroidFilePicker/wiki)吧?
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version="1.4.32"
ext.kotlin_version="1.5.21"
repositories {
google()
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "org.jlleitschuh.gradle:ktlint-gradle:10.0.0"
Expand All @@ -23,7 +23,7 @@ apply plugin: "org.jlleitschuh.gradle.ktlint"
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Expand Down
5 changes: 5 additions & 0 deletions filepicker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ android {
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

ext.supportLibVersion = '28.0.0'
Expand Down
2 changes: 1 addition & 1 deletion filepicker/src/main/AndroidManifest.xml
Loading