public class ImageEditingManager extends ReactContextBaseJavaModule
NativeModule.NativeMethod| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
METHOD_TYPE_ASYNC, METHOD_TYPE_PROMISE, METHOD_TYPE_SYNC| Constructor and Description |
|---|
ImageEditingManager(ReactApplicationContext reactContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
cropImage(java.lang.String uri,
ReadableMap options,
Callback success,
Callback error)
Crop an image.
|
java.util.Map<java.lang.String,java.lang.Object> |
getConstants() |
java.lang.String |
getName() |
void |
onCatalystInstanceDestroy()
Called before {CatalystInstance#onHostDestroy}
|
getCurrentActivity, getReactApplicationContextcanOverrideExistingModule, hasConstants, initialize, invalidatepublic static final java.lang.String NAME
public ImageEditingManager(ReactApplicationContext reactContext)
public java.lang.String getName()
require() this module
from javascript.public java.util.Map<java.lang.String,java.lang.Object> getConstants()
getConstants in class BaseJavaModulepublic void onCatalystInstanceDestroy()
NativeModuleonCatalystInstanceDestroy in interface NativeModuleonCatalystInstanceDestroy in class BaseJavaModulepublic void cropImage(java.lang.String uri,
ReadableMap options,
Callback success,
Callback error)
uri - the MediaStore URI of the image to cropoptions - crop parameters specified as {offset: {x, y}, size: {width, height}}.
Optionally this also contains {targetSize: {width, height}}. If this is specified,
the cropped image will be resized to that size. All units are in pixels (not DPs).success - callback to be invoked when the image has been cropped; the only argument that
is passed to this callback is the file:// URI of the new imageerror - callback to be invoked when an error occurs (e.g. can't create file etc.)