Giter VIP home page Giter VIP logo

Comments (10)

jdamcd avatar jdamcd commented on May 18, 2024

Have you tried using the variant of Crop.start() that takes a Context and Fragment? Or do you mean that you need getIntent() to be visible so that you can make changes to the Intent before starting it?

from android-crop.

jabbourb avatar jabbourb commented on May 18, 2024

I ran into similar limitations when launching from a support library fragment. Overloading Crop.start() does the trick, but it doesn't seem to be the most flexible solution (passing extras to the launched intent would require yet another overload), and it adds a useless dependency to the gradle build. IMHO it would be simpler to somehow expose getIntent() rather than trying to foresee all the possible use cases.

from android-crop.

vpratfr avatar vpratfr commented on May 18, 2024

Here is an implementation that does the trick for compatibility just for others who need a quick fix:

package com.soundcloud.android.crop;

import android.content.Context;
import android.net.Uri;
import android.support.v4.app.Fragment;

/**
 * Brings a way to use Crop with the compat library. Make sure that this class is 
 * placed in the com.soundcloud.android.crop package
 *
 * Created by Vincent Mimoun-Prat @ MarvinLabs, 04/08/2014.
 */
public class CropCompat extends Crop {

    public CropCompat(Uri source) {
        super(source);
    }

    @Override
    public CropCompat output(Uri output) {
        super.output(output);
        return this;
    }

    @Override
    public CropCompat withAspect(int x, int y) {
        super.withAspect(x, y);
        return this;
    }

    @Override
    public CropCompat asSquare() {
        super.asSquare();
        return this;
    }

    @Override
    public CropCompat withMaxSize(int width, int height) {
        super.withMaxSize(width, height);
        return this;
    }

    public void start(Context context, Fragment fragment) {
        fragment.startActivityForResult(getIntent(context), REQUEST_CROP);
    }
}

from android-crop.

jdamcd avatar jdamcd commented on May 18, 2024

I think the best resolution for this is a compat module that can be included as a separate dependency, but I don't feel strongly against increasing the visibility of getIntent() as well.

from android-crop.

 avatar commented on May 18, 2024

Any ETA for the release of the enhancement?
Can you also included fixes in the whole picker functions as well?
Thanks!
(I tried implementing your workaround for the pickImage but couldn't get it working... some help would be very much appreciated!)

from android-crop.

Gaudon avatar Gaudon commented on May 18, 2024

Any updates on this? Seems to be crippling an otherwise very useful lib!

from android-crop.

faisalmemon1991 avatar faisalmemon1991 commented on May 18, 2024

Running into similar problem :(

from android-crop.

axelfran avatar axelfran commented on May 18, 2024

Hi,

Has there been any progress on this?

from android-crop.

jdamcd avatar jdamcd commented on May 18, 2024

@axelfran Yep. This is fixed since at least 1.0.0.

from android-crop.

axelfran avatar axelfran commented on May 18, 2024

Thanks, @jdamcd! :)

from android-crop.

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.