Skip to content

Commit d9d3004

Browse files
authored
Merge pull request #137 from rosuH/dev
🎨 ✨ Improve the structure of the code and bring the new click event api.
2 parents f25d4d8 + fd0fdfa commit d9d3004

35 files changed

+439
-497
lines changed

.gitignore

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,7 @@ captures/
3434

3535
# IntelliJ
3636
*.iml
37-
.idea/workspace.xml
38-
.idea/tasks.xml
39-
.idea/gradle.xml
40-
.idea/assetWizardSettings.xml
41-
.idea/dictionaries
42-
.idea/libraries
43-
.idea/caches
44-
.idea/codeStyle
37+
.idea/*
4538

4639
# Keystore files
4740
# Uncomment the following line if you do not want to check your keystore files in.

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.idea/kotlinc.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.idea/runConfigurations.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

README.md

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

3737
## Download
3838

@@ -70,24 +70,14 @@ The library requires one permissions:
7070

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

73-
### Launch 🚀 (Kotlin)
73+
### Launch 🚀
7474

75-
```java
75+
```kotlin
7676
FilePickerManager
77-
.from(this@SampleActivity)
77+
.from(context)
7878
.forResult(FilePickerManager.REQUEST_CODE)
7979
```
8080

81-
Now that you have taken off 🛩️ ... ( there are really only two lines )
82-
83-
You only need to add `.INSTANCE` to use it:
84-
85-
```java
86-
FilePickerManager.INSTANCE
87-
.from(this)
88-
.forResult(FilePickerManager.REQUEST_CODE);
89-
```
90-
9181

9282

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

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

114-
## proguard-rules(For pre v0.5.1)
115-
116-
```pro
117-
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
118-
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
119-
-keepnames class kotlinx.coroutines.android.AndroidExceptionPreHandler {}
120-
-keepnames class kotlinx.coroutines.android.AndroidDispatcherFactory {}
121-
122-
-keepclassmembernames class kotlinx.** {
123-
volatile <fields>;
124-
}
125-
126-
```
127-
128-
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.
129104

130105
## Docs
131106

README_CN.md

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -73,27 +73,18 @@ dependencies {
7373

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

76-
### 开始使用(`Kotlin`)
76+
### 开始使用
7777

7878
简单的链式调用示意:
7979

80-
```java
80+
```kotlin
8181
FilePickerManager
82-
.from(this@SampleActivity)
82+
.from(context)
8383
.forResult(FilePickerManager.REQUEST_CODE)
8484
```
8585

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

88-
如果使用 Java,那么仅需要加入一个`.INSTANCE` 即可使用:
89-
90-
```java
91-
FilePickerManager.INSTANCE
92-
.from(this)
93-
.forResult(FilePickerManager.REQUEST_CODE);
94-
```
95-
96-
9788

9889
### 获取结果
9990

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

117-
## 混淆规则(0.5.1 及以前版本)
118-
119-
```
120-
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
121-
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
122-
-keepnames class kotlinx.coroutines.android.AndroidExceptionPreHandler {}
123-
-keepnames class kotlinx.coroutines.android.AndroidDispatcherFactory {}
124-
125-
-keepclassmembernames class kotlinx.** {
126-
volatile <fields>;
127-
}
128-
129-
```
130-
从 0.5.2 开始,我们移除掉了协程库,并使用原生线程实现,所以无需加入混淆。
131-
132108
### 更多示例
133109

134110
来翻翻我写的[飞行手册](https://github.com/rosuH/AndroidFilePicker/wiki)吧?

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version="1.4.32"
4+
ext.kotlin_version="1.5.21"
55
repositories {
66
google()
7-
jcenter()
7+
mavenCentral()
88
maven {
99
url "https://plugins.gradle.org/m2/"
1010
}
1111
}
1212
dependencies {
13-
classpath 'com.android.tools.build:gradle:4.0.1'
13+
classpath 'com.android.tools.build:gradle:4.1.3'
1414
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1515
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
1616
classpath "org.jlleitschuh.gradle:ktlint-gradle:10.0.0"
@@ -23,7 +23,7 @@ apply plugin: "org.jlleitschuh.gradle.ktlint"
2323
allprojects {
2424
repositories {
2525
google()
26-
jcenter()
26+
mavenCentral()
2727
maven { url 'https://jitpack.io' }
2828
}
2929
}

filepicker/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ android {
2929
packagingOptions {
3030
exclude 'META-INF/proguard/androidx-annotations.pro'
3131
}
32+
33+
compileOptions {
34+
sourceCompatibility JavaVersion.VERSION_1_8
35+
targetCompatibility JavaVersion.VERSION_1_8
36+
}
3237
}
3338

3439
ext.supportLibVersion = '28.0.0'

0 commit comments

Comments
 (0)