Samsung Galaxy S8 full screen mode
Asked Answered
B

3

19

Latest Samsung's smartphone has interesting feature called full screen (or in marketing terms infinity display). In this mode app covers also part of display where home/back buttons are. Usual apps don't cover this area, leaving it black. But Samsung's native ones cover this area.

Question: how to achieve this effect? I mean what kind of manifest declaration or programmatic call (possibly Samsung's legacy API) should I use?

Benavides answered 29/4, 2017 at 10:31 Comment(1)
Immersive fullscreen. Hides buttons and navigationbar on most systems I have encountered. If the S8 is different in that, I don't know what you would doMojica
O
36

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.

Oculus answered 5/6, 2017 at 13:31 Comment(2)
This answer does not gaurentee proper adjusts made with the s8. If you build any complicated apps that require measuring views, your view measurements will be affected based on if the nav toolbar is pinned/not pinned, visible/not visible, and even if the virtual keyboard is visible/not visible. So far it looks like you have to remeasure all your views, because "resizeableActivity" doesn't handle much.Ralleigh
I found that setting resizeableActivity to true did not make a Samsung Galaxy S8 use full screen mode. To make it work I've had to set a max_aspect despite it being a largely irrelevant setting for my resizeable game.Ununa
R
1

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);
        }
    }
Rappel answered 29/4, 2017 at 11:31 Comment(1)
It works only if you set your app as full-screen app in Galaxy S8 settings: display->full screen apps.Benavides
G
-5

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

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

Guenevere answered 8/5, 2017 at 11:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.