Skip to content

Issue with WHxxx calculations on android / wrong files loaded. #3163

Closed

Description

@NathanaelA

Please, provide the details below:

Ok, here is the scenario;
Android 4.4.4, using a Device with the size 1024x600. So In portrait mode the app starts up fine as a "tablet" sized device. However if the app was switched to Landscape (still thinks it is a tablet) and will continue to use the MW600 files for the rest of the session. However, if you exit the app in Landscape and restart the application; the application is Width is calculated as 1024, but the Height is now calculated as 552. So this now causes the wrong files to be loaded. It no longer things it is a tablet device.

Maybe I am thinking wrong, but the calculations needs to be using the raw values of the device not the values minus action/tool bars.

Which platform(s) does your issue occur on?

Android ( iOS might have a similar issue, but 1024x768 - size is still above the 600 )

Please provide the following version numbers that your issue occurs with:

2.4.x

Please tell us how to recreate the issue in as much detail as possible.

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

  • Create a demo app
  • Make sure Action bar is enabled.
  • Create a main-page.css, add Page { background-color: red; }
  • Create a main-page.minWH600.css add Page { background-color: green; }
  • Consider adding to the tap event out put of the current width/height.

Run the app on a emulator with the dimensions of 1024x600. (This is what a Amazon Fire is).
Start it up; you should get a green page. Change orientation. Quit the app. Start the app up again, you will get the red page.

Activity

  1. NathanaelA commented on Nov 24, 2016

    @NathanaelA
    Author
  2. NickIliev commented on Nov 24, 2016

    @NickIliev
    Contributor

    Hey @NathanaelA

    I have tested your issue (here is the sample app and I've used Android 4.4.4 Samsung GalaxyS4 emulator with a predefined screen size of 1024 x 768 (had to use Geny to create this specific emulator as I have not found a similar image for the 'state' AVD). However, I was not able to reproduce your results (with or without the modifications in platform.android.js the final results were the same in both cases).

    Can you please share with us what system image you have used for the testing!?

  3. NathanaelA commented on Nov 24, 2016

    @NathanaelA
    Author
  4. NathanaelA commented on Nov 24, 2016

    @NathanaelA
    Author
  5. NickIliev commented on Nov 25, 2016

    @NickIliev
    Contributor

    @NathanaelA I can confirm that mine emulator was created without the check for "Show Android Navigation Bar" and after I turned that option on I have reproduced your case, so I also think it is more likely a Genymotion related problem than a real issue. I personally prefer testing on AVDs with HAXM, as they are much more reliable, although lacking some of the option available in Genymotion.

  6. NathanaelA commented on Nov 25, 2016

    @NathanaelA
    Author
  7. NathanaelA commented on Nov 25, 2016

    @NathanaelA
    Author
  8. vakrilov commented on Nov 28, 2016

    @vakrilov
    Contributor

    Hey @NathanaelA - good catch.
    Indeed using the WINDOW_SERVICE method seems to return more consistent results and I believe this is the metrics we should use in the platforms module.

    Can you do a PR with the fix?

  9. NathanaelA commented on Dec 2, 2016

    @NathanaelA
    Author
  10. modified the milestones: , 2.5.0 on Dec 5, 2016
  11. added
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    on Dec 5, 2016
  12. added and removed
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    on Jan 10, 2017
  13. removed their assignment
    on Jan 10, 2017
  14. lock commented on Aug 29, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  15. locked and limited conversation to collaborators on Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions