-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release 2.0.0 #171
Release 2.0.0 #171
Conversation
- Added two functions to be called with the new Result API - Gradle wrapper update - Gradle Dependencies update
@Dhaval2404 could you check this one please? On May 5th Google will start removing apps from Play Store which use legacy storage |
@GuilhE But in your version (release-2.0.0), the sample app <queries>
<intent>
<action android:name="android.media.action.IMAGE_CAPTURE" />
</intent>
</queries> It still shows the error:
|
I'm using the following configuration in a project and it works with Pixel 3a running Android 11
But then I've found out that I've a merged manifest with: So that's why it's working... 🤔 I'll dig into it as soon as possible. |
@Drjacky ok quick update, I've removed that import and now there's no
|
@GuilhE <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.imagepicker">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application>
<activity
android:name="com.example.imagepicker.ImagePickerActivity"
android:screenOrientation="unspecified"
android:theme="@style/Theme.Transparent.ImagePicker" />
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
<provider
android:name="com.example.imagepicker.ImagePickerFileProvider"
android:authorities="${applicationId}.imagepicker.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/image_picker_provider_paths" />
</provider>
</application>
</manifest>
Sample app's AndroidManifest: <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.imagepicker.sample">
<queries>
<intent>
<action android:name="android.media.action.IMAGE_CAPTURE" />
</intent>
</queries>
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:fullBackupContent="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name="com.example.imagepicker.sample.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest> Provider paths: <?xml version="1.0" encoding="utf-8"?>
<paths>
<external-path
name="external_files"
path="." />
<files-path
name="internal_files"
path="." />
<cache-path
name="cache_files"
path="." />
</paths> |
@GuilhE Please use this sample app: https://github.com/GuilhE/ImagePicker/tree/release-2.0.0/sample |
@Drjacky comment this line and it will work. I'll remove it from the sample. Also, IDE complains about it:
If you import from Camera using the this method it works, again, because no |
You're right. with that scenario, it shows the taken picture. And in the app, when I pressed Gallery, none of them had been listed! Update: After a cold boot, it listed all of those pictures too ;) |
@GuilhE Same PR, which works perfectly on Android API 30, It doesn't work on Android API 29 , x86_64, Camera: Failed to Create camera file image Update: It works on Android API 28, x86 Update: It works on Android API 21, x86 Update: It doesn't work on Android API 29, x86 either |
@GuilhE To fix the camera issue on API 29, I've changed the private fun getCameraDirectory(context: Context): File {
val dir =
context.getExternalFilesDir(Environment.DIRECTORY_DCIM)// Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)
return File(dir, "Camera")
} Now, the camera works on API 29 but, Gallery has the issue! private val galleryLauncher =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
if (it.resultCode == Activity.RESULT_OK) {
Update: The root of the Gallery issue on API 29 COULD BE here
Sometimes, I'm getting permission denied! https://developer.android.com/about/versions/11/privacy/storage Update: with
|
Changelog
Fork 2.0.0
CompressionProvider.kt
logic refactorfun compress(maxSize: Int): Builder
since it was comparing the size of the file and not the image (and the resize operation is enough);fun maxResultSize(width: Int, height: Int, keepRatio: Boolean = false): Builde
;Fork 1.9.1
sstartActivityForResult
from library since caller is responsible to provide anActivityResultLauncher<Intent>
Fork 1.9.0