public class ImageEditingManager extends ReactContextBaseJavaModule
BaseJavaModule.JavaMethod, BaseJavaModule.SyncJavaHook
NativeModule.NativeMethod, NativeModule.SyncNativeHook
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, getReactApplicationContext
canOverrideExistingModule, getMethods, getSyncHooks, initialize, onReactBridgeInitialized, supportsWebWorkers, writeConstantsField
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 BaseJavaModule
public void onCatalystInstanceDestroy()
NativeModule
onCatalystInstanceDestroy
in interface NativeModule
onCatalystInstanceDestroy
in class BaseJavaModule
public 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.)