Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0354021 authored by Chet Haase's avatar Chet Haase Committed by Android Git Automerger
Browse files

am b718735a: am b2488931: Merge "Avoid repositioning unattached overlay views" into jb-mr2-dev

* commit 'b718735a':
  Avoid repositioning unattached overlay views
parents 32beb2c6 b718735a
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -47,7 +47,8 @@ public class ViewGroupOverlay extends ViewOverlay {
     * animation effect.</p>
     * animation effect.</p>
     *
     *
     * <p>If the view has a parent, the view will be removed from that parent
     * <p>If the view has a parent, the view will be removed from that parent
     * before being added to the overlay. Also, the view will be repositioned
     * before being added to the overlay. Also, if that parent is attached
     * in the current view hierarchy, the view will be repositioned
     * such that it is in the same relative location inside the activity. For
     * such that it is in the same relative location inside the activity. For
     * example, if the view's current parent lies 100 pixels to the right
     * example, if the view's current parent lies 100 pixels to the right
     * and 200 pixels down from the origin of the overlay's
     * and 200 pixels down from the origin of the overlay's
+2 −1
Original line number Original line Diff line number Diff line
@@ -157,7 +157,8 @@ public class ViewOverlay {
        public void add(View child) {
        public void add(View child) {
            if (child.getParent() instanceof ViewGroup) {
            if (child.getParent() instanceof ViewGroup) {
                ViewGroup parent = (ViewGroup) child.getParent();
                ViewGroup parent = (ViewGroup) child.getParent();
                if (parent != mHostView) {
                if (parent != mHostView && parent.getParent() != null &&
                        parent.mAttachInfo != null) {
                    // Moving to different container; figure out how to position child such that
                    // Moving to different container; figure out how to position child such that
                    // it is in the same location on the screen
                    // it is in the same location on the screen
                    int[] parentLocation = new int[2];
                    int[] parentLocation = new int[2];