From 96fb6a0e3580c20a5954d8d00389b99ea00f9750 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 10 Apr 2022 17:52:37 +0200 Subject: [PATCH] updating the photo editor, use light theme when appropriate --- app/build.gradle | 2 +- .../gallery/pro/dialogs/SaveAsDialog.kt | 2 +- .../gallery/pro/activities/NewPhotoEditActivity.kt | 12 ++++++++++-- .../gallery/pro/activities/NewVideoEditActivity.kt | 12 ++++++++++-- build.gradle | 2 +- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index cd276c8d2..ba4284eec 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -77,7 +77,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:7b2ff0b5a0' + implementation 'com.github.SimpleMobileTools:Simple-Commons:df1feb973d' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.24' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/SaveAsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/SaveAsDialog.kt index d0ccf7c6a..8d8484ff5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/SaveAsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/SaveAsDialog.kt @@ -7,8 +7,8 @@ import com.simplemobiletools.commons.dialogs.FilePickerDialog import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.isRPlus import com.simplemobiletools.gallery.pro.R -import java.io.File import kotlinx.android.synthetic.main.dialog_save_as.view.* +import java.io.File class SaveAsDialog( val activity: BaseSimpleActivity, val path: String, val appendFilename: Boolean, val cancelCallback: (() -> Unit)? = null, 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 d89571df6..97dcf608b 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 @@ -235,10 +235,12 @@ class NewPhotoEditActivity : SimpleActivity() { PhotoEditorBuilder(this) .setSettingsList(settingsList) .startActivityForResult(this, PESDK_EDIT_IMAGE) + + settingsList.release() } private fun createPesdkSettingsList(): PhotoEditorSettingsList { - val settingsList = PhotoEditorSettingsList().apply { + val settingsList = PhotoEditorSettingsList(false).apply { configure { it.setFilterList(FilterPackBasic.getFilterPack()) } @@ -293,7 +295,13 @@ class NewPhotoEditActivity : SimpleActivity() { ) } - getSettingsModel(UiConfigTheme::class.java).theme = R.style.Imgly_Theme_NoFullscreen + val theme = if (isUsingSystemDarkTheme()) { + R.style.Theme_Imgly_NoFullscreen + } else { + R.style.Theme_Imgly_Light_NoFullscreen + } + + getSettingsModel(UiConfigTheme::class.java).theme = theme configure { it.setExportFormat(ImageExportFormat.AUTO) 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 11f7fa814..037fa1bac 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 @@ -226,10 +226,12 @@ class NewVideoEditActivity : SimpleActivity() { VideoEditorBuilder(this) .setSettingsList(settingsList) .startActivityForResult(this, VESDK_EDIT_VIDEO) + + settingsList.release() } private fun createVesdkSettingsList(): VideoEditorSettingsList { - val settingsList = VideoEditorSettingsList().apply { + val settingsList = VideoEditorSettingsList(false).apply { configure { it.setFilterList(FilterPackBasic.getFilterPack()) } @@ -278,7 +280,13 @@ class NewVideoEditActivity : SimpleActivity() { ) } - getSettingsModel(UiConfigTheme::class.java).theme = R.style.Imgly_Theme_NoFullscreen + val theme = if (isUsingSystemDarkTheme()) { + R.style.Theme_Imgly_NoFullscreen + } else { + R.style.Theme_Imgly_Light_NoFullscreen + } + + getSettingsModel(UiConfigTheme::class.java).theme = theme configure { it.allowFastTrim = true diff --git a/build.gradle b/build.gradle index d191431d4..0a687cd76 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ buildscript { classpath 'com.android.tools.build:gradle:7.1.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" if (is_proprietary) { - classpath 'ly.img.android.pesdk:plugin:9.2.0' + classpath 'ly.img.android.pesdk:plugin:10.0.1' } // NOTE: Do not place your application dependencies here; they belong