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

Commit f7cd8a36 authored by tibbi's avatar tibbi
Browse files

reset the launcher color to Orange after receiving a particular update

parent 7f38c9fd
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 = '4.4.23'
        propVersionName = '4.4.26'
        kotlin_version = '1.2.51'
        support_libs = '27.1.1'
    }
+10 −8
Original line number Diff line number Diff line
@@ -91,18 +91,20 @@ fun Activity.appLaunched(appId: String) {
        checkAppIconColor()
    } else if (!baseConfig.wasOrangeIconChecked) {
        baseConfig.wasOrangeIconChecked = true
        if (baseConfig.appIconColor != resources.getColor(R.color.color_primary)) {
            val orangeClassName = "${baseConfig.appId.removeSuffix(".debug")}.activities.SplashActivity.Orange"
            packageManager.setComponentEnabledSetting(ComponentName(baseConfig.appId, orangeClassName), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP)
        val primaryColor = resources.getColor(R.color.color_primary)
        if (baseConfig.appIconColor != primaryColor) {
            getAppIconColors().forEachIndexed { index, color ->
                toggleAppIconColor(appId, index, color, false)
            }

            val defaultClassName = "${baseConfig.appId.removeSuffix(".debug")}.activities.SplashActivity"
            packageManager.setComponentEnabledSetting(ComponentName(baseConfig.appId, defaultClassName), PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, PackageManager.DONT_KILL_APP)

            getAppIconColors().forEachIndexed { index, color ->
                if (baseConfig.appIconColor == color) {
                    toggleAppIconColor(appId, index, color, true)
                }
            }
            val orangeClassName = "${baseConfig.appId.removeSuffix(".debug")}.activities.SplashActivity.Orange"
            packageManager.setComponentEnabledSetting(ComponentName(baseConfig.appId, orangeClassName), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP)

            baseConfig.appIconColor = primaryColor
            baseConfig.lastIconColor = primaryColor
        }
    }
    baseConfig.appRunCount++