Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca76735f authored by tibbi's avatar tibbi
Browse files

allow preventing dynamic theme usage

parent 27b6a72f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ buildscript {
        propMinSdkVersion = 16
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '3.0.0'
        propVersionName = '3.0.3'
        kotlin_version = '1.2.0'
        support_libs = '27.0.1'
    }
+10 −4
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ open class BaseSimpleActivity : AppCompatActivity() {
    var copyMoveCallback: (() -> Unit)? = null
    var actionOnPermission: ((granted: Boolean) -> Unit)? = null
    var isAskingPermissions = false
    var useDynamicTheme = true
    private val GENERIC_PERM_HANDLER = 100

    companion object {
@@ -37,7 +38,10 @@ open class BaseSimpleActivity : AppCompatActivity() {
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        if (useDynamicTheme) {
            setTheme(getThemeId())
        }

        super.onCreate(savedInstanceState)
        if (!packageName.startsWith("com.simplemobiletools.", true)) {
            if ((0..50).random() == 10 || baseConfig.appRunCount % 100 == 0) {
@@ -51,8 +55,10 @@ open class BaseSimpleActivity : AppCompatActivity() {

    override fun onResume() {
        super.onResume()
        if (useDynamicTheme) {
            setTheme(getThemeId())
            updateBackgroundColor()
        }
        updateActionbarColor()
    }

@@ -204,7 +210,7 @@ open class BaseSimpleActivity : AppCompatActivity() {
    }

    private fun startCopyMove(files: ArrayList<File>, destinationFolder: File, isCopyOperation: Boolean, copyPhotoVideoOnly: Boolean) {
        val pair = Pair<ArrayList<File>, File>(files, destinationFolder)
        val pair = Pair(files, destinationFolder)
        CopyMoveTask(this, isCopyOperation, copyPhotoVideoOnly, copyMoveListener).execute(pair)
    }