Last active
March 20, 2017 12:14
-
-
Save maltebaumann/35755ea9df5766908585c1f38561d6c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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