summaryrefslogtreecommitdiff
path: root/core/java/android/view/ViewParent.java
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2013-04-23 06:55:04 -0700
committerChet Haase <chet@google.com>2013-04-24 12:37:36 -0700
commit0187a5d424c8618709b8f11dd7200caa0178c40e (patch)
tree78b7c2fac36e337a12ad4b92743bdc54b67ae406 /core/java/android/view/ViewParent.java
parent49906f17059afcd862ef8bc3b456a6ffef5ef40e (diff)
Document behavior and usage of ViewGroup.bringChildToFront()
A call to ViewGroup.bringChildToFront() or View.bringToFront() (which delegates to the parent's bringChildToFront() method) needs to be followed by a call to requestLayout() and invalidate() on the parent container in order for the changes to actually happen. That is, the order of the child views would change, but the parent container would not run layout or even invalidation without being told to, so there would be no visible change until something else caused a layout and invalidation to occur. This change clarifies this requirement in the javadocs. Issue #8667065 bringtoTop does not work Change-Id: Ibe41a6318dddf9fb79382e1c9fd1d21ab4510976
Diffstat (limited to 'core/java/android/view/ViewParent.java')
-rw-r--r--core/java/android/view/ViewParent.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/view/ViewParent.java b/core/java/android/view/ViewParent.java
index 4b70bc0c7e37..d79aa7efad4d 100644
--- a/core/java/android/view/ViewParent.java
+++ b/core/java/android/view/ViewParent.java
@@ -146,9 +146,13 @@ public interface ViewParent {
public View focusSearch(View v, int direction);
/**
- * Change the z order of the child so it's on top of all other children
+ * 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
+ * method should be followed by calls to {@link #requestLayout()} and
+ * {@link View#invalidate()} on this parent.
*
- * @param child
+ * @param child The child to bring to the top of the z order
*/
public void bringChildToFront(View child);