public class CropImageActivity extends AppCompatActivity implements CropImageView.OnSetImageUriCompleteListener, CropImageView.OnCropImageCompleteListener
CropImage.activity(Uri) to create a builder to start this activity.| Constructor and Description |
|---|
CropImageActivity() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cropImage()
Execute crop image and save the result tou output uri.
|
protected android.net.Uri |
getOutputUri()
Get Android uri to save the cropped image into.
Use the given in options or create a temp file. |
protected android.content.Intent |
getResultIntent(android.net.Uri uri,
java.lang.Exception error,
int sampleSize)
Get intent instance to be used for the result of this activity.
|
protected void |
onActivityResult(int requestCode,
int resultCode,
android.content.Intent data) |
void |
onBackPressed() |
void |
onCreate(android.os.Bundle savedInstanceState) |
boolean |
onCreateOptionsMenu(android.view.Menu menu) |
void |
onCropImageComplete(CropImageView view,
CropImageView.CropResult result)
Called when a crop image view has completed cropping image.
Result object contains the cropped bitmap, saved cropped image uri, crop points data or the error occured during cropping. |
boolean |
onOptionsItemSelected(android.view.MenuItem item) |
void |
onRequestPermissionsResult(int requestCode,
java.lang.String[] permissions,
int[] grantResults) |
void |
onSetImageUriComplete(CropImageView view,
android.net.Uri uri,
java.lang.Exception error)
Called when a crop image view has completed loading image for cropping.
If loading failed error parameter will contain the error. |
protected void |
onStart() |
protected void |
onStop() |
protected void |
rotateImage(int degrees)
Rotate the image in the crop image view.
|
protected void |
setResult(android.net.Uri uri,
java.lang.Exception error,
int sampleSize)
Result with cropped image data or error if failed.
|
protected void |
setResultCancel()
Cancel of cropping activity.
|
public void onCreate(android.os.Bundle savedInstanceState)
protected void onStart()
protected void onStop()
public boolean onCreateOptionsMenu(android.view.Menu menu)
public boolean onOptionsItemSelected(android.view.MenuItem item)
public void onBackPressed()
protected void onActivityResult(int requestCode,
int resultCode,
android.content.Intent data)
public void onRequestPermissionsResult(int requestCode,
java.lang.String[] permissions,
int[] grantResults)
public void onSetImageUriComplete(CropImageView view, android.net.Uri uri, java.lang.Exception error)
CropImageView.OnSetImageUriCompleteListeneronSetImageUriComplete in interface CropImageView.OnSetImageUriCompleteListenerview - The crop image view that loading of image was complete.uri - the URI of the image that was loadingerror - if error occurred during loading will contain the error, otherwise null.public void onCropImageComplete(CropImageView view, CropImageView.CropResult result)
CropImageView.OnCropImageCompleteListeneronCropImageComplete in interface CropImageView.OnCropImageCompleteListenerview - The crop image view that cropping of image was complete.result - the crop image result data (with cropped image or error)protected void cropImage()
protected void rotateImage(int degrees)
protected android.net.Uri getOutputUri()
protected void setResult(android.net.Uri uri,
java.lang.Exception error,
int sampleSize)
protected void setResultCancel()
protected android.content.Intent getResultIntent(android.net.Uri uri,
java.lang.Exception error,
int sampleSize)