@@ -3154,8 +3154,12 @@ protected View findViewByPredicateTraversal(Predicate<View> predicate, View chil
31543154 }
31553155
31563156 /**
3157- * Adds a child view. If no layout parameters are already set on the child, the
3158- * default parameters for this ViewGroup are set on the child.
3157+ * <p>Adds a child view. If no layout parameters are already set on the child, the
3158+ * default parameters for this ViewGroup are set on the child.</p>
3159+ *
3160+ * <p><strong>Note:</strong> do not invoke this method from
3161+ * {@link #draw(android.graphics.Canvas)}, {@link #onDraw(android.graphics.Canvas)},
3162+ * {@link #dispatchDraw(android.graphics.Canvas)} or any related method.</p>
31593163 *
31603164 * @param child the child view to add
31613165 *
@@ -3168,6 +3172,10 @@ public void addView(View child) {
31683172 /**
31693173 * Adds a child view. If no layout parameters are already set on the child, the
31703174 * default parameters for this ViewGroup are set on the child.
3175+ *
3176+ * <p><strong>Note:</strong> do not invoke this method from
3177+ * {@link #draw(android.graphics.Canvas)}, {@link #onDraw(android.graphics.Canvas)},
3178+ * {@link #dispatchDraw(android.graphics.Canvas)} or any related method.</p>
31713179 *
31723180 * @param child the child view to add
31733181 * @param index the position at which to add the child
@@ -3189,6 +3197,10 @@ public void addView(View child, int index) {
31893197 * Adds a child view with this ViewGroup's default layout parameters and the
31903198 * specified width and height.
31913199 *
3200+ * <p><strong>Note:</strong> do not invoke this method from
3201+ * {@link #draw(android.graphics.Canvas)}, {@link #onDraw(android.graphics.Canvas)},
3202+ * {@link #dispatchDraw(android.graphics.Canvas)} or any related method.</p>
3203+ *
31923204 * @param child the child view to add
31933205 */
31943206 public void addView (View child , int width , int height ) {
@@ -3201,6 +3213,10 @@ public void addView(View child, int width, int height) {
32013213 /**
32023214 * Adds a child view with the specified layout parameters.
32033215 *
3216+ * <p><strong>Note:</strong> do not invoke this method from
3217+ * {@link #draw(android.graphics.Canvas)}, {@link #onDraw(android.graphics.Canvas)},
3218+ * {@link #dispatchDraw(android.graphics.Canvas)} or any related method.</p>
3219+ *
32043220 * @param child the child view to add
32053221 * @param params the layout parameters to set on the child
32063222 */
@@ -3211,6 +3227,10 @@ public void addView(View child, LayoutParams params) {
32113227 /**
32123228 * Adds a child view with the specified layout parameters.
32133229 *
3230+ * <p><strong>Note:</strong> do not invoke this method from
3231+ * {@link #draw(android.graphics.Canvas)}, {@link #onDraw(android.graphics.Canvas)},
3232+ * {@link #dispatchDraw(android.graphics.Canvas)} or any related method.</p>
3233+ *
32143234 * @param child the child view to add
32153235 * @param index the position at which to add the child
32163236 * @param params the layout parameters to set on the child
@@ -3528,6 +3548,10 @@ protected void attachLayoutAnimationParameters(View child,
35283548
35293549 /**
35303550 * {@inheritDoc}
3551+ *
3552+ * <p><strong>Note:</strong> do not invoke this method from
3553+ * {@link #draw(android.graphics.Canvas)}, {@link #onDraw(android.graphics.Canvas)},
3554+ * {@link #dispatchDraw(android.graphics.Canvas)} or any related method.</p>
35313555 */
35323556 public void removeView (View view ) {
35333557 removeViewInternal (view );
@@ -3539,6 +3563,10 @@ public void removeView(View view) {
35393563 * Removes a view during layout. This is useful if in your onLayout() method,
35403564 * you need to remove more views.
35413565 *
3566+ * <p><strong>Note:</strong> do not invoke this method from
3567+ * {@link #draw(android.graphics.Canvas)}, {@link #onDraw(android.graphics.Canvas)},
3568+ * {@link #dispatchDraw(android.graphics.Canvas)} or any related method.</p>
3569+ *
35423570 * @param view the view to remove from the group
35433571 */
35443572 public void removeViewInLayout (View view ) {
@@ -3549,6 +3577,10 @@ public void removeViewInLayout(View view) {
35493577 * Removes a range of views during layout. This is useful if in your onLayout() method,
35503578 * you need to remove more views.
35513579 *
3580+ * <p><strong>Note:</strong> do not invoke this method from
3581+ * {@link #draw(android.graphics.Canvas)}, {@link #onDraw(android.graphics.Canvas)},
3582+ * {@link #dispatchDraw(android.graphics.Canvas)} or any related method.</p>
3583+ *
35523584 * @param start the index of the first view to remove from the group
35533585 * @param count the number of views to remove from the group
35543586 */
@@ -3559,6 +3591,10 @@ public void removeViewsInLayout(int start, int count) {
35593591 /**
35603592 * Removes the view at the specified position in the group.
35613593 *
3594+ * <p><strong>Note:</strong> do not invoke this method from
3595+ * {@link #draw(android.graphics.Canvas)}, {@link #onDraw(android.graphics.Canvas)},
3596+ * {@link #dispatchDraw(android.graphics.Canvas)} or any related method.</p>
3597+ *
35623598 * @param index the position in the group of the view to remove
35633599 */
35643600 public void removeViewAt (int index ) {
@@ -3570,6 +3606,10 @@ public void removeViewAt(int index) {
35703606 /**
35713607 * Removes the specified range of views from the group.
35723608 *
3609+ * <p><strong>Note:</strong> do not invoke this method from
3610+ * {@link #draw(android.graphics.Canvas)}, {@link #onDraw(android.graphics.Canvas)},
3611+ * {@link #dispatchDraw(android.graphics.Canvas)} or any related method.</p>
3612+ *
35733613 * @param start the first position in the group of the range of views to remove
35743614 * @param count the number of views to remove
35753615 */
@@ -3715,6 +3755,10 @@ private void removeViewsInternal(int start, int count) {
37153755 /**
37163756 * Call this method to remove all child views from the
37173757 * ViewGroup.
3758+ *
3759+ * <p><strong>Note:</strong> do not invoke this method from
3760+ * {@link #draw(android.graphics.Canvas)}, {@link #onDraw(android.graphics.Canvas)},
3761+ * {@link #dispatchDraw(android.graphics.Canvas)} or any related method.</p>
37183762 */
37193763 public void removeAllViews () {
37203764 removeAllViewsInLayout ();
@@ -3730,6 +3774,10 @@ public void removeAllViews() {
37303774 * that can currently fit inside the object on screen. Do not call
37313775 * this method unless you are extending ViewGroup and understand the
37323776 * view measuring and layout pipeline.
3777+ *
3778+ * <p><strong>Note:</strong> do not invoke this method from
3779+ * {@link #draw(android.graphics.Canvas)}, {@link #onDraw(android.graphics.Canvas)},
3780+ * {@link #dispatchDraw(android.graphics.Canvas)} or any related method.</p>
37333781 */
37343782 public void removeAllViewsInLayout () {
37353783 final int count = mChildrenCount ;
0 commit comments