Giter Club home page Giter Club logo

Comments (21)

ioviov avatar ioviov commented on May 28, 2024 2

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

SampleImagePicker.zip

Thank you

from imagepicker.

Drjacky avatar Drjacky commented on May 28, 2024

#12 (comment)

&

https://developer.android.com/training/basics/intents/result#java


A random sample app in java using ImagePicker:

https://github.com/AbdullahMoustafa/Projask_AndriodApp1/blob/6d97a893ea318b4f33b1c1dbf482900629bdc76f/supervisor/src/main/java/com/zedan/acare/supervisor/ui/profile/ProfileFragment.java#L214

https://github.com/AbdullahMoustafa/Projask_AndriodApp1/blob/6d97a893ea318b4f33b1c1dbf482900629bdc76f/supervisor/src/main/java/com/zedan/acare/supervisor/utils/ImageSelectorUtil.java

from imagepicker.

ioviov avatar ioviov commented on May 28, 2024

I'm sorry
I see errors in builder, as I understand in your library there are no thees methods, see attached files.

Screenshot at May 05 16-21-45

Screenshot at May 05 16-22-01

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.

Drjacky avatar Drjacky commented on May 28, 2024

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.

Drjacky avatar Drjacky commented on May 28, 2024

@ioviov Instead of start(), use createIntent() or createIntentFromDialog().

from imagepicker.

ioviov avatar ioviov commented on May 28, 2024

@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.

ioviov avatar ioviov commented on May 28, 2024

I tried use 2.1.6 but during Sync task I see error

My class public class MyApplication extends MultiDexApplication {

Screenshot at May 06 11-57-07

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.

Drjacky avatar Drjacky commented on May 28, 2024

@ioviov Please test v2.1.7 and let me know if the issue solved or not.

from imagepicker.

ioviov avatar ioviov commented on May 28, 2024

@Drjacky I can't do Sync task : (

Screenshot at May 07 20-09-28

from imagepicker.

Drjacky avatar Drjacky commented on May 28, 2024

@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.

ioviov avatar ioviov commented on May 28, 2024

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.

Drjacky avatar Drjacky commented on May 28, 2024

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.

ioviov avatar ioviov commented on May 28, 2024

Well I have the same

Screenshot at May 07 20-57-58

And

Screenshot at May 07 20-59-27

from imagepicker.

ioviov avatar ioviov commented on May 28, 2024

And

Screenshot at May 07 21-00-53

from imagepicker.

Drjacky avatar Drjacky commented on May 28, 2024

Okay, forget the Jitpack. It's on maven now: https://repo1.maven.org/maven2/com/github/Drjacky/ImagePicker/2.1.7/

from imagepicker.

ioviov avatar ioviov commented on May 28, 2024

@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.

Drjacky avatar Drjacky commented on May 28, 2024

Could you create a sample project and attach it here?

from imagepicker.

ioviov avatar ioviov commented on May 28, 2024

Ok, I will do it on next week (I'll try on Monday), thanks

from imagepicker.

Drjacky avatar Drjacky commented on May 28, 2024

@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.

ioviov avatar ioviov commented on May 28, 2024

@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.

Drjacky avatar Drjacky commented on May 28, 2024

v2.1.8 released.

from imagepicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.