About android 15 behavior changes, one of them is edge-to-edge enforcement.
I have a project with targetSDK 34, I wanna upgrade it to targetSDK 35.
project with targetSDK 34 run in avd is like
targetSDK 34
project with targetSDK 35, and dont do any other change run in avd is like
targetSDK 35 and no other changes
project with targetSDK 35, and add android:fitsSystemWindows="true"
into layout xml is like
targetSDK 35 and add attribute in xml
As you can see, though UI won’t occluded by gesture keys and upper status bar, but the color of status bar went wrong.
this is my styles.xml
<resources>
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar.Bridge">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorControlHighlight">@color/colorControlHighlight</item>
<item name="colorControlNormal">@color/colorControlNormal</item>
<item name="itemBackground">@color/gray</item>
<item name="android:actionOverflowButtonStyle">@style/MyOverflowButtonStyle</item>
</style>
<style name="AppTheme.FullScreen" parent="AppTheme">
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
</resources>
original status bar color is colorPrimaryDark
But I accidentally discovered that if the original Layout content is wrapped with androidx.drawerlayout.widget.DrawerLayout
, the status bar color can be restored to normal, as shown in the figure below.
targetSDK 35 and wrapped with DrawerLayout
Is it just a bug, or?