Skip to content

Commit

Permalink
Merge pull request #152 from yogeshpaliyal/android12-compatible
Browse files Browse the repository at this point in the history
Compatible With Android 12 | SDK 31
  • Loading branch information
yogeshpaliyal committed Mar 5, 2022
2 parents fa1a1a1 + 987c8ca commit afd51b4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ buildscript {
}

android {
compileSdkVersion 30
compileSdkVersion 31
buildToolsVersion '28.0.2'
defaultConfig {
applicationId 'com.vansuita.pickimage.sample'
minSdkVersion 14
targetSdkVersion 30
targetSdkVersion 31
versionCode 4
versionName "1.0"
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
android:theme="@style/AppTheme">
<activity
android:name=".act.SampleActivity"
android:screenOrientation="sensorPortrait">
android:screenOrientation="sensorPortrait"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
2 changes: 0 additions & 2 deletions library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />

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


<application
android:configChanges="orientation"
android:label="@string/app_name"
android:requestLegacyExternalStorage="true"
android:screenOrientation="portrait">

<provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ protected void launchCamera() {
}

protected void launchGallery() {
if (resolver.requestGalleryPermissions(this))
resolver.launchGallery(this, setup.getGalleryChooserTitle());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ public void launchSystemChooser(Fragment listener) {

private String[] getAllPermissionsNeeded() {
return new String[]{
Manifest.permission.CAMERA,
Manifest.permission.WRITE_EXTERNAL_STORAGE};
Manifest.permission.CAMERA};
}

public boolean wasCameraPermissionDeniedForever() {
Expand All @@ -255,9 +254,6 @@ public boolean requestCameraPermissions(Fragment listener) {
return requestPermissions(listener, getAllPermissionsNeeded());
}

public boolean requestGalleryPermissions(Fragment listener) {
return requestPermissions(listener, Manifest.permission.WRITE_EXTERNAL_STORAGE);
}

/**
* resquest permission to use camera and write files
Expand Down

0 comments on commit afd51b4

Please sign in to comment.