diff --git a/app/build.gradle b/app/build.gradle index 810c0e601..d367229c7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.14.6' + implementation 'com.simplemobiletools:commons:3.14.7' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.3' implementation 'com.google.code.gson:gson:2.8.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 9128424f1..77a9a0e4a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -16,6 +16,7 @@ import android.widget.FrameLayout import com.google.gson.Gson import com.simplemobiletools.commons.dialogs.CreateNewFolderDialog import com.simplemobiletools.commons.dialogs.FilePickerDialog +import com.simplemobiletools.commons.dialogs.NewAppDialog import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.PERMISSION_READ_STORAGE @@ -44,6 +45,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private val PICK_MEDIA = 2 private val PICK_WALLPAPER = 3 private val LAST_MEDIA_CHECK_PERIOD = 3000L + private val CONTACTS_PACKAGE = "com.simplemobiletools.contacts" lateinit var mDirs: ArrayList @@ -99,6 +101,12 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { mIsPasswordProtectionPending = config.appPasswordProtectionOn setupLatestMediaId() + + // notify the users about the Contacts app + if (System.currentTimeMillis() < 1521015000000 && !config.wasNewAppShown && config.appRunCount > 100 && config.appRunCount % 50 != 0 && !isPackageInstalled(CONTACTS_PACKAGE)) { + config.wasNewAppShown = true + NewAppDialog(this, CONTACTS_PACKAGE, "Simple Contacts") + } } override fun onStart() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index c8543c2e4..8a8e8b646 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -316,4 +316,8 @@ class Config(context: Context) : BaseConfig(context) { var doExtraCheck: Boolean get() = prefs.getBoolean(DO_EXTRA_CHECK, false) set(doExtraCheck) = prefs.edit().putBoolean(DO_EXTRA_CHECK, doExtraCheck).apply() + + var wasNewAppShown: Boolean + get() = prefs.getBoolean(WAS_NEW_APP_SHOWN, false) + set(wasNewAppShown) = prefs.edit().putBoolean(WAS_NEW_APP_SHOWN, wasNewAppShown).apply() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index bf251b41b..509a5f1d5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -46,6 +46,7 @@ const val ONE_FINGER_ZOOM = "one_finger_zoom" const val ALLOW_INSTANT_CHANGE = "allow_instant_change" const val REPLACE_ZOOMABLE_IMAGES = "replace_zoomable_images" const val DO_EXTRA_CHECK = "do_extra_check" +const val WAS_NEW_APP_SHOWN = "was_new_app_shown" // slideshow const val SLIDESHOW_INTERVAL = "slideshow_interval"