Comments (10)
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.
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.
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.
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.
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.
Any updates on this? Seems to be crippling an otherwise very useful lib!
from android-crop.
Running into similar problem :(
from android-crop.
Hi,
Has there been any progress on this?
from android-crop.
@axelfran Yep. This is fixed since at least 1.0.0.
from android-crop.
Thanks, @jdamcd! :)
from android-crop.
Related Issues (20)
- Oppo security loophole
- Re-crop the image at a time
- Request: make CropImageView more modularized, and allow to use it by itself
- Suggestion: remove "context" field of CropImageView
- Canvas: trying to draw too large(119501824bytes) bitmap. HOT 4
- Call to OpenGL ES API with no current context
- onActivityResult is null in VERSION.SDK_INT <= 19
- Transparent
- Is it possible to set the selection area aspect-ratio fixed while changing its size?
- Significant Increase in File Size
- Crash disabling permission HOT 2
- image rotate during cropping of the image after i successfully capture a picture from my camera. HOT 2
- Ucrop.resultCode returns 69 after cropping in oreo. HOT 1
- Can't resolve Extra.FILES
- Crop Guidline.
- OOM Issue When Crop 18 mb up images HOT 1
- Change localize not work HOT 1
- 🚨🚨🚨🚨🚨 THIS LIBRARY IS NOT MAINTAINED, PLEASE READ THIS 🚨🚨🚨🚨🚨
- android 小米手机选择相册图片截取照片不进onActivityResult报“保存时发生错误,保存失败”
- we can crop out of image size?
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 android-crop.