You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pi...@apache.org on 2015/01/21 21:07:14 UTC

[1/6] git commit: [flex-sdk] [refs/heads/develop] - Fix for Callout positioning on rotate FLEX-34712

Repository: flex-sdk
Updated Branches:
  refs/heads/develop eb188fb3a -> aec2fe3c7


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().

Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/b5e1c0b1
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/b5e1c0b1
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/b5e1c0b1

Branch: refs/heads/develop
Commit: b5e1c0b1ba007709194cd61e2cf117959b467828
Parents: c47f9f9
Author: Kevin Godell <ke...@gmail.com>
Authored: Wed Jan 7 20:41:17 2015 -0600
Committer: Kevin Godell <ke...@gmail.com>
Committed: Wed Jan 7 20:41:17 2015 -0600

----------------------------------------------------------------------
 .../spark/src/spark/components/Callout.as       | 41 +++++++++++++++++---
 1 file changed, 35 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b5e1c0b1/frameworks/projects/spark/src/spark/components/Callout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/Callout.as b/frameworks/projects/spark/src/spark/components/Callout.as
index e7574b5..5e86e3e 100644
--- a/frameworks/projects/spark/src/spark/components/Callout.as
+++ b/frameworks/projects/spark/src/spark/components/Callout.as
@@ -244,6 +244,8 @@ public class Callout extends SkinnablePopUpContainer
     //--------------------------------------------------------------------------
     
     private var invalidatePositionFlag:Boolean = false;
+    
+    private var stageOrientationChangedFlag:Boolean = false;
 
     //--------------------------------------------------------------------------
     //
@@ -764,6 +766,7 @@ public class Callout extends SkinnablePopUpContainer
         // reset state
         invalidatePositionFlag = false;
         arrowDirectionAdjusted = false;
+        stageOrientationChangedFlag = false;
 
         // Add to PopUpManager, calls updatePopUpPosition(), and change state
         super.open(owner, modal);
@@ -773,6 +776,10 @@ public class Callout extends SkinnablePopUpContainer
         
         if (systemManagerParent)
             systemManagerParent.addEventListener(Event.RESIZE, systemManager_resizeHandler);
+            
+        // Detect stage orientation change and set flag
+        if (stage)
+	    stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, stage_orientationChangeHandler);
     }
     
     /**
@@ -787,6 +794,9 @@ public class Callout extends SkinnablePopUpContainer
         
         if (systemManagerParent)
             systemManagerParent.removeEventListener(Event.RESIZE, systemManager_resizeHandler);
+            
+        if (stage)
+            stage.removeEventListener(StageOrientationEvent.ORIENTATION_CHANGE, stage_orientationChangeHandler);
         
         super.close(commit, data);
     }
@@ -802,8 +812,17 @@ public class Callout extends SkinnablePopUpContainer
         // explicit changes to horizontalPostion and verticalPosition.
         if (isOpen && invalidatePositionFlag)
         {
-            updatePopUpPosition();
-            invalidatePositionFlag = false;
+            //check if stage orientation changed
+            if (stageOrientationChangedFlag)
+            {
+                //queue call to updatePopUpPosition
+                callLater(updatePopUpPosition);
+                stageOrientationChangedFlag = false;
+            }
+            else
+            {
+                updatePopUpPosition();
+            }
         }
 
         // Position the arrow
@@ -1683,19 +1702,29 @@ public class Callout extends SkinnablePopUpContainer
      */
     private function systemManager_resizeHandler(event:Event):void
     {
-        // Remove explicit settings if due to Resize effect
-        softKeyboardEffectResetExplicitSize();
+       	// Remove explicit settings if due to Resize effect
+       	softKeyboardEffectResetExplicitSize();
         
         // Screen resize might require a new arrow direction and callout position
         invalidatePosition();
         
-        if (!isSoftKeyboardEffectActive)
+      	if (!isSoftKeyboardEffectActive)
         {
             // Force validation and use new screen size only if the keyboard
             // effect is not active. The stage dimensions may be invalid while 
             // the soft keyboard is active. See SDK-31860.
             validateNow();
         }
+     }
+    
+    /**
+    *  @private
+    */
+    private function stage_orientationChangeHandler(event:StageOrientationEvent):void
+    {
+        //set flag to use in updateDisplayList
+        //for queuing call to updatePopUpPosition
+        stageOrientationChangedFlag = true;
     }
+  }
 }
-}
\ No newline at end of file


[4/6] git commit: [flex-sdk] [refs/heads/develop] - FLEX-34712 bug fix for callout

Posted by pi...@apache.org.
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.

Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/ba0144f5
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/ba0144f5
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/ba0144f5

Branch: refs/heads/develop
Commit: ba0144f5f9d97d02246dfa4b89b21188ae060199
Parents: 706eb34
Author: Kevin Godell <ke...@gmail.com>
Authored: Sat Jan 10 06:58:56 2015 -0600
Committer: Kevin Godell <ke...@gmail.com>
Committed: Sat Jan 10 06:58:56 2015 -0600

----------------------------------------------------------------------
 .../spark/src/spark/components/Callout.as       | 35 +++++++++++---------
 1 file changed, 19 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/ba0144f5/frameworks/projects/spark/src/spark/components/Callout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/Callout.as b/frameworks/projects/spark/src/spark/components/Callout.as
index bfbb603..dec204a 100644
--- a/frameworks/projects/spark/src/spark/components/Callout.as
+++ b/frameworks/projects/spark/src/spark/components/Callout.as
@@ -1685,24 +1685,27 @@ public class Callout extends SkinnablePopUpContainer
     {
     	//callLater() solves bug FLEX-34712 only affecting device and not found on simulator
     	//where calculatePopUpPosition()'s correct x or y may not be immediately available
-        callLater(
-            function():void
-            {
-                // Remove explicit settings if due to Resize effect
-                softKeyboardEffectResetExplicitSize();
+        callLater(queued_systemManager_resizeHandler, [event]);
+    }
+    
+    /**
+     *  @private
+     */
+    private function queued_systemManager_resizeHandler(event:Event):void
+    {
+        // Remove explicit settings if due to Resize effect
+        softKeyboardEffectResetExplicitSize();
         
-                // Screen resize might require a new arrow direction and callout position
-                invalidatePosition();
+        // Screen resize might require a new arrow direction and callout position
+        invalidatePosition();
         
-                if (!isSoftKeyboardEffectActive)
-                {
-                    // Force validation and use new screen size only if the keyboard
-                    // effect is not active. The stage dimensions may be invalid while 
-                    // the soft keyboard is active. See SDK-31860.
-                    validateNow();
-                }
-            }
-        );
+        if (!isSoftKeyboardEffectActive)
+        {
+            // Force validation and use new screen size only if the keyboard
+            // effect is not active. The stage dimensions may be invalid while 
+            // the soft keyboard is active. See SDK-31860.
+            validateNow();
+        }
     }
 }
 }


[5/6] git commit: [flex-sdk] [refs/heads/develop] - Update Callout.as

Posted by pi...@apache.org.
Update Callout.as

Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/81618ab0
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/81618ab0
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/81618ab0

Branch: refs/heads/develop
Commit: 81618ab0285c7aa2143528239613e7c11eeca99d
Parents: ba0144f
Author: Kevin Godell <ke...@gmail.com>
Authored: Tue Jan 13 18:42:53 2015 -0600
Committer: Kevin Godell <ke...@gmail.com>
Committed: Tue Jan 13 18:42:53 2015 -0600

----------------------------------------------------------------------
 frameworks/projects/spark/src/spark/components/Callout.as | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/81618ab0/frameworks/projects/spark/src/spark/components/Callout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/Callout.as b/frameworks/projects/spark/src/spark/components/Callout.as
index dec204a..ff35d7d 100644
--- a/frameworks/projects/spark/src/spark/components/Callout.as
+++ b/frameworks/projects/spark/src/spark/components/Callout.as
@@ -1683,7 +1683,7 @@ public class Callout extends SkinnablePopUpContainer
      */
     private function systemManager_resizeHandler(event:Event):void
     {
-    	//callLater() solves bug FLEX-34712 only affecting device and not found on simulator
+    	//callLater() solves bug FLEX-34712 only affecting android device and not affecting ios device or simulator
     	//where calculatePopUpPosition()'s correct x or y may not be immediately available
         callLater(queued_systemManager_resizeHandler, [event]);
     }


[6/6] git commit: [flex-sdk] [refs/heads/develop] - Merge branch 'develop' of https://github.com/kevinGodell/flex-sdk into develop

Posted by pi...@apache.org.
Merge branch 'develop' of https://github.com/kevinGodell/flex-sdk into develop


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/aec2fe3c
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/aec2fe3c
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/aec2fe3c

Branch: refs/heads/develop
Commit: aec2fe3c7d810f375894e1a0d0b26502ae344a6e
Parents: eb188fb 81618ab
Author: piotrz <pi...@gmail.com>
Authored: Wed Jan 21 21:01:03 2015 +0100
Committer: piotrz <pi...@gmail.com>
Committed: Wed Jan 21 21:01:03 2015 +0100

----------------------------------------------------------------------
 .../projects/spark/src/spark/components/Callout.as      | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[3/6] git commit: [flex-sdk] [refs/heads/develop] - FLEX-34712 bug fix

Posted by pi...@apache.org.
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.

Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/706eb343
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/706eb343
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/706eb343

Branch: refs/heads/develop
Commit: 706eb343b83085fdf339026cdb8f27124896f63d
Parents: 6e0a356
Author: Kevin Godell <ke...@gmail.com>
Authored: Fri Jan 9 22:27:41 2015 -0600
Committer: Kevin Godell <ke...@gmail.com>
Committed: Fri Jan 9 22:27:41 2015 -0600

----------------------------------------------------------------------
 .../spark/src/spark/components/Callout.as       | 31 ++++++++++++--------
 1 file changed, 19 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/706eb343/frameworks/projects/spark/src/spark/components/Callout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/Callout.as b/frameworks/projects/spark/src/spark/components/Callout.as
index e7574b5..bfbb603 100644
--- a/frameworks/projects/spark/src/spark/components/Callout.as
+++ b/frameworks/projects/spark/src/spark/components/Callout.as
@@ -1683,19 +1683,26 @@ public class Callout extends SkinnablePopUpContainer
      */
     private function systemManager_resizeHandler(event:Event):void
     {
-        // Remove explicit settings if due to Resize effect
-        softKeyboardEffectResetExplicitSize();
+    	//callLater() solves bug FLEX-34712 only affecting device and not found on simulator
+    	//where calculatePopUpPosition()'s correct x or y may not be immediately available
+        callLater(
+            function():void
+            {
+                // Remove explicit settings if due to Resize effect
+                softKeyboardEffectResetExplicitSize();
         
-        // Screen resize might require a new arrow direction and callout position
-        invalidatePosition();
+                // Screen resize might require a new arrow direction and callout position
+                invalidatePosition();
         
-        if (!isSoftKeyboardEffectActive)
-        {
-            // Force validation and use new screen size only if the keyboard
-            // effect is not active. The stage dimensions may be invalid while 
-            // the soft keyboard is active. See SDK-31860.
-            validateNow();
-        }
+                if (!isSoftKeyboardEffectActive)
+                {
+                    // Force validation and use new screen size only if the keyboard
+                    // effect is not active. The stage dimensions may be invalid while 
+                    // the soft keyboard is active. See SDK-31860.
+                    validateNow();
+                }
+            }
+        );
     }
 }
-}
\ No newline at end of file
+}


[2/6] git commit: [flex-sdk] [refs/heads/develop] - Revert "Fix for Callout positioning on rotate FLEX-34712"

Posted by pi...@apache.org.
Revert "Fix for Callout positioning on rotate FLEX-34712"

This reverts commit b5e1c0b1ba007709194cd61e2cf117959b467828.


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/6e0a356f
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/6e0a356f
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/6e0a356f

Branch: refs/heads/develop
Commit: 6e0a356fc1d9297f6f7cc5a0b72cc51cbbabd49f
Parents: b5e1c0b
Author: Kevin Godell <ke...@gmail.com>
Authored: Fri Jan 9 19:26:41 2015 -0600
Committer: Kevin Godell <ke...@gmail.com>
Committed: Fri Jan 9 19:26:41 2015 -0600

----------------------------------------------------------------------
 .../spark/src/spark/components/Callout.as       | 41 +++-----------------
 1 file changed, 6 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/6e0a356f/frameworks/projects/spark/src/spark/components/Callout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/Callout.as b/frameworks/projects/spark/src/spark/components/Callout.as
index 5e86e3e..e7574b5 100644
--- a/frameworks/projects/spark/src/spark/components/Callout.as
+++ b/frameworks/projects/spark/src/spark/components/Callout.as
@@ -244,8 +244,6 @@ public class Callout extends SkinnablePopUpContainer
     //--------------------------------------------------------------------------
     
     private var invalidatePositionFlag:Boolean = false;
-    
-    private var stageOrientationChangedFlag:Boolean = false;
 
     //--------------------------------------------------------------------------
     //
@@ -766,7 +764,6 @@ public class Callout extends SkinnablePopUpContainer
         // reset state
         invalidatePositionFlag = false;
         arrowDirectionAdjusted = false;
-        stageOrientationChangedFlag = false;
 
         // Add to PopUpManager, calls updatePopUpPosition(), and change state
         super.open(owner, modal);
@@ -776,10 +773,6 @@ public class Callout extends SkinnablePopUpContainer
         
         if (systemManagerParent)
             systemManagerParent.addEventListener(Event.RESIZE, systemManager_resizeHandler);
-            
-        // Detect stage orientation change and set flag
-        if (stage)
-	    stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, stage_orientationChangeHandler);
     }
     
     /**
@@ -794,9 +787,6 @@ public class Callout extends SkinnablePopUpContainer
         
         if (systemManagerParent)
             systemManagerParent.removeEventListener(Event.RESIZE, systemManager_resizeHandler);
-            
-        if (stage)
-            stage.removeEventListener(StageOrientationEvent.ORIENTATION_CHANGE, stage_orientationChangeHandler);
         
         super.close(commit, data);
     }
@@ -812,17 +802,8 @@ public class Callout extends SkinnablePopUpContainer
         // explicit changes to horizontalPostion and verticalPosition.
         if (isOpen && invalidatePositionFlag)
         {
-            //check if stage orientation changed
-            if (stageOrientationChangedFlag)
-            {
-                //queue call to updatePopUpPosition
-                callLater(updatePopUpPosition);
-                stageOrientationChangedFlag = false;
-            }
-            else
-            {
-                updatePopUpPosition();
-            }
+            updatePopUpPosition();
+            invalidatePositionFlag = false;
         }
 
         // Position the arrow
@@ -1702,29 +1683,19 @@ public class Callout extends SkinnablePopUpContainer
      */
     private function systemManager_resizeHandler(event:Event):void
     {
-       	// Remove explicit settings if due to Resize effect
-       	softKeyboardEffectResetExplicitSize();
+        // Remove explicit settings if due to Resize effect
+        softKeyboardEffectResetExplicitSize();
         
         // Screen resize might require a new arrow direction and callout position
         invalidatePosition();
         
-      	if (!isSoftKeyboardEffectActive)
+        if (!isSoftKeyboardEffectActive)
         {
             // Force validation and use new screen size only if the keyboard
             // effect is not active. The stage dimensions may be invalid while 
             // the soft keyboard is active. See SDK-31860.
             validateNow();
         }
-     }
-    
-    /**
-    *  @private
-    */
-    private function stage_orientationChangeHandler(event:StageOrientationEvent):void
-    {
-        //set flag to use in updateDisplayList
-        //for queuing call to updatePopUpPosition
-        stageOrientationChangedFlag = true;
     }
-  }
 }
+}
\ No newline at end of file