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
base: master
Are you sure you want to change the base?
feat: add fullscreen mode to android >= kitkat #9485
Conversation
@@ -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, |
There was a problem hiding this comment.
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+ |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
This does NOT close #8532, there's no toggle. The app is still forcibly immersive and cannot be brought out of immersive. |
Closes #8532
This change is