Last active
June 9, 2017 08:54
-
-
Save imgly-gists/3fe0c4b1ed05d730d237ddcf306f91cd 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
private Runnable present(final Activity mainActivity, final String filepath, final CallbackContext callbackContext) { | |
callback = callbackContext; | |
final PESDKPlugin self = this; | |
return new Runnable() { | |
public void run() { | |
if (mainActivity != null) { | |
SettingsList settingsList = new SettingsList(); | |
settingsList | |
.getSettingsModel(EditorLoadSettings.class) | |
.setImageSourcePath(filepath.replace("file://", ""), true) // Load with delete protection true! | |
.getSettingsModel(EditorSaveSettings.class) | |
.setExportDir(Directory.DCIM, "test") | |
.setExportPrefix("result_") | |
.setSavePolicy( | |
EditorSaveSettings.SavePolicy.KEEP_SOURCE_AND_CREATE_ALWAYS_OUTPUT | |
); | |
cordova.setActivityResultCallback(self); | |
new PhotoEditorBuilder(mainActivity) | |
.setSettingsList(settingsList) | |
.startActivityForResult(mainActivity, PESDK_EDITOR_RESULT); | |
} | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment