Samsung Galaxy S8 full screen mode

巧了我就是萌 提交于 2019-11-29 23:08:23

To enable new Samsung Galaxy S8 and LG G6 full screen support add to the AndroidManifest.xml under the <application> element:

<meta-data android:name="android.max_aspect" android:value="2.1" />

Where value of 2.1 is aspect ratio 18.5:9 (By default your App defaults to maximum ratio for 16:9 - 1.86). More info in: Android Blog.

Alternatively, you can set the following attribute for Application or Activity:

android:resizeableActivity="true"

Because the documentations states (link):

You do not need to set a maximum aspect ratio if an activity's android:resizeableActivity attribute is set to true. If your app targets API level 24 or higher, this attribute defaults to true.

to get full-screen you must overide onWindowFocusChanged method and create decorView object and add System_UI flags into it..

@Override
    public  void onWindowFocusChanged(boolean  hasFocus){
        super.onWindowFocusChanged(hasFocus);
        View decorView = getWindow().getDecorView();
        if(hasFocus){

        decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                    |View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY  // this flag do=Semi-transparent bars temporarily appear and then hide again
                    |View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN  // Make Content Appear Behind the status  Bar
                    |View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION  // it Make Content Appear Behind the Navigation Bar
                    |View.SYSTEM_UI_FLAG_FULLSCREEN  // hide status bar
                    |View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
        }
    }

It can be turned off. I used this tutorial for my S8

How To Enable Full Screen Apps on Galaxy S8/S8+

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!