0

In the Google I/O app there is following theme with an intereseting comment I don't really understand:

<style name="AppTheme" parent="Base.AppTheme">
        <!-- We use a transparent nav bar on API 29, as the system is responsible for applying
             context background protection -->
        <item name="android:navigationBarColor">@color/transparent</item>
        <item name="ioschedNavigationBarDividerColor">@color/transparent</item>
    </style>

What does context background protection is? And should each app use this or what is the use case?

David
  • 3,971
  • 1
  • 26
  • 65
  • Looks like "background protection" in this sense means keeping things visually distinguishable from what's behind them; i.e., making sure the buttons can be seen against the background. [This section on edge-to-edge layouts](https://developer.android.com/develop/ui/views/layout/edge-to-edge#change-color) discusses it. On API level 29 and above, the system handles the translucent scrim behind the buttons automatically, so they set `@color/transparent` in `-v29` to "turn off" the scrim they set in the base theme with `@color/nav_bar_scrim`. – Mike M. Jan 09 '23 at 01:33

0 Answers0