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

feat: add fullscreen mode to android >= kitkat #9485

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vanadium23
Copy link

@vanadium23 vanadium23 commented Sep 5, 2022

Closes #8532


This change is Reviewable

@@ -83,7 +83,7 @@ local Device = Generic:new{
home_dir = android.getExternalStoragePath(),
display_dpi = android.lib.AConfiguration_getDensity(android.app.config),
isHapticFeedbackEnabled = yes,
isDefaultFullscreen = function() return android.app.activity.sdkVersion >= 19 end,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the intent of the function didn't change. The app starts in fullscreen on api19+. On previous api levels we need to do something to enforce fullscreen.

@@ -347,12 +347,27 @@ end
-- to-do: implement fullscreen toggle in API19+
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can get rid of the entire function and comment here and just use

local api = android.app.activity.sdkVersion

in Device:toggleFullscreen directly.


local width = android.getScreenWidth()
local height = android.getScreenHeight()
-- NOTE: Since we don't do HW rotation here, this should always match width
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The note is wrong. HW rotation is enabled on api 19+.

if self.fullscreen then
self:setViewport(0, 0, width, height)
else
self:setViewport(0, 0, available_width, available_height)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the viewport correct here?. If notifications are placed on top I would assume some offset on x/y based on current hw rotation mode.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pazos we are showing only navbar, so no need to calculate top offset.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. Forgot about this PR :p.

Yay. Indeed I got the intention of this PR completely wrong. It should work fine as is for navigation bar. I was thinking about the notifications above the screen.

It might produce some undersired behaviour on onyx devices which place the navigation bar on top but that's another issue and doesn't need to be addressed here.

@peakjcw
Copy link

peakjcw commented Aug 26, 2023

This does NOT close #8532, there's no toggle. The app is still forcibly immersive and cannot be brought out of immersive.

@pazos
Copy link
Member

pazos commented Aug 26, 2023

This does NOT close #8532, there's no toggle. The app is still forcibly immersive and cannot be brought out of immersive.

This PR will close #8532 when it is merged. And will be merged when the author or somebody else addresses the comments on the review.

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

Successfully merging this pull request may close these issues.

[FR]: show android navigation bar
4 participants