From f19ddf1a0ddd2cb724fd52be57b93039ffea4696 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 28 Jul 2019 20:40:57 +0200 Subject: [PATCH] add the sideloading check in more activities --- app/build.gradle | 2 +- .../gallery/pro/activities/PhotoVideoActivity.kt | 4 +--- .../gallery/pro/activities/SetWallpaperActivity.kt | 5 +++++ .../gallery/pro/activities/SplashActivity.kt | 2 -- app/src/main/res/values/donottranslate.xml | 1 + 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ba123d85c..452901f2a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -61,7 +61,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.15.9' + implementation 'com.simplemobiletools:commons:5.15.11' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'androidx.multidex:multidex:2.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt index 80e922610..a1ebf1968 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/PhotoVideoActivity.kt @@ -14,7 +14,6 @@ import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.IS_FROM_GALLERY import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE import com.simplemobiletools.commons.helpers.REAL_FILE_PATH -import com.simplemobiletools.commons.helpers.SIDELOADING_TRUE import com.simplemobiletools.gallery.pro.BuildConfig import com.simplemobiletools.gallery.pro.R import com.simplemobiletools.gallery.pro.extensions.* @@ -41,8 +40,7 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList super.onCreate(savedInstanceState) setContentView(R.layout.fragment_holder) - if (config.appSideloadingStatus == SIDELOADING_TRUE) { - showSideloadingDialog() + if (checkAppSideloading()) { return } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SetWallpaperActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SetWallpaperActivity.kt index 2ceafc06b..a1f83c574 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SetWallpaperActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SetWallpaperActivity.kt @@ -10,6 +10,7 @@ import android.os.Bundle import android.view.Menu import android.view.MenuItem import com.simplemobiletools.commons.dialogs.RadioGroupDialog +import com.simplemobiletools.commons.extensions.checkAppSideloading import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.helpers.ensureBackgroundThread import com.simplemobiletools.commons.helpers.isNougatPlus @@ -31,6 +32,10 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete super.onCreate(savedInstanceState) setContentView(R.layout.activity_set_wallpaper) + if (checkAppSideloading()) { + return + } + if (intent.data == null) { val pickIntent = Intent(applicationContext, MainActivity::class.java) pickIntent.action = Intent.ACTION_PICK diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt index 97dfbb648..20c9c9387 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt @@ -4,8 +4,6 @@ import android.content.Intent import com.simplemobiletools.commons.activities.BaseSplashActivity class SplashActivity : BaseSplashActivity() { - override fun getAppPackageName() = packageName - override fun initActivity() { startActivity(Intent(this, MainActivity::class.java)) finish() diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index 2d9b27b32..940ee7ee2 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -1,5 +1,6 @@ + com.simplemobiletools.gallery.pro