Comments (21)
Hi!
I created the sample
I tested with implementation 'com.github.dhaval2404:imagepicker:1.8'
and it works fine. I can chose image or take a photo
With you library when I tap on ImageView
nothing to happen
Thank you
from imagepicker.
&
https://developer.android.com/training/basics/intents/result#java
A random sample app in java using ImagePicker:
from imagepicker.
I'm sorry
I see errors in builder, as I understand in your library there are no thees methods, see attached files.
In Readme I see:
ImagePicker.Companion.with(this)
.crop() //Crop image(Optional), Check Customization for more option
.cropOval() //Allow dimmed layer to have a circle inside
.compress(1024) //Final image size will be less than 1 MB(Optional)
.maxResultSize(1080, 1080) //Final image resolution will be less than 1080 x 1080(Optional)
.start()
from imagepicker.
You're right. I need to edit the Readme.
There is no need for compress
method; It has been removed since it was comparing the size of the file and not the image, and the resize operation is enough to reduce the size of the final file.
Thanks for addressing this.
from imagepicker.
@ioviov Instead of start()
, use createIntent()
or createIntentFromDialog()
.
from imagepicker.
@Drjacky I tried using createIntent()
on simulator and real phone, but it's not working, nothing appears.
Possibly in version 2.1.6 this fixed, I will try
Also in Readme you wrote maxResultSize(1080, 1080)
but for java you should use maxResultSize(1080, 1080, false)
from imagepicker.
I tried use 2.1.6 but during Sync task I see error
My class public class MyApplication extends MultiDexApplication {
I fixed this by added in my Manifest xmlns:tools="http://schemas.android.com/tools"
and tools:replace="name"
So I use createIntent()
and it's not working, nothing appears.
from imagepicker.
@ioviov Please test v2.1.7 and let me know if the issue solved or not.
from imagepicker.
@Drjacky I can't do Sync task : (
from imagepicker.
@ioviov Sorry, maven has an issue right now. It doesn't accept new uploads.
Right now, it's on JitPack: https://jitpack.io/#Drjacky/ImagePicker/2.1.7
from imagepicker.
It's ok
Sorry, I'm not guru on Java, so I need to wait? Or what I should to do right now?
Thanks!
from imagepicker.
Click on the link and check the HOW TO section:
To get a Git project into your build:
Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.Drjacky:ImagePicker:2.1.7'
}
Let me know if it works.
from imagepicker.
Well I have the same
And
from imagepicker.
And
from imagepicker.
Okay, forget the Jitpack. It's on maven now: https://repo1.maven.org/maven2/com/github/Drjacky/ImagePicker/2.1.7/
from imagepicker.
@Drjacky Well, it's ok
Manifest merge failed is fixed now, thanks!
But createIntent()
still not working
When I tap on View nothing happens
from imagepicker.
Could you create a sample project and attach it here?
from imagepicker.
Ok, I will do it on next week (I'll try on Monday), thanks
from imagepicker.
@ioviov
SampleImagePicker-Solution.zip
You would need to define which one you want: galleryOnly
, cameraOnly
;
And if you want both, the createIntent
changes to createIntentFromDialog
:
ImagePicker.Companion.with(requireActivity())
.crop()
.cropOval()
.maxResultSize(512, 512, true)
.createIntentFromDialog((Function1) (new Function1() {
public Object invoke(Object var1) {
this.invoke((Intent) var1);
return Unit.INSTANCE;
}
public final void invoke(@NotNull Intent it) {
Intrinsics.checkNotNullParameter(it, "it");
galleryLauncher.launch(it);
}
}));
P.S I've improved some other parts too. Good to check.
from imagepicker.
@Drjacky A lot of thanks!!!
It works good!
It will be good that you write this full example, how to use library on Java in README, for another users
ActivityResultLauncher<Intent> galleryLauncher =
registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), (ActivityResult result) -> {
if (result.getResultCode() == RESULT_OK) {
Uri uri = result.getData().getData();
// For example
Picasso.get().load(uri).into(avatarImageView);
} else if (result.getResultCode() == ImagePicker.RESULT_ERROR) {
// Use ImagePicker.Companion.getError(result.getData()) to show an error
}
});
ImagePicker.Companion.with(requireActivity())
.cropSquare()
.maxResultSize(1080, 1080, true)
.createIntentFromDialog((Function1) (new Function1() {
public Object invoke(Object var1) {
this.invoke((Intent) var1);
return Unit.INSTANCE;
}
public final void invoke(@NotNull Intent it) {
Intrinsics.checkNotNullParameter(it, "it");
galleryLauncher.launch(it);
}
}));
from imagepicker.
v2.1.8 released.
from imagepicker.
Related Issues (20)
- Black Image returned when cropping large images with higher resolution especially raw camera photos, tried it with a (3456 * 4608) . It doesn't crash though. HOT 6
- Setting up different languages HOT 1
- Android 13 not workinf HOT 4
- WRITE_EXTERNAL_STORAGE is denied between Sdk 29 and 33. HOT 2
- Getting ANR in some devices when picking from Gallery.
- [Crash] CropProvider.convertBitmapToFile - java.io.IOException - No such file or directory HOT 2
- Image provider can not be null
- In AndroidManifast file, Kindly updated the <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />, like android:maxSdkVersion="33" this permission not working in android 10, 11, 12 devices
- Delete image when succesfull
- Screen Orientation Issue: Image Picker HOT 4
- Java Sample HOT 1
- API 29 crop image preview not showing black screen only available after crop HOT 1
- Image compression not working in android 12 when crop not enabled HOT 7
- app crash when launch HOT 1
- Cropped Aspect Ratio! HOT 1
- Manifest merger failed : Attribute activity#com.yalantis.ucrop.UCropActivity@theme value=(@style/CameraTheme) from [paysprint_onboarding_live_1_0_9.aar] AndroidManifest.xml:56:13-47
- Could not scale to target size HOT 1
- Open front camera at first.
- [Crash] When picking a camera image without setting crop() HOT 1
- return error "Image provider can not be null"? Any idea...
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagepicker.