From a8bf381565b9804cc9801bc0e037a8e904e9c120 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 4 Dec 2020 11:19:34 +0100 Subject: [PATCH] updating the photo/video editor, add new modules --- .gitignore | 2 ++ app/build.gradle | 8 +++++ .../pro/activities/NewPhotoEditActivity.kt | 29 ++++++++++--------- .../pro/activities/NewVideoEditActivity.kt | 29 ++++++++++--------- 4 files changed, 40 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 4cd1c5eed..d94d37b66 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ /captures keystore.jks keystore.properties +/app/src/proprietary/assets/pesdk_license +/app/src/proprietary/assets/vesdk_license diff --git a/app/build.gradle b/app/build.gradle index 6813cd5a8..a6610aaf2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -123,13 +123,21 @@ if (is_proprietary) { include 'ui:focus' include 'ui:brush' include 'ui:filter' + include 'ui:sticker' + include 'ui:overlay' include 'ui:transform' include 'ui:adjustment' include 'backend:serializer' + include 'backend:sticker-smart' + include 'backend:sticker-animated' include 'assets:font-basic' include 'assets:filter-basic' + include 'assets:overlay-basic' + include 'assets:sticker-shapes' + include 'assets:sticker-emoticons' + include 'assets:sticker-animated' } } } diff --git a/app/src/proprietary/kotlin/com/simplemobiletools/gallery/pro/activities/NewPhotoEditActivity.kt b/app/src/proprietary/kotlin/com/simplemobiletools/gallery/pro/activities/NewPhotoEditActivity.kt index bff43f0b3..00e9ed203 100644 --- a/app/src/proprietary/kotlin/com/simplemobiletools/gallery/pro/activities/NewPhotoEditActivity.kt +++ b/app/src/proprietary/kotlin/com/simplemobiletools/gallery/pro/activities/NewPhotoEditActivity.kt @@ -22,6 +22,10 @@ import com.simplemobiletools.gallery.pro.extensions.tryDeleteFileDirItem import ly.img.android.pesdk.PhotoEditorSettingsList import ly.img.android.pesdk.assets.filter.basic.FilterPackBasic import ly.img.android.pesdk.assets.font.basic.FontPackBasic +import ly.img.android.pesdk.assets.overlay.basic.OverlayPackBasic +import ly.img.android.pesdk.assets.sticker.animated.StickerPackAnimated +import ly.img.android.pesdk.assets.sticker.emoticons.StickerPackEmoticons +import ly.img.android.pesdk.assets.sticker.shapes.StickerPackShapes import ly.img.android.pesdk.backend.model.config.CropAspectAsset import ly.img.android.pesdk.backend.model.constant.ImageExportFormat import ly.img.android.pesdk.backend.model.constant.OutputMode @@ -32,8 +36,8 @@ import ly.img.android.pesdk.backend.model.state.manager.SettingsList import ly.img.android.pesdk.ui.activity.PhotoEditorBuilder import ly.img.android.pesdk.ui.model.state.* import ly.img.android.pesdk.ui.panels.item.CropAspectItem +import ly.img.android.pesdk.ui.panels.item.PersonalStickerAddItem import ly.img.android.pesdk.ui.panels.item.ToggleAspectItem -import ly.img.android.pesdk.ui.panels.item.ToolItem import java.io.File import java.io.InputStream import java.io.OutputStream @@ -269,21 +273,18 @@ class NewPhotoEditActivity : SimpleActivity() { brushSize = applicationContext.config.editorBrushSize } - // do not use Text Design, it takes up too much space - val tools = getSettingsModel(UiConfigMainMenu::class.java).toolList - val newTools = tools.filterNot { - it.name!!.isEmpty() - }.toMutableList() as ArrayList - - // move Focus at the end, as it is the least used - // on some devices it is not obvious that the toolbar can be scrolled horizontally, so move the best ones at the beginning to make them visible - val focus = newTools.firstOrNull { it.name == getString(R.string.pesdk_focus_title_name) } - if (focus != null) { - newTools.remove(focus) - newTools.add(focus) + configure { + it.setOverlayList(OverlayPackBasic.getOverlayPack()) } - getSettingsModel(UiConfigMainMenu::class.java).setToolList(newTools) + configure { + it.setStickerLists( + PersonalStickerAddItem(), + StickerPackEmoticons.getStickerCategory(), + StickerPackShapes.getStickerCategory(), + StickerPackAnimated.getStickerCategory() + ) + } getSettingsModel(UiConfigTheme::class.java).theme = R.style.Imgly_Theme_NoFullscreen diff --git a/app/src/proprietary/kotlin/com/simplemobiletools/gallery/pro/activities/NewVideoEditActivity.kt b/app/src/proprietary/kotlin/com/simplemobiletools/gallery/pro/activities/NewVideoEditActivity.kt index 3c4933b8e..017e0b7fc 100644 --- a/app/src/proprietary/kotlin/com/simplemobiletools/gallery/pro/activities/NewVideoEditActivity.kt +++ b/app/src/proprietary/kotlin/com/simplemobiletools/gallery/pro/activities/NewVideoEditActivity.kt @@ -22,6 +22,10 @@ import com.simplemobiletools.gallery.pro.extensions.tryDeleteFileDirItem import ly.img.android.pesdk.VideoEditorSettingsList import ly.img.android.pesdk.assets.filter.basic.FilterPackBasic import ly.img.android.pesdk.assets.font.basic.FontPackBasic +import ly.img.android.pesdk.assets.overlay.basic.OverlayPackBasic +import ly.img.android.pesdk.assets.sticker.animated.StickerPackAnimated +import ly.img.android.pesdk.assets.sticker.emoticons.StickerPackEmoticons +import ly.img.android.pesdk.assets.sticker.shapes.StickerPackShapes import ly.img.android.pesdk.backend.model.config.CropAspectAsset import ly.img.android.pesdk.backend.model.constant.OutputMode import ly.img.android.pesdk.backend.model.state.BrushSettings @@ -31,8 +35,8 @@ import ly.img.android.pesdk.backend.model.state.manager.SettingsList import ly.img.android.pesdk.ui.activity.VideoEditorBuilder import ly.img.android.pesdk.ui.model.state.* import ly.img.android.pesdk.ui.panels.item.CropAspectItem +import ly.img.android.pesdk.ui.panels.item.PersonalStickerAddItem import ly.img.android.pesdk.ui.panels.item.ToggleAspectItem -import ly.img.android.pesdk.ui.panels.item.ToolItem import java.io.File import java.io.InputStream import java.io.OutputStream @@ -268,21 +272,18 @@ class NewVideoEditActivity : SimpleActivity() { brushSize = applicationContext.config.editorBrushSize } - // do not use Text Design, it takes up too much space - val tools = getSettingsModel(UiConfigMainMenu::class.java).toolList - val newTools = tools.filterNot { - it.name!!.isEmpty() - }.toMutableList() as ArrayList - - // move Focus at the end, as it is the least used - // on some devices it is not obvious that the toolbar can be scrolled horizontally, so move the best ones at the beginning to make them visible - val focus = newTools.firstOrNull { it.name == getString(R.string.pesdk_focus_title_name) } - if (focus != null) { - newTools.remove(focus) - newTools.add(focus) + configure { + it.setOverlayList(OverlayPackBasic.getOverlayPack()) } - getSettingsModel(UiConfigMainMenu::class.java).setToolList(newTools) + configure { + it.setStickerLists( + PersonalStickerAddItem(), + StickerPackEmoticons.getStickerCategory(), + StickerPackShapes.getStickerCategory(), + StickerPackAnimated.getStickerCategory() + ) + } getSettingsModel(UiConfigTheme::class.java).theme = R.style.Imgly_Theme_NoFullscreen