File tree Expand file tree Collapse file tree 7 files changed +20
-32
lines changed
src/main/java/gun0912/tedimagepicker/sample
java/gun0912/tedimagepicker/builder Expand file tree Collapse file tree 7 files changed +20
-32
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,7 @@ dependencies {
4242 implementation deps. androidx. appcompat
4343 implementation ' com.android.support:multidex:1.0.3'
4444
45- debugImplementation ' com.squareup.leakcanary:leakcanary-android:1.6.3'
46- releaseImplementation ' com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
45+ debugImplementation ' com.squareup.leakcanary:leakcanary-android:2.9.1'
4746
4847 implementation deps. glide. glide
4948 annotationProcessor deps. glide. annotation
Original file line number Diff line number Diff line change @@ -3,21 +3,10 @@ package gun0912.tedimagepicker.sample
33
44import androidx.multidex.MultiDexApplication
55
6- import com.squareup.leakcanary.LeakCanary
7-
86class MyApplication : MultiDexApplication () {
97
108 override fun onCreate () {
119 super .onCreate()
12- setLeakCanary()
1310 }
1411
15- private fun setLeakCanary () {
16- if (LeakCanary .isInAnalyzerProcess(this )) {
17- // This process is dedicated to LeakCanary for heap analysis.
18- // You should not init your app in this process.
19- return
20- }
21- LeakCanary .install(this )
22- }
2312}
Original file line number Diff line number Diff line change 11ext {
22 versions = [
33 ' minSdkVersion' : 17 ,
4- ' compileSdkVersion' : 30 ,
5- ' targetSdkVersion' : 30 ,
6- ' gradle' : ' 7.0.2' ,
7- ' kotlin' : ' 1.5.30' ,
8- ' supportLibrary' : ' 25.0.0' ,
4+ ' compileSdkVersion' : 33 ,
5+ ' targetSdkVersion' : 33 ,
6+ ' gradle' : ' 7.2.0' ,
7+ ' kotlin' : ' 1.7.0' ,
98 ]
109
1110 deps = [
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ kotlin.code.style=official
2121
2222GROUP =io.github.ParkSangGwon
2323POM_ARTIFACT_ID =tedimagepicker
24- VERSION_NAME =1.2.8
24+ VERSION_NAME =1.3.2
2525
2626POM_NAME =TedImagePicker
2727POM_PACKAGING =aar
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33distributionPath =wrapper/dists
44zipStoreBase =GRADLE_USER_HOME
55zipStorePath =wrapper/dists
6- distributionUrl =https\://services.gradle.org/distributions/gradle-7.0 .2-all.zip
6+ distributionUrl =https\://services.gradle.org/distributions/gradle-7.4 .2-all.zip
Original file line number Diff line number Diff line change 11<manifest xmlns : android =" http://schemas.android.com/apk/res/android" xmlns : tools =" http://schemas.android.com/tools"
22 package =" gun0912.tedimagepicker" >
33
4- <uses-permission android : name =" android.permission.READ_EXTERNAL_STORAGE" />
4+ <uses-permission android : name =" android.permission.READ_MEDIA_IMAGES" />
5+ <uses-permission
6+ android : name =" android.permission.READ_EXTERNAL_STORAGE"
7+ android : maxSdkVersion =" 32" />
58 <uses-permission
69 android : name =" android.permission.WRITE_EXTERNAL_STORAGE"
7- android : maxSdkVersion =" 28"
8- tools : ignore =" ScopedStorage" />
10+ android : maxSdkVersion =" 28" />
911
1012 <queries >
1113 <intent >
Original file line number Diff line number Diff line change @@ -97,25 +97,24 @@ open class TedImagePickerBaseBuilder<out B : TedImagePickerBaseBuilder<B>>(
9797
9898 @SuppressLint(" CheckResult" )
9999 protected fun startInternal (context : Context ) {
100- checkPermission(context )
100+ checkPermission()
101101 .subscribe({ permissionResult ->
102102 if (permissionResult.isGranted) {
103103 startActivity(context)
104104 }
105105 }, { throwable -> onErrorListener?.onError(throwable) })
106106 }
107107
108- private fun checkPermission (context : Context ): Single <TedPermissionResult > {
109- val permissions = if (Build .VERSION .SDK_INT < Build .VERSION_CODES .Q ) {
110- arrayOf(
111- Manifest .permission.READ_EXTERNAL_STORAGE ,
112- Manifest .permission.WRITE_EXTERNAL_STORAGE ,
113- )
108+ private fun checkPermission (): Single <TedPermissionResult > {
109+ val permission = if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .TIRAMISU ) {
110+ Manifest .permission.READ_MEDIA_IMAGES
111+ } else if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .Q ) {
112+ Manifest .permission.READ_EXTERNAL_STORAGE
114113 } else {
115- arrayOf( Manifest .permission.READ_EXTERNAL_STORAGE )
114+ Manifest .permission.WRITE_EXTERNAL_STORAGE
116115 }
117116 return TedPermission .create()
118- .setPermissions(* permissions )
117+ .setPermissions(permission )
119118 .request()
120119 }
121120
You can’t perform that action at this time.
0 commit comments