opensooq / gligar Goto Github PK
View Code? Open in Web Editor NEW📸Image Picker for Android, Pick an image from Gallery or Capture a new image with Camera.
Home Page: https://engineering.opensooq.com
License: Apache License 2.0
📸Image Picker for Android, Pick an image from Gallery or Capture a new image with Camera.
Home Page: https://engineering.opensooq.com
License: Apache License 2.0
Describe the bug
Getting following error when selecting the camera option.
I tried the same function after wiping emulator and on an android 10 device.
Is there any method to provide a custom file provider to Gligar instance?
E/Picker: Failed to find configured root that contains /storage/emulated/0/Android/data/{PACKAGE}/files/Pictures/JPEG_20210411_124746_450436341.jpg
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Camera interface should appear and allow user to capture images
Screenshots
If applicable, add screenshots to help explain your problem.
Include stack trace if exist
E/Picker: Failed to find configured root that contains /storage/emulated/0/Android/data/PACKAGE/files/Pictures/JPEG_20210411_124746_450436341.jpg
java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/emulated/0/Android/data/PACKAGE/files/Pictures/JPEG_20210411_124746_450436341.jpg
at androidx.core.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:744)
at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:418)
at com.opensooq.supernova.gligar.ui.ImagePickerActivity.cameraPermissionGranted(ImagePickerActivity.kt:145)
at com.opensooq.supernova.gligar.ui.ImagePickerActivity.checkCameraPermission(ImagePickerActivity.kt:169)
at com.opensooq.supernova.gligar.ui.ImagePickerActivity.openCamera(ImagePickerActivity.kt:127)
at com.opensooq.supernova.gligar.ui.ImagePickerActivity.onItemClicked(ImagePickerActivity.kt:256)
at com.opensooq.supernova.gligar.adapters.ImagesAdapter$onBindViewHolder$1.onClick(ImagesAdapter.kt:38)
at android.view.View.performClick(View.java:5637)
at android.view.View$PerformClick.run(View.java:22429)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Smartphone (please complete the following information):
Describe the bug
App crash when take photo if have two camera apps ( system camera app + open camera )
To Reproduce
Steps to reproduce the behavior:
Open camera direct or camera from gallery with two camera app on phone
Expected behavior
after selecting the app to use to take the image (system or other) it should work without app crash
Screenshots
If applicable, add screenshots to help explain your problem.
Include stack trace if exist
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
Hi, Could do explain to me why I have to merge manifest of my app to use provider to your api why I need for that
Thanks a lot
IllegalStateException is thrown when the user picks the images from the library's gallery
Fatal Exception: java.lang.IllegalStateException: albumCursor.getString(al…dex(DISPLAY_NAME_COLUMN)) must not be null
at com.opensooq.supernova.gligar.dataSource.ImagesDataSource$loadAlbums$1.invoke(ImagesDataSource.java:40)
at com.opensooq.supernova.gligar.dataSource.ImagesDataSource$loadAlbums$1.invoke(ImagesDataSource.java:22)
at com.opensooq.supernova.gligar.utils.ExtKt.doWhile(ExtKt.java:26)
at com.opensooq.supernova.gligar.dataSource.ImagesDataSource.loadAlbums(ImagesDataSource.java:38)
at com.opensooq.supernova.gligar.ui.PickerViewModel$getAlbums$2.invokeSuspend(PickerViewModel.java:104)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:241)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:594)
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.java:60)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.java:740)
Would it be possible to be able to change the cardcornerradius aswell as the card elevation?
If we select the camera to click picture then it shows the image in grid for then . But when we open the gallery app then that captured images are not shown in gallery.
-Device :Asus Max Pro M1
Thanks for the awesome Library. Since the onActivityResult are Deprecated. Please Add support for the New Activity Result APIs.
https://developer.android.com/training/basics/intents/result
Describe the bug
Application crashes when gligar activity is launched (After allow permissions for the first time too).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Show the list of local image files.
Include stack trace if exist
E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
E/AndroidRuntime: FATAL EXCEPTION: main
Process: avanceingenieros.com.app, PID: 6152
java.lang.IllegalArgumentException: Invalid token LIMIT
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:472)
at android.content.ContentResolver.query(ContentResolver.java:1183)
at android.content.ContentResolver.query(ContentResolver.java:1115)
at android.content.ContentResolver.query(ContentResolver.java:1071)
at com.opensooq.supernova.gligar.dataSource.ImagesDataSource.loadAlbumImages(ImagesDataSource.kt:64)
at com.opensooq.supernova.gligar.ui.PickerViewModel$getImages$2.invokeSuspend(PickerViewModel.kt:99)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Smartphone (please complete the following information):
When there exists images in the root folder of the internal storage, the library crashes on start. (some kind of null exception). When the images are removed, it works fine. Occurred in pIxel 3 device.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Include stack trace if exist
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
2022-04-30 15:10:01.343 21348-21348/com.example.imagepicker E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
2022-04-30 15:10:01.350 21348-21348/com.example.imagepicker E/ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).
2022-04-30 15:10:01.368 21348-21348/com.example.imagepicker E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.imagepicker, PID: 21348
java.lang.IllegalArgumentException: Invalid token LIMIT
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:481)
at android.content.ContentResolver.query(ContentResolver.java:1226)
at android.content.ContentResolver.query(ContentResolver.java:1158)
at android.content.ContentResolver.query(ContentResolver.java:1114)
at com.opensooq.supernova.gligar.dataSource.ImagesDataSource.loadAlbumImages(ImagesDataSource.kt:64)
at com.opensooq.supernova.gligar.ui.PickerViewModel$getImages$2.invokeSuspend(PickerViewModel.kt:99)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
this has two problems, first it wont let any other image selected as it requires second user will have to deselect and then only it can select new image and proceeded with it,
either this
new Gligar().requestCode(PICKER_REQUEST_CODE).withFragment(this).limit(1).show()
should allow selection of other images while one is selected or setSingleSelection(true) should be made that could introduce such behavior
Praises to creator
Hello,
Thank you for this beautiful lib. But I need when user select Images and click open the activity again he must show the previous selected images is marked. what if he select 10 images then he he want to add another one!
Thank you
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Include stack trace if exist
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
I want to back with btn on the actionbar. Is it possible to do?
Describe the bug
Thanks for the awesome library, However when setting camera disabled to true it only hides the capture new image button however on clicking the image at position 0 the camera is opened
To Reproduce
Steps to reproduce the behavior:
Expected behavior
When camera is disabled images at position 0 should be marked as selected instead of opening the camera
Additional context
The override fun onItemClicked(position: Int) {
when (position) {
0 -> openCamera()
else -> {
mainViewModel.setImageSelection(position, mImagesAdapter?.images)
}
}
} inside ImagePickerActivity ImagePickerActivity should check on the disabledCamera attribute as well not only the position I would have loved to create a branch with the fix in order to support more but am still trying to get the hang of kotlin
When we capture image from library it shows in the grid but not appear in device gallery neither on gallery nor on any pictures, DCIM folders.
Can you please suggest a solution for this ?
java.lang.IllegalArgumentException: Invalid token LIMIT
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:472)
at android.content.ContentResolver.query(ContentResolver.java:1183)
at android.content.ContentResolver.query(ContentResolver.java:1115)
at android.content.ContentResolver.query(ContentResolver.java:1071)
at com.opensooq.supernova.gligar.dataSource.ImagesDataSource.loadAlbumImages(ImagesDataSource.kt:64)
at com.opensooq.supernova.gligar.ui.PickerViewModel$getImages$2.invokeSuspend(PickerViewModel.kt:99)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:241)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:740)
my code to launch it:
new GligarPicker().requestCode(PICKER_REQUEST_CODE).withActivity(this).show();
Good morning,
I found your library Gliger on the Internet and I am using it in my project and I want to limit the gallery selector only with the jpg extension and I did not find how to do it, can you help me ?
Thank you
Starting the image picker crashes on some devices sometimes. I dont know why. Any idea what the following is about:
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{rstls.pdfbook/com.opensooq.supernova.gligar.ui.ImagePickerActivity}: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Integer
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3488)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3635)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2175)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7860)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)
AND
Caused by java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Integer
at com.opensooq.supernova.gligar.ui.PickerViewModel.loadSaveState$gligar_release(PickerViewModel.java:205)
at com.opensooq.supernova.gligar.ui.ImagePickerActivity.onCreate(ImagePickerActivity.java:118)
at android.app.Activity.performCreate(Activity.java:7955)
at android.app.Activity.performCreate(Activity.java:7944)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3463)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3635)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2175)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7860)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)
This never happened on my test devices so I cannot give any more details. But this seems to constantly happen to about 2% of my users.
I am a beginner so this might be due to some fault of mine? I am confused because this happens only "sometimes" to "some users". Do I have to declare this activity in the AndroidManifest even if its imported or how does this work.
Describe the bug
Gligar currently uses Glide version 4.9 which still use Android support lib. Alot of apps(like mine) are excluding Android support lib and use AndroidX instead.
Solution:
Upgrade to Glide 4.11 (That use only AndroidX) will solve this issue.
Thanks!
With using it in Java:
java.lang.IllegalArgumentException: Invalid token LIMIT
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:472)
at android.content.ContentResolver.query(ContentResolver.java:1183)
at android.content.ContentResolver.query(ContentResolver.java:1115)
at android.content.ContentResolver.query(ContentResolver.java:1071)
at com.opensooq.supernova.gligar.dataSource.ImagesDataSource.loadAlbumImages(ImagesDataSource.kt:64)
at com.opensooq.supernova.gligar.ui.PickerViewModel$getImages$2.invokeSuspend(PickerViewModel.kt:99)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:241)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:740)
my code to launch it:
new GligarPicker().requestCode(PICKER_REQUEST_CODE).withActivity(this).show();
The picker works fine on versions prior to android 10. Taking photos works fine but the picker fails to load local images into the grid.
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.app.menelmalik, PID: 22494
java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 1492168 bytes
at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:160)
at android.os.Handler.handleCallback(Handler.java:907)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
Caused by: android.os.TransactionTooLargeException: data parcel size 1492168 bytes
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:1149)
at android.app.IActivityManager$Stub$Proxy.activityStopped(IActivityManager.java:4005)
at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:144)
at android.os.Handler.handleCallback(Handler.java:907)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
Describe the bug
crash on android 11 bro
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Include stack trace if exist
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.