Change color of navigation bar based on theme

This commit is contained in:
Moez Bhatti
2018-04-02 23:58:58 -04:00
parent 30506ce4a4
commit c8c5dd3aad
9 changed files with 43 additions and 4 deletions
@@ -65,13 +65,17 @@ abstract class QkThemedActivity<VM : QkViewModel<*, *>> : QkActivity<VM>() {
.autoDisposable(scope())
.subscribe { res -> setTheme(res) }
colors.statusBarIcons
colors.systemBarIcons
.autoDisposable(scope())
.subscribe { systemUiVisibility -> window.decorView.systemUiVisibility = systemUiVisibility }
colors.statusBar
.autoDisposable(scope())
.subscribe { color -> window.statusBarColor = color }
colors.background
.autoDisposable(scope())
.subscribe { color -> window.navigationBarColor = color }
}
override fun onPostCreate(savedInstanceState: Bundle?) {
@@ -105,7 +109,8 @@ abstract class QkThemedActivity<VM : QkViewModel<*, *>> : QkActivity<VM>() {
colors.toolbarColor
.doOnNext { color -> toolbar?.setBackgroundTint(color) }
.doOnNext { color -> // Set the color for the recent apps title
.doOnNext { color ->
// Set the color for the recent apps title
val icon = BitmapFactory.decodeResource(resources, R.mipmap.ic_launcher)
val taskDesc = ActivityManager.TaskDescription(getString(R.string.app_name), icon, color)
setTaskDescription(taskDesc)