Jump to content
Sign in to follow this  
Yaron

Detecting when an Android app finishes resizing to fullscreen mode

Recommended Posts

I am creating an Android application that scales images based on the device's fullscreen resolution.

To enable fullscreen, I do:
1. In "Project Options / Application / Version Info" I set the theme to "No TitleBar".

2. Set "Form.Fullscreen" to enabled in the main form's "OnCreate" event.

 

However, I'm having problems detecting when my App is finally fullscreen, I suspect there may be a rounding error in Delphi's function, here is the log:
 

05-17 03:56:36.660: I/info(15344): FMX: ZP Remote: ZPR_DBG: Screen Scale                    : 1.3125
05-17 03:56:36.666: I/info(15344): FMX: ZP Remote: ZPR_DBG: IFMXScreenService.GetScreenSize : 1280x736 (with screen scale)
05-17 03:56:36.666: I/info(15344): FMX: ZP Remote: ZPR_DBG: IFMXScreenService.GetScreenSize : 975x561 (original)
05-17 03:56:36.666: I/info(15344): FMX: ZP Remote: ZPR_DBG: Screen                          : 975x561

 

05-17 03:56:36.664: I/info(15344): FMX: ZP Remote: ZPR_DBG: Client                          : 975x537
05-17 03:56:36.724: I/info(15344): FMX: ZP Remote: ZPR_DBG: Client                          : 975x537
05-17 03:56:36.940: I/info(15344): FMX: ZP Remote: ZPR_DBG: Client                          : 975x562

 

The first 4 lines give system detail from IFMXScreenService.GetScreenScale, IFMXScreenService.GetScreenSize and Screen.Width/Screen.Height.

Each "client" line shows the values of "ClientWidth/ClientHeight" on a FormResize event.

 

As you can see, the ClientHeight value is higher than the Screen.Height value, which doesm't make sense.

Edited by Yaron

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×