From aa99d78426afd316bbcfb88cefd67899f9cea0ee Mon Sep 17 00:00:00 2001 From: Bijoy Singh Kochar Date: Thu, 18 Jan 2018 00:58:45 +0000 Subject: [PATCH] Fixing #42: Status bar white on Lollipop (Fixing Side effect) --- app/build.gradle | 4 ++-- .../bijoysingh/quicknote/activities/ThemedActivity.kt | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 353342ee..69549d8e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "com.bijoysingh.quicknote" minSdkVersion 17 targetSdkVersion 27 - versionCode 42 - versionName "4.1.3" + versionCode 43 + versionName "4.1.4" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" javaCompileOptions { annotationProcessorOptions { diff --git a/app/src/main/java/com/bijoysingh/quicknote/activities/ThemedActivity.kt b/app/src/main/java/com/bijoysingh/quicknote/activities/ThemedActivity.kt index 01f6075b..051ef25e 100644 --- a/app/src/main/java/com/bijoysingh/quicknote/activities/ThemedActivity.kt +++ b/app/src/main/java/com/bijoysingh/quicknote/activities/ThemedActivity.kt @@ -25,9 +25,8 @@ abstract class ThemedActivity : AppCompatActivity() { } fun setSystemTheme() { - val backgroundColor = getThemeColor() if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - window.statusBarColor = backgroundColor + window.statusBarColor = getStatusBarColor() } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { @@ -40,7 +39,11 @@ abstract class ThemedActivity : AppCompatActivity() { } fun getThemeColor(): Int { - val lightColor = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) R.color.white else R.color.material_grey_400 + return getColor(R.color.white, R.color.material_grey_800) + } + + fun getStatusBarColor(): Int { + val lightColor = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) R.color.white else R.color.material_grey_500 return getColor(lightColor, R.color.material_grey_800) }