Skip to main content
enricj12878062
Known Participant
October 23, 2017
Question

Android - Pixel 2 XL Screen gets cropped by the button bar. AIR 26.

  • October 23, 2017
  • 9 replies
  • 11404 views

Hi,

We have problems on the Android Pixel 2 xl phone, it seems that when the button bar disappears the application doesn't refresh, and we have a black space that won't allow us to see the application in a correct way. We are using AIR 26.

This topic has been closed for replies.

9 replies

Known Participant
May 24, 2018

I found a workaround for this problem (on AIR29). Adding

<application>

<meta-data android:name="android.max_aspect" android:value="2.0" />

</application>

to the application.xml seems to resolve the xl 2 screen cropping problem (although the pixel 2 xl aspect ratio is 2.0).

I don't want to limit my game's aspect ratio on other devices, but rather this then having a defect app on the pixel xl 2...

Flipline
Inspiring
July 4, 2018

Thanks for sharing this!  I was having the same problem and this worked for me.  Looking into it more, it seems that Android will default to only using up to 16:9 in certain scenarios for the max aspect ratio, unless you define a higher value like this manually.

WMSH
Participating Frequently
July 5, 2018
Known Participant
May 22, 2018

Can it be this was resolved in Air 28, but is again a problem since AIR 29?

I am having again Pixel 2 XL users complaining since I updated with AIR29...

Does anyone have a solution?

Participant
March 8, 2018

Just checking to see if anyone has found a solution to this.  Just tried the AIR 29 SDK and the same ANE as you, Scott.  It returns the correct width and height, but still having the same issues.  Anyone have any luck?

Known Participant
January 1, 2018

We are having this problem too. Any updates?

Scott Inglis
Inspiring
January 2, 2018

Afraid not, our solution on production is to detect the model name and just make the screen artificially smaller.

Participant
April 4, 2018

Hi, Scott!  Did you ever get this resolved?  I'm still banging my head against it

enricj12878062
Known Participant
November 24, 2017

On my part, I ended up using distriqt ane to specifically change the display mode, specifically for Pixel 2 XL. So the users with this device have to play with menus, not great but a solution until someone can solve this issue.

Scott Inglis
Inspiring
November 24, 2017

So I've ended up writing a simple ANE function to just return DisplayMetrics.heightPixels which takes into account the button bar, this leaves a dead area at the bottom of the screen but at least nothing is being cut off anymore. Hopefully Adobe is able to address the stage.fullScreenHeight issue or somebody else can find a way to hide the bar, but for now this works.

marchbold
Inspiring
November 24, 2017

Interesting, was the value you had to write the ANE for different from the one returned from our ANE ?

var screenHeight:int = Application.service.device.displayMetrics.screenHeight;

Also did you try using the hide system ui navigation call?

Application.service.setDisplayMode( ApplicationDisplayModes.UI_NAVIGATION_HIDE );

Definitely will be interested to get my hands on a pixel 2 xl to see what's going on there. 

air native extensions // https://airnativeextensions.com
Scott Inglis
Inspiring
November 24, 2017

I wasn't using the distriqt ANE actually, but this one: GitHub - mesmotronic/air-ane-fullscreen: ANE for Adobe AIR to enable true full screen on Android

I have to refocus on other issues for the next few days but I'll spend some time investigating the Distriqt solution next week.

Scott Inglis
Inspiring
November 3, 2017

We're also experiencing this issue. We're testing to see if this was introduced with a specific version of AIR at the moment. It looks like AIR 23 and earlier had an issue hiding the black bar on lots of devices, but the stage took that into account when it reported the size. If we hear anything back from our external testers I'll post here. If we can get a pixel 2 XL to test with I'll explore the distriqt solution, but our game is already very ANE heavy and conflicts are likely.

enricj12878062
Known Participant
November 3, 2017

Unfortunately Scott the problem is not solved using the distriqt ANE. I've finally got it working right, but the problem remains.

What I will try now, is to work with this ane and play the game with menus for this specific device.

I will also create a bug and posted here, so we can vote for it.

Scott Inglis
Inspiring
November 3, 2017

Thanks for the heads up. Apparently the external testing team we are using doesn't have access to a Pixel 2 XL yet so we weren't able to get back any info on AIR versions yet. Gonna look into design solutions of our problem in the meantime and hopefully Adobe will respond to the bug report before it becomes worse.

enricj12878062
Known Participant
October 24, 2017

Seems that the problem is not on Oreo only. It happens in other version of Android. Since we have found it on (Samsung Galaxy Note 8, 1440 x 2960) and LG G6 (1440x2880). So maybe the issue comes from the resolution.

I'll update the post and take out the Oreo info if it's possible.

Colin Holgate
Inspiring
October 24, 2017

I am able to edit the topic, let me know if what I changed it to seems ok.

I happened to be in a meeting last night with someone who had a Pixel 2, so I asked him to show me one of my AIR apps on his phone, so I could see what happens when the button bar goes away. Neither of us could figure out how to make if go away. Does it time out after a while?

In any case, for my app I am just using the normal showAll stage scalemode, I'm not trying to do any layout myself, and my app is nicely centered between the left of the landscape screen and the left of the button bar. AIR didn't try to draw anything underneath the button bar.

Are you using noScale, and doing your own calculations about the resolution of the device? If you are, try listening for the resize event, and compare what it says the screen size is against what you had calculated it to be.

enricj12878062
Known Participant
October 24, 2017

Thanks for editing it.

Yes, my app is fullScreen and noScale, and the menus disappear automatically after a moment.

<fullScreen>true</fullScreen>

stage.scaleMode = StageScaleMode.NO_SCALE;

But still it's not a problem of calculation, as you can see in the screenshots it uses the full screen. The problem is that once the menu disappears, it disappears also part of the app canvas.

Colin Holgate
Inspiring
October 23, 2017

Could you send your Pixel 2 to me to test something? Just kidding! (not really...).

Do you get a deactivate event when the button bar appears, and an activate event when it goes away? If you do you could try one of these to force a reload of the stage:

stage.quality = "low";

stage.quality = "high";

(in my apps I set the stage.quality to something that I don't want on deactivate, then back to what I do want on activate)

or:

stage.invalidate();

I haven't actually tried the invalidate approach, but it could be worth a try.

If you're doing Stage3D (including just using Starling) you may be able to reset the stage3d.context3d. Here's an article on dealing with those issues:

Handling Stage3D Context Loss « JacksonDunstan.com

Now, if you don't have any deactivate or activate events you could listen for stage resize events, and do the same tricks when you get one of those.

enricj12878062
Known Participant
October 23, 2017

Ok. Unfortunately I can't send you the gadget , because it's from a user.

But we will try to do some testing and see if we can force the reloading of the stage. I'll let you know.

Thanks.