From e8adf2e9ff36012fcff1df5a86eda5d07950a195 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 17 Jan 2022 22:26:59 +0100 Subject: [PATCH] update all colors properly on the main screen --- .../simplemobiletools/keyboard/activities/MainActivity.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/activities/MainActivity.kt index 6dde092..fc97d73 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/activities/MainActivity.kt @@ -9,10 +9,7 @@ import android.view.Menu import android.view.MenuItem import android.view.inputmethod.InputMethodManager import com.simplemobiletools.commons.dialogs.ConfirmationAdvancedDialog -import com.simplemobiletools.commons.extensions.appLaunched -import com.simplemobiletools.commons.extensions.applyColorFilter -import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor -import com.simplemobiletools.commons.extensions.updateTextColors +import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.models.FAQItem import com.simplemobiletools.keyboard.BuildConfig import com.simplemobiletools.keyboard.R @@ -49,6 +46,7 @@ class MainActivity : SimpleActivity() { override fun onCreateOptionsMenu(menu: Menu): Boolean { menuInflater.inflate(R.menu.menu_main, menu) + updateMenuItemColors(menu) return true } @@ -76,6 +74,7 @@ class MainActivity : SimpleActivity() { val applyBackground = resources.getDrawable(R.drawable.button_background_rounded, theme) as RippleDrawable (applyBackground as LayerDrawable).findDrawableByLayerId(R.id.button_background_holder).applyColorFilter(getAdjustedPrimaryColor()) change_keyboard.background = applyBackground + change_keyboard.setTextColor(getAdjustedPrimaryColor().getContrastColor()) } private fun isKeyboardEnabled(): Boolean {