how to layoutInDisplayCutoutMode Never on android api 27?

349 Views Asked by At

this code perfect working for api level 28. How to do this on android api 27?

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {   
      window.attributes.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER       
}

I tried this but it's not working

<style name="PlayerTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">#000000</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name="android:windowLayoutInDisplayCutoutMode" tools:targetApi="27">
            never
        </item>
    </style>
0

There are 0 best solutions below