Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-34712

Callout loses anchor to CalloutButton while callout open and screen rotates

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Apache Flex 4.14.0
    • Apache Flex 4.14.1
    • None
    • windows 7, flashbuilder 4.6, flex 4.14, air 15

    Description

      When debugging on android device, rotating device from landscape to portrait and then back again causes callout to lose its positioning to the calloutbutton. It works good on the simulator, but on the device, it seems that the positioning is called before the screen finishes rotating. Tested on 3 different android devices with android 2.3.6, 4.2.2, and 4.4.

      workaround: patching callout.as
      in systemManager_resizeHandler, change invalidatePosition() to callLater(invalidatePosition). This gives the necessary delay to allow the popup to position itself in the correct location. It looks a little buggy as it moves from the old position to the new position, but atleast it gets to the right spot.

      Attachments

        Activity

          kevin.godell kevin godell added a comment -

          App puts a calloutbutton in middle of screen, filled with 3 buttons in the calloutcontent property. Rotate screen while callout is open. Callout will re-position to wrong locations. Only found trouble when testing on device. Simulator shows proper re-positioning of callout.

          kevin.godell kevin godell added a comment - App puts a calloutbutton in middle of screen, filled with 3 buttons in the calloutcontent property. Rotate screen while callout is open. Callout will re-position to wrong locations. Only found trouble when testing on device. Simulator shows proper re-positioning of callout.
          pete21 Piotr Zarzycki added a comment -

          Hi kevin.godell

          I have commented your post on dev forum with some suggestions to your fix. Please try it once yo will have some time and let us know.

          Best,
          Piotr

          pete21 Piotr Zarzycki added a comment - Hi kevin.godell I have commented your post on dev forum with some suggestions to your fix. Please try it once yo will have some time and let us know. Best, Piotr
          kevin.godell kevin godell added a comment -

          I saw that. Thanks. I will post alternative code on git when I get to my
          computer, maybe in about 5 hours.

          kevin.godell kevin godell added a comment - I saw that. Thanks. I will post alternative code on git when I get to my computer, maybe in about 5 hours.
          githubbot ASF GitHub Bot added a comment -

          GitHub user kevinGodell opened a pull request:

          https://github.com/apache/flex-sdk/pull/14

          FLEX-34712 bug fix for callout positioning on android device rotation

          Created function queued_systemManager_resizeHandler() and moved code from systemManager_resizeHandler() to that new function. New function is called via callLater() from original systemManager_resizeHandler(), allowing for calculatePopUpPosition() to get correct x and y.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/kevinGodell/flex-sdk develop

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/flex-sdk/pull/14.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #14


          commit b5e1c0b1ba007709194cd61e2cf117959b467828
          Author: Kevin Godell <kevin.godell@gmail.com>
          Date: 2015-01-08T02:41:17Z

          Fix for Callout positioning on rotate FLEX-34712

          Bug shows itself on device, and not in the simulator. When device is rotated, updatePopupPosition() is called too soon and positions to incorrect location. This fix adds a flag after detecting stageOrientationChange. The flag is read in updateDisplayList() and queues updatePopUpPostion() by calling it using callLater().

          commit 6e0a356fc1d9297f6f7cc5a0b72cc51cbbabd49f
          Author: Kevin Godell <kevin.godell@gmail.com>
          Date: 2015-01-10T01:26:41Z

          Revert "Fix for Callout positioning on rotate FLEX-34712"

          This reverts commit b5e1c0b1ba007709194cd61e2cf117959b467828.

          commit 706eb343b83085fdf339026cdb8f27124896f63d
          Author: Kevin Godell <kevin.godell@gmail.com>
          Date: 2015-01-10T04:27:41Z

          FLEX-34712 bug fix

          Popup is positioned incorrectly when called by systemManager_resizeHandler because calculatePopUpPosition()'s x or y may not be correct at that moment. Delaying the code call via callLater() solved the problem and allows the open popup to snap to its new position after device screen is rotated.

          commit ba0144f5f9d97d02246dfa4b89b21188ae060199
          Author: Kevin Godell <kevin.godell@gmail.com>
          Date: 2015-01-10T12:58:56Z

          FLEX-34712 bug fix for callout

          Created function queued_systemManager_resizeHandler() and moved code from systemManager_resizeHandler() to that new function. New function is called via callLater() from original systemManager_resizeHandler(), allowing for calculatePopUpPosition() to get correct x and y.

          commit 81618ab0285c7aa2143528239613e7c11eeca99d
          Author: Kevin Godell <kevin.godell@gmail.com>
          Date: 2015-01-14T00:42:53Z

          Update Callout.as


          githubbot ASF GitHub Bot added a comment - GitHub user kevinGodell opened a pull request: https://github.com/apache/flex-sdk/pull/14 FLEX-34712 bug fix for callout positioning on android device rotation Created function queued_systemManager_resizeHandler() and moved code from systemManager_resizeHandler() to that new function. New function is called via callLater() from original systemManager_resizeHandler(), allowing for calculatePopUpPosition() to get correct x and y. You can merge this pull request into a Git repository by running: $ git pull https://github.com/kevinGodell/flex-sdk develop Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flex-sdk/pull/14.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #14 commit b5e1c0b1ba007709194cd61e2cf117959b467828 Author: Kevin Godell <kevin.godell@gmail.com> Date: 2015-01-08T02:41:17Z Fix for Callout positioning on rotate FLEX-34712 Bug shows itself on device, and not in the simulator. When device is rotated, updatePopupPosition() is called too soon and positions to incorrect location. This fix adds a flag after detecting stageOrientationChange. The flag is read in updateDisplayList() and queues updatePopUpPostion() by calling it using callLater(). commit 6e0a356fc1d9297f6f7cc5a0b72cc51cbbabd49f Author: Kevin Godell <kevin.godell@gmail.com> Date: 2015-01-10T01:26:41Z Revert "Fix for Callout positioning on rotate FLEX-34712 " This reverts commit b5e1c0b1ba007709194cd61e2cf117959b467828. commit 706eb343b83085fdf339026cdb8f27124896f63d Author: Kevin Godell <kevin.godell@gmail.com> Date: 2015-01-10T04:27:41Z FLEX-34712 bug fix Popup is positioned incorrectly when called by systemManager_resizeHandler because calculatePopUpPosition()'s x or y may not be correct at that moment. Delaying the code call via callLater() solved the problem and allows the open popup to snap to its new position after device screen is rotated. commit ba0144f5f9d97d02246dfa4b89b21188ae060199 Author: Kevin Godell <kevin.godell@gmail.com> Date: 2015-01-10T12:58:56Z FLEX-34712 bug fix for callout Created function queued_systemManager_resizeHandler() and moved code from systemManager_resizeHandler() to that new function. New function is called via callLater() from original systemManager_resizeHandler(), allowing for calculatePopUpPosition() to get correct x and y. commit 81618ab0285c7aa2143528239613e7c11eeca99d Author: Kevin Godell <kevin.godell@gmail.com> Date: 2015-01-14T00:42:53Z Update Callout.as
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/flex-sdk/pull/14

          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/flex-sdk/pull/14
          pete21 Piotr Zarzycki added a comment -

          kevin.godell,

          Did you try nigthly build of sdk with this fix ?

          Piotr

          pete21 Piotr Zarzycki added a comment - kevin.godell , Did you try nigthly build of sdk with this fix ? Piotr
          kevin.godell kevin godell added a comment -

          I just installed 4.15 a few minutes ago and tried it on an android tablet.
          It works. I do not have time right now to try on iPhone because I have to
          leave for work(long commute caused by the recent Chicago blizzard). I hope
          to verify on iOS tonight and I will give further details.

          kevin.godell kevin godell added a comment - I just installed 4.15 a few minutes ago and tried it on an android tablet. It works. I do not have time right now to try on iPhone because I have to leave for work(long commute caused by the recent Chicago blizzard). I hope to verify on iOS tonight and I will give further details.
          kevin.godell kevin godell added a comment -

          It works ok on iOS.

          kevin.godell kevin godell added a comment - It works ok on iOS.
          pete21 Piotr Zarzycki added a comment -

          Thank you kevin.godell for your contribution!

          Piotr

          pete21 Piotr Zarzycki added a comment - Thank you kevin.godell for your contribution! Piotr

          People

            pete21 Piotr Zarzycki
            kevin.godell kevin godell
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: