Closed cesariel closed 6 years ago
I change the Cropper Class to:
public class Cropper {
private Uri source;
private Uri destination;
public Cropper(Uri source, Uri destination) {
this.source = source;
this.destination = destination;
}
public Crop Cropper (Uri source, Uri destination){
return Crop.of(source, destination);
}
static interface Extra {
String ASPECT_X = "aspect_x";
String ASPECT_Y = "aspect_y";
}
/*
public Cropper(Uri source) {
super(source);
this.source = source;
}*/
/**
* @return Intent that will open the crop activity with an adjustable bounds for the cropping square.
* * * */
public Intent getIntent(Context context, Uri output){
Intent cropIntent = new Intent();
cropIntent.setData(source);
cropIntent.setClass(context, CropImageActivity.class);
cropIntent.putExtra(Extra.ASPECT_X, 1);
cropIntent.putExtra(Extra.ASPECT_Y, 1);
cropIntent.putExtra(MediaStore.EXTRA_OUTPUT, output);
return cropIntent;
}
/**
* @return Intent that will open the crop activity with an adjustable bounds for the cropping quare.
* * * */
public Intent getAdjustIntent(Context context, Uri output){
Intent cropIntent = new Intent();
cropIntent.setData(source);
cropIntent.setClass(context, CropImageActivity.class);
cropIntent.putExtra(MediaStore.EXTRA_OUTPUT, output);
return cropIntent;
}
}
To instantiate a new Cropper:
crop = new Cropper(uri, outputUri);
When trying to change the Profile Picture I get this error: