Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Actionbar in Android 15 is overlapping activity contents

I'm not defining any Toolbar in my XML files and I'm using the default ActionBar defined at theme:

<style name="AppBaseTheme" parent="@style/Theme.AppCompat.DayNight.DarkActionBar">
    <item name="colorAccent">@color/secondary</item>
    <item name="android:actionBarStyle">@style/AppBaseTheme.ActionBarStyle</item>
    <item name="actionBarStyle">@style/AppBaseTheme.ActionBarStyle</item>
    <item name="android:textViewStyle">@style/RobotoTextViewStyle</item>
    <item name="android:buttonStyle">@style/RobotoButtonStyle</item>        
    <item name="android:windowContentOverlay">@null</item>
</style>  

  

No issues in Android 14 and previous, but in Android 15 the Activity contents is displayed at fullscreen and ActionBar is overlapping the Activity contents.

It's possible to prevent it then have the same behavior in Android 15 I have in previous versions?

Thanks

like image 620
The Matrix Avatar asked Dec 05 '25 16:12

The Matrix


2 Answers

I hope this answer is helpful to you.

<item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>

Note: Add this in themes.xml and night/themes.xml.

like image 198
Sanjay Mangaroliya Avatar answered Dec 08 '25 06:12

Sanjay Mangaroliya


        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:fitsSystemWindows">true</item>
        <item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
like image 23
Hardik Hirpara Avatar answered Dec 08 '25 08:12

Hardik Hirpara



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!