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

Commit 49870a1b authored by Alan Viverette's avatar Alan Viverette Committed by Android Git Automerger
Browse files

am e28cd1a2: Merge "Only request layout when removeView() actually removes a view" into lmp-mr1-dev

* commit 'e28cd1a2':
  Only request layout when removeView() actually removes a view
parents 3a332602 e28cd1a2
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -4078,10 +4078,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
     * {@link #dispatchDraw(android.graphics.Canvas)} or any related method.</p>
     */
    public void removeView(View view) {
        removeViewInternal(view);
        if (removeViewInternal(view)) {
            requestLayout();
            invalidate(true);
        }
    }

    /**
     * Removes a view during layout. This is useful if in your onLayout() method,
@@ -4143,11 +4144,13 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        invalidate(true);
    }

    private void removeViewInternal(View view) {
    private boolean removeViewInternal(View view) {
        final int index = indexOfChild(view);
        if (index >= 0) {
            removeViewInternal(index, view);
            return true;
        }
        return false;
    }

    private void removeViewInternal(int index, View view) {