Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation floating buttons on android #87

Closed
gongalf opened this issue Jun 8, 2020 · 12 comments
Closed

Navigation floating buttons on android #87

gongalf opened this issue Jun 8, 2020 · 12 comments

Comments

@gongalf
Copy link

gongalf commented Jun 8, 2020

It's necessary some method to detect those Android devices with the floating navigation buttons, and some way to force their display (set them fixed) and know the size they take up to adjust the size of the app allowing these buttons to be seen correctly. I give you an example of spotify and our app (on the same device) so you can see the comparison:

spotify XS ufit365 XS

We need the app to look like Spotify, with the navigation buttons fixed at the bottom and with the size of the app adjusted to them.

@alanthomson
Copy link

alanthomson commented Jun 18, 2020

Does this not fix itself if you call
native.setProperty("androidSystemUiVisibility", "immersiveSticky")
in main.lua?

@sekodev
Copy link
Contributor

sekodev commented Jun 19, 2020

@gongalf I don't have a device to test if it works as you expected but have you tried using safeActualContentHeight or getSafeAreaInsets?

https://docs.coronalabs.com/api/library/display/getSafeAreaInsets.html
https://docs.coronalabs.com/api/library/display/safeActualContentHeight.html

The height of the screen "safe area" in Corona content units. The "safe area" is the rectangular region where it's safe to place important UI elements, ensuring that they are not obscured by status bars, device aspects like a sensor bar or rounded corners, software buttons, TV overscan areas, etc.

@gongalf
Copy link
Author

gongalf commented Jun 20, 2020

I've tried both options and they don't work (it only works on some devices, on others fail). Here is the screenshot of a Xiaomi using "immersiveSticky":

WhatsApp Image 2020-06-11 at 15 09 25 (1)

@sekodev
Copy link
Contributor

sekodev commented Oct 10, 2020

Is this still an issue after release 2020.3619? Safe area APIs should be working as expected now.

@gongalf
Copy link
Author

gongalf commented Oct 11, 2020

Using 2020.3620, I have tested on a Huawei P30 with EMUI 10.1.0 and the safe area is the entire screen (including the status bar and the lower navigation menu). In the capture you can see it with a red veil that fills the entire screen. I have tried with "immersiveSticky", "immersive", "lowProfile" and "default". Any ideas?

Captura de pantalla 2020-10-11 a las 18 59 34

@sekodev
Copy link
Contributor

sekodev commented Oct 12, 2020

Can you share which APIs you are using so we have more information on the ones that are not working?

@gongalf
Copy link
Author

gongalf commented Oct 19, 2020

Do you mean the plugins?

  • ["plugin.OneSignal"]
  • ["CoronaProvider.native.popup.quickLook"]
  • ["CoronaProvider.native.popup.social"]
  • ["CoronaProvider.native.popup.activity"]
  • ["plugin.imageCrop"]

@sekodev
Copy link
Contributor

sekodev commented Oct 19, 2020

No, not plugins. I'd want to know which safe area APIs you use so @Shchvova can look into what's wrong.

@gongalf
Copy link
Author

gongalf commented Oct 19, 2020

I used display.safeScreenOriginX, display.safeScreenOriginY, display.safeActualContentWidth, display.safeActualContentHeight and I've just used display.getSafeAreaInsets() in Xiaomi Redmi Note 8 Pro with MIUI 12.0.1.0 (It doesn't work either).

@maciej-czekala
Copy link

Any progress on this one? It still does not work on device.

@maciej-czekala
Copy link

as an alternative, would it be possible to find if a device has permanent (hardware) buttons at the bottom?

I think if we know if there are hardware buttons there is no need to shift objects from the bottom, but if there is I will just move it up. This is not a full solution but it would help a lot.

@scottrules44
Copy link
Contributor

3681 should have fixed safe area
and 3686 has the added the ability to check for "hasSoftwareKeys" in getInfo :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants