Home > Back-end >  How to full screen activity with transparent status bar
How to full screen activity with transparent status bar

Time:09-06

I would like to show transparent status bar without using immersive mode. Just like the image below. I have tried lot of solutions however I'm unable to achieve this. Please refer the image below.

enter image description here

This is the output I'm looking for. Please note here that I'm looking for solution which doesn't affect navigation bar at all. I do not want any modifications to navigation bar just like image below. Thanks in advance!

My theme:

<style name="AppTheme" parent="@style/Theme.MaterialComponents.DayNight.NoActionBar.Bridge">
            <item name="android:colorEdgeEffect">@color/color_subtitle_text</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
 <item name="android:windowTranslucentStatus">true</item>

CodePudding user response:

try this:

getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);

CodePudding user response:

You can use like this.

For Kotlin:

window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)

For Java:

getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
  • Related