Skip to content

Commit

Permalink
Fixing #42: Status bar white on Lollipop (Fixing Side effect)
Browse files Browse the repository at this point in the history
  • Loading branch information
BijoySingh committed Jan 18, 2018
1 parent b489f62 commit aa99d78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
}

Expand Down

0 comments on commit aa99d78

Please sign in to comment.