blob: 54bdec40c60dd9ed5c54e025f3b6e06ffca81bff [file] [log] [blame]
Winson Chung321e9ee2010-08-09 13:37:56 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.launcher2;
18
19import android.content.Context;
Winson Chung785d2eb2011-04-14 16:08:02 -070020import android.content.res.Resources;
Winson Chung321e9ee2010-08-09 13:37:56 -070021import android.util.AttributeSet;
Winson Chung321e9ee2010-08-09 13:37:56 -070022import android.view.MotionEvent;
23import android.view.View;
24import android.view.ViewDebug;
25import android.view.ViewGroup;
26
Winson Chung785d2eb2011-04-14 16:08:02 -070027import com.android.launcher.R;
28
Winson Chung321e9ee2010-08-09 13:37:56 -070029/**
30 * An abstraction of the original CellLayout which supports laying out items
31 * which span multiple cells into a grid-like layout. Also supports dimming
32 * to give a preview of its contents.
33 */
Michael Jurka8245a862011-02-01 17:53:59 -080034public class PagedViewCellLayout extends ViewGroup implements Page {
Winson Chung321e9ee2010-08-09 13:37:56 -070035 static final String TAG = "PagedViewCellLayout";
36
Winson Chung321e9ee2010-08-09 13:37:56 -070037 private int mCellCountX;
38 private int mCellCountY;
39 private int mCellWidth;
40 private int mCellHeight;
Winson Chungdf4b83d2010-10-20 17:49:27 -070041 private int mWidthGap;
42 private int mHeightGap;
Michael Jurka8245a862011-02-01 17:53:59 -080043 protected PagedViewCellLayoutChildren mChildren;
44 private PagedViewCellLayoutChildren mHolographicChildren;
Michael Jurkaabded662011-03-04 12:06:57 -080045 private boolean mAllowHardwareLayerCreation = false;
46 private boolean mCreateHardwareLayersIfAllowed = false;
Winson Chung321e9ee2010-08-09 13:37:56 -070047
Winson Chung321e9ee2010-08-09 13:37:56 -070048 public PagedViewCellLayout(Context context) {
49 this(context, null);
50 }
51
52 public PagedViewCellLayout(Context context, AttributeSet attrs) {
53 this(context, attrs, 0);
54 }
55
56 public PagedViewCellLayout(Context context, AttributeSet attrs, int defStyle) {
57 super(context, attrs, defStyle);
58
Winson Chung321e9ee2010-08-09 13:37:56 -070059 setAlwaysDrawnWithCacheEnabled(false);
60
61 // setup default cell parameters
Winson Chung785d2eb2011-04-14 16:08:02 -070062 Resources resources = context.getResources();
63 mCellWidth = resources.getDimensionPixelSize(R.dimen.apps_customize_cell_width);
64 mCellHeight = resources.getDimensionPixelSize(R.dimen.apps_customize_cell_height);
Winson Chung321e9ee2010-08-09 13:37:56 -070065 mCellCountX = LauncherModel.getCellCountX();
66 mCellCountY = LauncherModel.getCellCountY();
Winson Chungdf4b83d2010-10-20 17:49:27 -070067 mWidthGap = mHeightGap = -1;
Winson Chung321e9ee2010-08-09 13:37:56 -070068
Michael Jurka8245a862011-02-01 17:53:59 -080069 mChildren = new PagedViewCellLayoutChildren(context);
70 mChildren.setCellDimensions(mCellWidth, mCellHeight);
71 mChildren.setGap(mWidthGap, mHeightGap);
72
73 addView(mChildren);
74 mHolographicChildren = new PagedViewCellLayoutChildren(context);
75 mHolographicChildren.setAlpha(0f);
76 mHolographicChildren.setCellDimensions(mCellWidth, mCellHeight);
77 mHolographicChildren.setGap(mWidthGap, mHeightGap);
78
79 addView(mHolographicChildren);
Winson Chungb3347bb2010-08-19 14:51:28 -070080 }
Winson Chung321e9ee2010-08-09 13:37:56 -070081
Michael Jurkaabded662011-03-04 12:06:57 -080082 public void allowHardwareLayerCreation() {
83 // This is called after the first time we launch into All Apps. Before that point,
84 // there's no need for hardware layers here since there's a hardware layer set on the
85 // parent, AllAppsTabbed, during the AllApps transition -- creating hardware layers here
86 // before the animation is done slows down the animation
87 if (!mAllowHardwareLayerCreation) {
88 mAllowHardwareLayerCreation = true;
89 if (mCreateHardwareLayersIfAllowed) {
90 createHardwareLayers();
91 }
92 }
Michael Jurkac0759f52011-02-03 16:47:14 -080093 }
94
Winson Chungb3347bb2010-08-19 14:51:28 -070095 @Override
96 public void setAlpha(float alpha) {
Michael Jurka8245a862011-02-01 17:53:59 -080097 mChildren.setAlpha(alpha);
98 mHolographicChildren.setAlpha(1.0f - alpha);
Winson Chung321e9ee2010-08-09 13:37:56 -070099 }
100
Michael Jurkac0759f52011-02-03 16:47:14 -0800101 void destroyHardwareLayers() {
Michael Jurkaabded662011-03-04 12:06:57 -0800102 // called when a page is no longer visible (triggered by loadAssociatedPages ->
103 // removeAllViewsOnPage)
104 mCreateHardwareLayersIfAllowed = false;
105 if (mAllowHardwareLayerCreation) {
Michael Jurkac0759f52011-02-03 16:47:14 -0800106 mChildren.destroyHardwareLayer();
107 mHolographicChildren.destroyHardwareLayer();
108 }
109 }
110 void createHardwareLayers() {
Michael Jurkaabded662011-03-04 12:06:57 -0800111 // called when a page is visible (triggered by loadAssociatedPages -> syncPageItems)
112 mCreateHardwareLayersIfAllowed = true;
113 if (mAllowHardwareLayerCreation) {
Michael Jurkac0759f52011-02-03 16:47:14 -0800114 mChildren.createHardwareLayer();
115 mHolographicChildren.createHardwareLayer();
116 }
117 }
118
Winson Chung321e9ee2010-08-09 13:37:56 -0700119 @Override
120 public void cancelLongPress() {
121 super.cancelLongPress();
122
123 // Cancel long press for all children
124 final int count = getChildCount();
125 for (int i = 0; i < count; i++) {
126 final View child = getChildAt(i);
127 child.cancelLongPress();
128 }
129 }
130
131 public boolean addViewToCellLayout(View child, int index, int childId,
Winson Chung63257c12011-05-05 17:06:13 -0700132 PagedViewCellLayout.LayoutParams params, boolean createHolographicOutlines) {
Winson Chung321e9ee2010-08-09 13:37:56 -0700133 final PagedViewCellLayout.LayoutParams lp = params;
134
135 // Generate an id for each view, this assumes we have at most 256x256 cells
136 // per workspace screen
137 if (lp.cellX >= 0 && lp.cellX <= (mCellCountX - 1) &&
138 lp.cellY >= 0 && (lp.cellY <= mCellCountY - 1)) {
139 // If the horizontal or vertical span is set to -1, it is taken to
140 // mean that it spans the extent of the CellLayout
141 if (lp.cellHSpan < 0) lp.cellHSpan = mCellCountX;
142 if (lp.cellVSpan < 0) lp.cellVSpan = mCellCountY;
143
144 child.setId(childId);
Michael Jurka8245a862011-02-01 17:53:59 -0800145 mChildren.addView(child, index, lp);
Winson Chung321e9ee2010-08-09 13:37:56 -0700146
Michael Jurka8245a862011-02-01 17:53:59 -0800147 if (child instanceof PagedViewIcon) {
148 PagedViewIcon pagedViewIcon = (PagedViewIcon) child;
Michael Jurkaabded662011-03-04 12:06:57 -0800149 if (mAllowHardwareLayerCreation) {
Michael Jurkac0759f52011-02-03 16:47:14 -0800150 pagedViewIcon.disableCache();
151 }
Winson Chung63257c12011-05-05 17:06:13 -0700152 if (createHolographicOutlines) {
153 mHolographicChildren.addView(pagedViewIcon.getHolographicOutlineView(),
154 index, lp);
155 }
Michael Jurka8245a862011-02-01 17:53:59 -0800156 }
Winson Chung321e9ee2010-08-09 13:37:56 -0700157 return true;
158 }
159 return false;
160 }
161
162 @Override
Michael Jurka8245a862011-02-01 17:53:59 -0800163 public void removeAllViewsOnPage() {
164 mChildren.removeAllViews();
165 mHolographicChildren.removeAllViews();
Michael Jurkac5e49022011-02-16 12:04:02 -0800166 destroyHardwareLayers();
Winson Chung321e9ee2010-08-09 13:37:56 -0700167 }
168
169 @Override
Michael Jurka8245a862011-02-01 17:53:59 -0800170 public void removeViewOnPageAt(int index) {
171 mChildren.removeViewAt(index);
172 mHolographicChildren.removeViewAt(index);
173 }
174
175 @Override
176 public int getPageChildCount() {
177 return mChildren.getChildCount();
178 }
179
180 @Override
181 public View getChildOnPageAt(int i) {
182 return mChildren.getChildAt(i);
183 }
184
185 @Override
186 public int indexOfChildOnPage(View v) {
187 return mChildren.indexOfChild(v);
188 }
189
Winson Chung97d85d22011-04-13 11:27:36 -0700190 public int getCellCountX() {
191 return mCellCountX;
192 }
193
194 public int getCellCountY() {
195 return mCellCountY;
196 }
197
Winson Chung321e9ee2010-08-09 13:37:56 -0700198 protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
199 // TODO: currently ignoring padding
200
201 int widthSpecMode = MeasureSpec.getMode(widthMeasureSpec);
202 int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec);
203
204 int heightSpecMode = MeasureSpec.getMode(heightMeasureSpec);
205 int heightSpecSize = MeasureSpec.getSize(heightMeasureSpec);
206
207 if (widthSpecMode == MeasureSpec.UNSPECIFIED || heightSpecMode == MeasureSpec.UNSPECIFIED) {
208 throw new RuntimeException("CellLayout cannot have UNSPECIFIED dimensions");
209 }
210
211 final int cellWidth = mCellWidth;
212 final int cellHeight = mCellHeight;
213
214 int numWidthGaps = mCellCountX - 1;
215 int numHeightGaps = mCellCountY - 1;
216
217 int vSpaceLeft = heightSpecSize - mPaddingTop
218 - mPaddingBottom - (cellHeight * mCellCountY);
219 int heightGap = vSpaceLeft / numHeightGaps;
220
221 int hSpaceLeft = widthSpecSize - mPaddingLeft
222 - mPaddingRight - (cellWidth * mCellCountX);
223 int widthGap = hSpaceLeft / numWidthGaps;
224
225 // center it around the min gaps
226 int minGap = Math.min(widthGap, heightGap);
Winson Chung321e9ee2010-08-09 13:37:56 -0700227 /*
228 if (minGap < heightGap) {
229 // vertical space has shrunken, so change padding accordingly
230 paddingTop += ((heightGap - minGap) * (mCellCountY - 1)) / 2;
231 } else if (minGap < widthGap) {
232 // horizontal space has shrunken, so change padding accordingly
233 paddingLeft += ((widthGap - minGap) * (mCellCountX - 1)) / 2;
234 }
235 */
Winson Chungdf4b83d2010-10-20 17:49:27 -0700236 if (mWidthGap > -1 && mHeightGap > -1) {
237 widthGap = mWidthGap;
238 heightGap = mHeightGap;
239 } else {
240 widthGap = heightGap = minGap;
241 }
Winson Chung321e9ee2010-08-09 13:37:56 -0700242
243 int newWidth = mPaddingLeft + mPaddingRight + (mCellCountX * cellWidth) +
Winson Chungdf4b83d2010-10-20 17:49:27 -0700244 ((mCellCountX - 1) * widthGap);
Winson Chung321e9ee2010-08-09 13:37:56 -0700245 int newHeight = mPaddingTop + mPaddingBottom + (mCellCountY * cellHeight) +
Winson Chungdf4b83d2010-10-20 17:49:27 -0700246 ((mCellCountY - 1) * heightGap);
Winson Chung321e9ee2010-08-09 13:37:56 -0700247
248 final int count = getChildCount();
249 for (int i = 0; i < count; i++) {
250 View child = getChildAt(i);
Michael Jurka8245a862011-02-01 17:53:59 -0800251 int childWidthMeasureSpec =
252 MeasureSpec.makeMeasureSpec(newWidth, MeasureSpec.EXACTLY);
253 int childheightMeasureSpec =
254 MeasureSpec.makeMeasureSpec(newHeight, MeasureSpec.EXACTLY);
Winson Chung321e9ee2010-08-09 13:37:56 -0700255 child.measure(childWidthMeasureSpec, childheightMeasureSpec);
256 }
257
258 setMeasuredDimension(newWidth, newHeight);
259 }
260
Michael Jurka7ef959b2011-02-23 11:48:32 -0800261 int getContentWidth() {
Michael Jurkaa2eb1702011-05-12 14:57:05 -0700262 if (LauncherApplication.isScreenLarge()) {
Winson Chung785d2eb2011-04-14 16:08:02 -0700263 // Return the distance from the left edge of the content of the leftmost icon to
264 // the right edge of the content of the rightmost icon
Michael Jurka7ef959b2011-02-23 11:48:32 -0800265
Winson Chung785d2eb2011-04-14 16:08:02 -0700266 // icons are centered within cells, find out how much padding that accounts for
267 return getWidthBeforeFirstLayout() - (mCellWidth - Utilities.getIconContentSize());
268 } else {
269 return getWidthBeforeFirstLayout() + mPaddingLeft + mPaddingRight;
270 }
Michael Jurka0413dfa2011-04-05 16:52:32 -0700271 }
272
Winson Chung4b576be2011-04-27 17:40:20 -0700273 int getContentHeight() {
274 return mCellCountY * mCellHeight + (mCellCountY - 1) * Math.max(0, mHeightGap);
275 }
276
Michael Jurkad92e7412011-04-05 17:07:27 -0700277 int getWidthBeforeFirstLayout() {
Winson Chung4b576be2011-04-27 17:40:20 -0700278 return mCellCountX * mCellWidth + (mCellCountX - 1) * Math.max(0, mWidthGap);
Michael Jurka7ef959b2011-02-23 11:48:32 -0800279 }
280
Winson Chung321e9ee2010-08-09 13:37:56 -0700281 @Override
282 protected void onLayout(boolean changed, int l, int t, int r, int b) {
283 int count = getChildCount();
Winson Chung321e9ee2010-08-09 13:37:56 -0700284 for (int i = 0; i < count; i++) {
285 View child = getChildAt(i);
Michael Jurkaa2eb1702011-05-12 14:57:05 -0700286 if (LauncherApplication.isScreenLarge()) {
Winson Chung785d2eb2011-04-14 16:08:02 -0700287 child.layout(0, 0, r - l, b - t);
288 } else {
289 child.layout(mPaddingLeft, mPaddingTop, getMeasuredWidth() - mPaddingRight,
290 getMeasuredHeight() - mPaddingBottom);
291 }
Winson Chung321e9ee2010-08-09 13:37:56 -0700292 }
293 }
294
295 @Override
Winson Chung321e9ee2010-08-09 13:37:56 -0700296 public boolean onTouchEvent(MotionEvent event) {
297 return super.onTouchEvent(event) || true;
298 }
299
Winson Chung80baf5a2010-08-09 16:03:15 -0700300 public void enableCenteredContent(boolean enabled) {
Michael Jurka8245a862011-02-01 17:53:59 -0800301 mChildren.enableCenteredContent(enabled);
302 mHolographicChildren.enableCenteredContent(enabled);
Winson Chung80baf5a2010-08-09 16:03:15 -0700303 }
304
Winson Chung321e9ee2010-08-09 13:37:56 -0700305 @Override
306 protected void setChildrenDrawingCacheEnabled(boolean enabled) {
Michael Jurka8245a862011-02-01 17:53:59 -0800307 mChildren.setChildrenDrawingCacheEnabled(enabled);
308 mHolographicChildren.setChildrenDrawingCacheEnabled(enabled);
Winson Chung321e9ee2010-08-09 13:37:56 -0700309 }
310
311 public void setCellCount(int xCount, int yCount) {
312 mCellCountX = xCount;
313 mCellCountY = yCount;
314 requestLayout();
315 }
316
Winson Chungdf4b83d2010-10-20 17:49:27 -0700317 public void setGap(int widthGap, int heightGap) {
318 mWidthGap = widthGap;
319 mHeightGap = heightGap;
Michael Jurka8245a862011-02-01 17:53:59 -0800320 mChildren.setGap(widthGap, heightGap);
321 mHolographicChildren.setGap(widthGap, heightGap);
Winson Chungdf4b83d2010-10-20 17:49:27 -0700322 }
323
Winson Chung80baf5a2010-08-09 16:03:15 -0700324 public int[] getCellCountForDimensions(int width, int height) {
325 // Always assume we're working with the smallest span to make sure we
326 // reserve enough space in both orientations
327 int smallerSize = Math.min(mCellWidth, mCellHeight);
328
329 // Always round up to next largest cell
330 int spanX = (width + smallerSize) / smallerSize;
331 int spanY = (height + smallerSize) / smallerSize;
332
333 return new int[] { spanX, spanY };
334 }
335
Winson Chung321e9ee2010-08-09 13:37:56 -0700336 /**
337 * Start dragging the specified child
338 *
339 * @param child The child that is being dragged
340 */
341 void onDragChild(View child) {
342 PagedViewCellLayout.LayoutParams lp = (PagedViewCellLayout.LayoutParams) child.getLayoutParams();
343 lp.isDragging = true;
344 }
345
Winson Chunge3193b92010-09-10 11:44:42 -0700346 /**
347 * Estimates the number of cells that the specified width would take up.
348 */
Winson Chung80baf5a2010-08-09 16:03:15 -0700349 public int estimateCellHSpan(int width) {
Winson Chunge3193b92010-09-10 11:44:42 -0700350 // TODO: we need to take widthGap into effect
Winson Chung80baf5a2010-08-09 16:03:15 -0700351 return (width + mCellWidth) / mCellWidth;
352 }
Winson Chunge3193b92010-09-10 11:44:42 -0700353
354 /**
355 * Estimates the number of cells that the specified height would take up.
356 */
Winson Chung80baf5a2010-08-09 16:03:15 -0700357 public int estimateCellVSpan(int height) {
Winson Chunge3193b92010-09-10 11:44:42 -0700358 // TODO: we need to take heightGap into effect
Winson Chung80baf5a2010-08-09 16:03:15 -0700359 return (height + mCellHeight) / mCellHeight;
360 }
Winson Chunge3193b92010-09-10 11:44:42 -0700361
362 /**
363 * Estimates the width that the number of vSpan cells will take up.
364 */
365 public int estimateCellWidth(int hSpan) {
366 // TODO: we need to take widthGap into effect
367 return hSpan * mCellWidth;
368 }
369
370 /**
371 * Estimates the height that the number of vSpan cells will take up.
372 */
373 public int estimateCellHeight(int vSpan) {
374 // TODO: we need to take heightGap into effect
375 return vSpan * mCellHeight;
Winson Chung80baf5a2010-08-09 16:03:15 -0700376 }
377
Winson Chung321e9ee2010-08-09 13:37:56 -0700378 @Override
379 public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attrs) {
380 return new PagedViewCellLayout.LayoutParams(getContext(), attrs);
381 }
382
383 @Override
384 protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {
385 return p instanceof PagedViewCellLayout.LayoutParams;
386 }
387
388 @Override
389 protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p) {
390 return new PagedViewCellLayout.LayoutParams(p);
391 }
392
393 public static class LayoutParams extends ViewGroup.MarginLayoutParams {
394 /**
395 * Horizontal location of the item in the grid.
396 */
397 @ViewDebug.ExportedProperty
398 public int cellX;
399
400 /**
401 * Vertical location of the item in the grid.
402 */
403 @ViewDebug.ExportedProperty
404 public int cellY;
405
406 /**
407 * Number of cells spanned horizontally by the item.
408 */
409 @ViewDebug.ExportedProperty
410 public int cellHSpan;
411
412 /**
413 * Number of cells spanned vertically by the item.
414 */
415 @ViewDebug.ExportedProperty
416 public int cellVSpan;
417
418 /**
419 * Is this item currently being dragged
420 */
421 public boolean isDragging;
422
Winson Chung80baf5a2010-08-09 16:03:15 -0700423 // a data object that you can bind to this layout params
424 private Object mTag;
425
Winson Chung321e9ee2010-08-09 13:37:56 -0700426 // X coordinate of the view in the layout.
427 @ViewDebug.ExportedProperty
428 int x;
429 // Y coordinate of the view in the layout.
430 @ViewDebug.ExportedProperty
431 int y;
432
Winson Chung80baf5a2010-08-09 16:03:15 -0700433 public LayoutParams() {
434 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
435 cellHSpan = 1;
436 cellVSpan = 1;
437 }
438
Winson Chung321e9ee2010-08-09 13:37:56 -0700439 public LayoutParams(Context c, AttributeSet attrs) {
440 super(c, attrs);
441 cellHSpan = 1;
442 cellVSpan = 1;
443 }
444
445 public LayoutParams(ViewGroup.LayoutParams source) {
446 super(source);
447 cellHSpan = 1;
448 cellVSpan = 1;
449 }
450
451 public LayoutParams(LayoutParams source) {
452 super(source);
453 this.cellX = source.cellX;
454 this.cellY = source.cellY;
455 this.cellHSpan = source.cellHSpan;
456 this.cellVSpan = source.cellVSpan;
457 }
458
459 public LayoutParams(int cellX, int cellY, int cellHSpan, int cellVSpan) {
460 super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
461 this.cellX = cellX;
462 this.cellY = cellY;
463 this.cellHSpan = cellHSpan;
464 this.cellVSpan = cellVSpan;
465 }
466
467 public void setup(int cellWidth, int cellHeight, int widthGap, int heightGap,
468 int hStartPadding, int vStartPadding) {
469
470 final int myCellHSpan = cellHSpan;
471 final int myCellVSpan = cellVSpan;
472 final int myCellX = cellX;
473 final int myCellY = cellY;
474
475 width = myCellHSpan * cellWidth + ((myCellHSpan - 1) * widthGap) -
476 leftMargin - rightMargin;
477 height = myCellVSpan * cellHeight + ((myCellVSpan - 1) * heightGap) -
478 topMargin - bottomMargin;
479
Michael Jurkaa2eb1702011-05-12 14:57:05 -0700480 if (LauncherApplication.isScreenLarge()) {
Winson Chung785d2eb2011-04-14 16:08:02 -0700481 x = hStartPadding + myCellX * (cellWidth + widthGap) + leftMargin;
482 y = vStartPadding + myCellY * (cellHeight + heightGap) + topMargin;
483 } else {
484 x = myCellX * (cellWidth + widthGap) + leftMargin;
485 y = myCellY * (cellHeight + heightGap) + topMargin;
486 }
Winson Chung321e9ee2010-08-09 13:37:56 -0700487 }
488
Winson Chung80baf5a2010-08-09 16:03:15 -0700489 public Object getTag() {
490 return mTag;
491 }
492
493 public void setTag(Object tag) {
494 mTag = tag;
495 }
496
Winson Chung321e9ee2010-08-09 13:37:56 -0700497 public String toString() {
Winson Chung80baf5a2010-08-09 16:03:15 -0700498 return "(" + this.cellX + ", " + this.cellY + ", " +
499 this.cellHSpan + ", " + this.cellVSpan + ")";
Winson Chung321e9ee2010-08-09 13:37:56 -0700500 }
501 }
502}
Michael Jurka8245a862011-02-01 17:53:59 -0800503
504interface Page {
505 public int getPageChildCount();
506 public View getChildOnPageAt(int i);
507 public void removeAllViewsOnPage();
508 public void removeViewOnPageAt(int i);
509 public int indexOfChildOnPage(View v);
510}