gZerone
gZerone

Reputation: 693

let soft navigation bar (back, home, recent) overlap my layout

I am trying to let the Android soft buttons (back, home, recent) overlap my layout (activity), I think it's normal behavior with reader app or playing video, ... For example: The normal will be looked like this : enter image description here And what I want is : enter image description here (line 2, line 3 is overlapped by the soft buttons). I do google and see people asked how to avoid it, but now I want it to happen and I don't know how. I already tried with :

<item name="android:windowDrawsSystemBarBackgrounds">false</item>

or

android:fitsSystemWindows="false"

but they seem does not work. Please help me if you know how or any idea.

Upvotes: 4

Views: 1682

Answers (1)

gZerone
gZerone

Reputation: 693

I solved by adding these lines of codes

        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
        getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN);
    }

Hope it help anyone have same issue. Thanks.

Upvotes: 1

Related Questions