Skip to content

Commit afd51b4

Browse files
authoredMar 5, 2022
Merge pull request #152 from yogeshpaliyal/android12-compatible
Compatible With Android 12 | SDK 31
2 parents fa1a1a1 + 987c8ca commit afd51b4

File tree

5 files changed

+5
-11
lines changed

5 files changed

+5
-11
lines changed
 

‎app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ buildscript {
99
}
1010

1111
android {
12-
compileSdkVersion 30
12+
compileSdkVersion 31
1313
buildToolsVersion '28.0.2'
1414
defaultConfig {
1515
applicationId 'com.vansuita.pickimage.sample'
1616
minSdkVersion 14
17-
targetSdkVersion 30
17+
targetSdkVersion 31
1818
versionCode 4
1919
versionName "1.0"
2020
}

‎app/src/main/AndroidManifest.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
android:theme="@style/AppTheme">
1313
<activity
1414
android:name=".act.SampleActivity"
15-
android:screenOrientation="sensorPortrait">
15+
android:screenOrientation="sensorPortrait"
16+
android:exported="true">
1617
<intent-filter>
1718
<action android:name="android.intent.action.MAIN" />
1819

‎library/src/main/AndroidManifest.xml

-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
<uses-feature android:name="android.hardware.camera" />
77
<uses-feature android:name="android.hardware.camera.autofocus" />
88

9-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
109

1110

1211
<application
1312
android:configChanges="orientation"
1413
android:label="@string/app_name"
15-
android:requestLegacyExternalStorage="true"
1614
android:screenOrientation="portrait">
1715

1816
<provider

‎library/src/main/java/com/vansuita/pickimage/dialog/PickImageBaseDialog.java

-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ protected void launchCamera() {
265265
}
266266

267267
protected void launchGallery() {
268-
if (resolver.requestGalleryPermissions(this))
269268
resolver.launchGallery(this, setup.getGalleryChooserTitle());
270269
}
271270

‎library/src/main/java/com/vansuita/pickimage/resolver/IntentResolver.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,7 @@ public void launchSystemChooser(Fragment listener) {
233233

234234
private String[] getAllPermissionsNeeded() {
235235
return new String[]{
236-
Manifest.permission.CAMERA,
237-
Manifest.permission.WRITE_EXTERNAL_STORAGE};
236+
Manifest.permission.CAMERA};
238237
}
239238

240239
public boolean wasCameraPermissionDeniedForever() {
@@ -255,9 +254,6 @@ public boolean requestCameraPermissions(Fragment listener) {
255254
return requestPermissions(listener, getAllPermissionsNeeded());
256255
}
257256

258-
public boolean requestGalleryPermissions(Fragment listener) {
259-
return requestPermissions(listener, Manifest.permission.WRITE_EXTERNAL_STORAGE);
260-
}
261257

262258
/**
263259
* resquest permission to use camera and write files

0 commit comments

Comments
 (0)