allow preventing dynamic theme usage

This commit is contained in:
tibbi 2017-11-29 22:35:34 +01:00
parent 27b6a72ff1
commit ca76735fd8
2 changed files with 11 additions and 5 deletions

View file

@ -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'
}

View file

@ -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?) {
setTheme(getThemeId())
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()
setTheme(getThemeId())
updateBackgroundColor()
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)
}