Skip to content

Instantly share code, notes, and snippets.

@maltebaumann
Last active March 20, 2017 12:14
Show Gist options
  • Save maltebaumann/35755ea9df5766908585c1f38561d6c2 to your computer and use it in GitHub Desktop.
Save maltebaumann/35755ea9df5766908585c1f38561d6c2 to your computer and use it in GitHub Desktop.
public class PESDKModule extends ReactContextBaseJavaModule {
public PESDKModule(ReactApplicationContext reactContext) {
super(reactContext);
}
@Override
public String getName() {
return "PESDK";
}
@ReactMethod
public void present(@NonNull String image) {
if (getCurrentActivity() != null) {
SettingsList settingsList = new SettingsList();
settingsList.getSettingsModel(EditorLoadSettings.class)
.setImageSourcePath(image, true)
.getSettingsModel(EditorSaveSettings.class)
.setExportDir(Directory.DCIM, "test")
.setExportPrefix("result_")
.setSavePolicy(
EditorSaveSettings.SavePolicy.KEEP_SOURCE_AND_CREATE_ALWAYS_OUTPUT
);
new PhotoEditorBuilder(getCurrentActivity())
.setSettingsList(settingsList)
.startActivityForResult(getCurrentActivity(), PESDK_EDITOR_RESULT);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment