Search code examples
androidandroid-7.0-nougatandroid-7.1-nougatsoftkeys

Set soft navigation key background color for Nougat 7.1.1


I want to change background color for navigation soft keys that are introduced for Nougat. Is there any way I can implement that? What I already implemented is added navigation bar color in both of my style files. But it's not fixing this and I don't see any changes.

<item name="android:navigationBarColor">@color/navColor</item>

enter image description here


Solution

  • I fixed this issue by adding these to v21/styles

        <item name="android:navigationBarColor" tools:targetApi="21">@color/colorAccent</item>
        <item name="android:windowDrawsSystemBarBackgrounds" tools:targetApi="21">true</item>
    

    and defined this in normal styles.xml file

        <item name="android:navigationBarColor">@color/colorAccent</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
    

    colorAccent is the accent color I defined for the app

    I'm answering this question in case someone might be having the same problem