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

Commit cb96db8d authored by Chet Haase's avatar Chet Haase
Browse files

Perform layout and invalidation after bringChildToFront()

Previously, calls to ViewGroup.bringChildToFront() or View.bringToFront()
would need to be followed by calls to requestLayout() and invalidate()
to force the container to redraw with the new child ordering. This
change calls requestLayout() and invalidate() automatically.

Issue #8667065 bringtoTop does not work

Change-Id: Id37ce7a64dead82119e49f7a1b28385cf0d1f20d
parent 52c10e94
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -8836,9 +8836,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    /**
     * Change the view's z order in the tree, so it's on top of other sibling
     * views. This ordering change may affect layout, if the parent container
     * uses an order-dependent layout scheme (e.g., LinearLayout). This
     * uses an order-dependent layout scheme (e.g., LinearLayout). Prior
     * to {@link android.os.Build.VERSION_CODES#KEY_LIME_PIE} this
     * method should be followed by calls to {@link #requestLayout()} and
     * {@link View#invalidate()} on the parent.
     * {@link View#invalidate()} on the view's parent to force the parent to redraw
     * with the new child ordering.
     *
     * @see ViewGroup#bringChildToFront(View)
     */
+2 −0
Original line number Diff line number Diff line
@@ -1123,6 +1123,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
            removeFromArray(index);
            addInArray(child, mChildrenCount);
            child.mParent = this;
            requestLayout();
            invalidate();
        }
    }

+4 −2
Original line number Diff line number Diff line
@@ -148,9 +148,11 @@ public interface ViewParent {
    /**
     * Change the z order of the child so it's on top of all other children.
     * This ordering change may affect layout, if this container
     * uses an order-dependent layout scheme (e.g., LinearLayout). This
     * uses an order-dependent layout scheme (e.g., LinearLayout). Prior
     * to {@link android.os.Build.VERSION_CODES#KEY_LIME_PIE} this
     * method should be followed by calls to {@link #requestLayout()} and
     * {@link View#invalidate()} on this parent.
     * {@link View#invalidate()} on this parent to force the parent to redraw
     * with the new child ordering.
     * 
     * @param child The child to bring to the top of the z order
     */