jaredrummler / Cyanea

A theme engine for Android
Apache License 2.0
1.45k stars 144 forks source link

Removed status and navigation bar tinting functionality on Android Kitkat, because it was broken. #79

Closed vitSkalicky closed 4 years ago

vitSkalicky commented 4 years ago

Hello, I want to use this library in my app, but my app also supports kitkat devices, on which this library is a bit broken (see #76 ). Android kitkat was released before material design was a thing, so it does not support status bar tinting. Some hack used in the library seems to be broken.

So I simply removed the hack and disabled status and navigation bar tinting for kitkat and lower. Now the default status bar is used (btw. all apps use the default status bar no matter which colors they have on android kitkat and before).

I am not very familiar with kotlin and I don't know the internals of this library well, so feel free to improve this pull request and make it cleaner.

Also Fixes #76

vitSkalicky commented 4 years ago

The CI just does not like code generated by Android Studio. Should I care about it?

jaredrummler commented 4 years ago

Instead of removing it, we should fix it. If we add tintBars() to CyaneaDelegateImplV19#setupSystemBarTinting it will fix the issue.

if (enabled) {
  activity.window.setFlags(FLAG_TRANSLUCENT_STATUS, FLAG_TRANSLUCENT_STATUS)
  if (cyanea.shouldTintNavBar) {
    activity.window.setFlags(FLAG_TRANSLUCENT_NAVIGATION, FLAG_TRANSLUCENT_NAVIGATION)
  }
  tintBars()
}