Home > front end >  How to set color for BottomNavigationView?
How to set color for BottomNavigationView?

Time:04-17

I need to use android:background="?android:attr/windowBackground", but so that the day and night versions have different values. How can I do this? Is it possible to do this with using colors.xml and themes.xml

CodePudding user response:

First of all define night-value folder and night theme in appropriate resource directory.

res/values-night/themes.xml

Override android:windowBackground like this :

  <style name="LaunchTheme" parent="AppTheme">
        <item name="android:windowBackground">@drawable/screen_night</item>
    </style>

Then you can customize your screen like this :

res/drawable/screen_night.xml

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
    <color android:color="@color/white"/>
</item>
<item>
    <bitmap
       android:gravity="center"
       android:src="@drawable/any_logo"
       android:tileMode="disabled"/>
</item>
  • Related