am 5f25f7c3: Merge "Perform layout and invalidation after bringChildToFront()" into klp-dev

* commit '5f25f7c37390e407b5c3d8545c5d6e0ef03b753a':
  Perform layout and invalidation after bringChildToFront()
This commit is contained in:
Chet Haase
2013-09-04 14:17:25 -07:00
committed by Android Git Automerger
3 changed files with 10 additions and 4 deletions

View File

@@ -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)
*/

View File

@@ -1123,6 +1123,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
removeFromArray(index);
addInArray(child, mChildrenCount);
child.mParent = this;
requestLayout();
invalidate();
}
}

View File

@@ -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
*/