Code Monkey home page Code Monkey logo

Comments (8)

ThomasGorisse avatar ThomasGorisse commented on July 18, 2024

Hi @grassydragon,

I'm happy to talk about Full Screen mode on Android with someone.

After more than 10 years of Android development, this part is still a complete mystery and every flag modification on the full screen mode is a roll dice upon the toobar and other layouts placement below the status bar depending on the current Android version.
Not related to Sceneform but my solution for other projects is a custom ConstraintLayout which looks for the fitsSystemWindows in every childs in all the hierarchy.
But it's not really applicable to the Sceneform module.

Anyway, here are my answers :

The previous fullscreen mode was hiding the action, status and navigation bars and making the activity content fullscreen.
Now only the navigation bar disappears but the activity content is still fullscreen (it's behind the action and status bars as can be seen in the examples in README.md)
For me, the difference between the View.SYSTEM_UI_FLAG_FULLSCREEN are:

  1. With = StatusBar hided but StatusBar insets/margin still here and we can't draw behind it (just change the colorPrimaryDark on it)
  2. Without = StatusBar visible but can be transparent and no StatusBar top margin
    The solution could be to let the View.SYSTEM_UI_FLAG_FULLSCREEN flag present and use theViewCompat.setOnApplyWindowInsetsListener() to remove status bar insets but this could generate wrong behaviors depending on how the BaseARFragment is overridden.

As an improvement I can implement the selection of the mode in BaseARFragment. It will be possible to select between the normal and fullscreen modes. Also, it is possible to migrate to WindowInsetsController

It will be great if you can make a pull request and I will check that. Don't forget to check the minSDK > 30 before using the WindowInsetsController

Thanks for your feedback

from sceneform-android.

grassydragon avatar grassydragon commented on July 18, 2024

Here are examples from Google Pixel 3a with Android 11. In both cases it is possible to put a TextView behind the status bar.

With the View.SYSTEM_UI_FLAG_FULLSCREEN flag:
Screenshot_20210414-192136
Screenshot_20210414-192145

Without the View.SYSTEM_UI_FLAG_FULLSCREEN flag:
Screenshot_20210414-192617

What version of Android should I check?

from sceneform-android.

ThomasGorisse avatar ThomasGorisse commented on July 18, 2024

Potentially, every API version should be checked since 24.
Are you using CoordinatorLayout ?

Here is the result on API 29 :

  • With View.SYSTEM_UI_FLAG_FULLSCREEN
    image

  • Without View.SYSTEM_UI_FLAG_FULLSCREEN
    image

from sceneform-android.

grassydragon avatar grassydragon commented on July 18, 2024

Actually, I am using the glTF sample from the repository with FrameLayout.

Thank you for providing the screenshots, I will try to reproduce the behavior. I think there is a problem with the cutout but there isn't one on the Google Pixel 4.

from sceneform-android.

grassydragon avatar grassydragon commented on July 18, 2024

Here are examples from Motorola G7 Play with Android 10. This phone has a cutout.

With the View.SYSTEM_UI_FLAG_FULLSCREEN flag:
Screenshot_20210415-201335
Screenshot_20210415-201407

Without the View.SYSTEM_UI_FLAG_FULLSCREEN flag the status bar is transparent and the TextView is behind the cutout.

Unfortunately, I have problems with running AR applications in the emulator on Ubuntu. I will try to do this on Windows.

from sceneform-android.

grassydragon avatar grassydragon commented on July 18, 2024

Hello, @ThomasGorisse!
I was able to reproduce the problem on the Google Pixel 4 emulator with Android 10. However, there is no such problem on the Google Pixel 3a emulator. As I said earlier it looks like a problem with the cutout. I think that the Google Pixel 4 emulator with Android 10 has a wrong configuration. My friend who has the Google Pixel 4 confirmed that this is not a right behavior.
Let's restore the View.SYSTEM_UI_FLAG_FULLSCREEN flag in order not to break the layout for phones with a real cutout. For cases there this fullscreen mode is not suitable for developers I can add an option for disabling the fullscreen mode so it is possible to set up the fullscreen mode manually.

from sceneform-android.

ThomasGorisse avatar ThomasGorisse commented on July 18, 2024

Hi @grassydragon,

You have contributor access.
Can you push the modification with the View.SYSTEM_UI_FLAG_FULLSCREEN and the WindowInsetsController for Build.VERSION.SDK_INT >= Build.VERSION_CODES.R ?

Thanks

from sceneform-android.

grassydragon avatar grassydragon commented on July 18, 2024

Yes, I can. I will test how the window insets controller works.

from sceneform-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.