class VideoFocusConfiguration(private val activity: AppCompatActivity) : Example(activity) {
override fun invoke() {
val settingsList = VideoEditorSettingsList(false)
.configure<LoadSettings> {
it.source = activity.resourceUri(R.raw.skater)
}
settingsList.configure<UiConfigFocus> {
val focusOptions = listOf(
FocusOption(FocusToolPanel.OPTION_NO_FOCUS),
FocusOption(FocusToolPanel.OPTION_RADIAL),
FocusOption(FocusToolPanel.OPTION_MIRRORED)
)
it.optionList.set(focusOptions)
}
VideoEditorBuilder(activity)
.setSettingsList(settingsList)
.startActivityForResult(activity, EDITOR_REQUEST_CODE)
settingsList.release()
}
override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent?) {
intent ?: return
if (requestCode == EDITOR_REQUEST_CODE) {
val result = EditorSDKResult(intent)
when (result.resultStatus) {
EditorSDKResult.Status.CANCELED -> showMessage("Editor cancelled")
EditorSDKResult.Status.EXPORT_DONE -> showMessage("Result saved at ${result.resultUri}")
else -> {
}
}
}
}
}