Make both navigation and status bar the same color, in day mode it is the dark variant of the bitsy blue color and dark in night mode.

This commit is contained in:
Severiano Jaramillo 2019-03-13 21:10:23 -06:00
parent 3fa90fdee1
commit b2a6a3828c
2 changed files with 5 additions and 7 deletions

View file

@ -87,16 +87,10 @@ class SettingsFragment : ConnectedFragment(), BaseSecurityLockDialog.OnPINPatter
val nightMode = PreferenceManager.getDefaultSharedPreferences(context)
.getBoolean(Constants.KEY_NIGHT_MODE_ACTIVATED, false)
// Make sure both toolbar and navigation bar show the correct colors in both day and night modes
// Make sure the toolbar show the correct colors in both day and night modes
val toolbar: Toolbar? = activity?.findViewById(R.id.toolbar)
toolbar?.setBackgroundResource(if (!nightMode) R.color.colorPrimary else R.color.colorToolbarDark)
val window = activity?.window
context?.let { context ->
window?.statusBarColor = ContextCompat.getColor(context,
if (!nightMode) R.color.colorPrimaryDark else R.color.colorStatusBarDark)
}
return inflater.inflate(R.layout.fragment_settings, container, false)
}

View file

@ -9,6 +9,8 @@
<!--Custom attributes -->
<item name="android:fontFamily">@font/p_f_beau_sans_pro</item>
<item name="themedColorBackgroundFloating">@android:color/white</item>
<item name="android:statusBarColor">@color/colorPrimaryDark</item>
<item name="android:navigationBarColor">@color/colorPrimaryDark</item>
</style>
<style name="Theme.Bitsy.NoActionBar">
<item name="windowActionBar">false</item>
@ -26,6 +28,8 @@
<!--Custom attributes -->
<item name="android:fontFamily">@font/p_f_beau_sans_pro</item>
<item name="themedColorBackgroundFloating">@color/colorBackgroundFloating</item>
<item name="android:statusBarColor">@color/colorStatusBarDark</item>
<item name="android:navigationBarColor">@color/colorStatusBarDark</item>
</style>
<style name="Theme.Bitsy.Dark.NoActionBar">
<item name="windowActionBar">false</item>