Home | History | Annotate | Download | only in widget

Lines Matching full:view

35 import android.view.FocusFinder;
36 import android.view.KeyEvent;
37 import android.view.MotionEvent;
38 import android.view.SoundEffectConstants;
39 import android.view.View;
40 import android.view.ViewDebug;
41 import android.view.ViewGroup;
42 import android.view.ViewParent;
43 import android.view.accessibility.AccessibilityEvent;
58 * A view that shows items in a vertically scrolling list. The items
59 * come from the {@link ListAdapter} associated with this view.
103 * A class that represents a fixed view in a list, for example a header at the top
107 /** The view to add to the list */
108 public View view;
109 /** The data backing the view. This is returned from {@link ListAdapter#getItem(int)}. */
111 /** <code>true</code> if the fixed view should be selectable in the list */
141 // the single allocated result per list view; kinda cheesey but avoids
191 * @return The maximum amount a list view will scroll in response to
207 View child;
246 * Add a fixed view to appear at the top of the list. If addHeaderView is
254 * @param v The view to add.
255 * @param data Data to associate with this view
258 public void addHeaderView(View v, Object data, boolean isSelectable) {
262 "Cannot add header view to list -- setAdapter has already been called.");
266 info.view = v;
273 * Add a fixed view to appear at the top of the list. If addHeaderView is
281 * @param v The view to add.
283 public void addHeaderView(View v) {
293 * Removes a previously-added header view.
295 * @param v The view to remove
296 * @return true if the view was removed, false if the view was not a header
297 * view
299 public boolean removeHeaderView(View v) {
312 private void removeFixedViewInfo(View v, ArrayList<FixedViewInfo> where) {
316 if (info.view == v) {
324 * Add a fixed view to appear at the bottom of the list. If addFooterView is
332 * @param v The view to add.
333 * @param data Data to associate with this view
334 * @param isSelectable true if the footer view can be selected
336 public void addFooterView(View v, Object data, boolean isSelectable) {
338 info.view = v;
343 // in the case of re-adding a footer view, or adding one later on,
351 * Add a fixed view to appear at the bottom of the list. If addFooterView is called more
358 * @param v The view to add.
360 public void addFooterView(View v) {
370 * Removes a previously-added footer view.
372 * @param v The view to remove
374 * true if the view was removed, false if the view was not a footer view
376 public boolean removeFooterView(View v) {
411 * data backing this list and for producing a view to represent an
503 final View child = infos.get(i).view;
536 public boolean requestChildRectangleOnScreen(View child, Rect rect, boolean immediate) {
540 // offset so rect is in coordinates of the this view
570 // need to MOVE DOWN to get it in view: move down just enough so
571 // that the entire rectangle is in view (or at least the first
586 // need to MOVE UP to get it in view: move up just enough so that
587 // entire rectangle is in view (or at least the first screen
634 * Fills the list from pos down to the end of the list view.
641 * @return The view that is currently selected, if it happens to be in the
644 private View fillDown(int pos, int nextTop) {
645 View selectedView = null;
652 View child = makeAndAddView(pos, nextTop, true, mListPadding.left, selected);
665 * Fills the list from pos up to the top of the list view.
672 * @return The view that is currently selected
674 private View fillUp(int pos, int nextBottom) {
675 View selectedView = null;
682 View child = makeAndAddView(pos, nextBottom, false, mListPadding.left, selected);
701 * @return The view that is currently selected
703 private View fillFromTop(int nextTop) {
721 * @return Currently selected view
723 private View fillFromMiddle(int childrenTop, int childrenBottom) {
728 View sel = makeAndAddView(position, childrenTop, true,
749 * Once the selected view as been placed, fill up the visible area above and
752 * @param sel The selected view
755 private void fillAboveAndBelow(View sel, int position) {
777 * @return The view that currently has selection
779 private View fillFromSelection(int selectedTop, int childrenTop, int childrenBottom) {
783 View sel;
800 // fully into view
804 // Now offset the selected item to get it into view
808 // into view
816 // Offset the selected item to get it into view
875 * @param oldSel The old selected view. Useful for trying to put the new
877 * @param newSel The view that is to become selected. Useful for trying to
882 * @return The view that currently has selection
884 private View moveSelection(View oldSel, View newSel, int delta, int childrenTop,
889 View sel;
933 // Find space required to bring the bottom of the selected item fully into view
943 // Now offset the selected item to get it into view
983 // If (A) was not on screen and so did not have a view, position
991 // Find space required to bring the top of the selected item fully into view
1002 // Offset the selected item to get it into view
1053 View focusedChild = getFocusedChild();
1084 final View child = obtainView(0, mIsScrap);
1116 private void measureScrapChild(View child, int position, int widthMeasureSpec) {
1155 * {@link View#measure(int, int)}.
1189 View child;
1207 // Recycle the view before we possibly return from the method
1242 View v = getChildAt(i);
1249 View v = getChildAt(i);
1263 * @param position The reference view to use as the starting point
1264 * @param top Pixel offset from the top of this view to the top of the
1265 * reference view.
1267 * @return The selected view, or null if the selected view is outside the
1270 private View fillSpecific(int position, int top) {
1272 View temp = makeAndAddView(position, top, true, mListPadding.left, tempIsSelected);
1276 View above;
1277 View below;
1282 // This will correct for the top of the first view not touching the top of the list
1291 // This will correct for the bottom of the last view not touching the bottom of the list
1323 final View lastChild = getChildAt(childCount - 1);
1331 // This is how far the bottom edge of the last view is from the bottom of the
1334 View firstChild = getChildAt(0);
1371 final View firstChild = getChildAt(0);
1382 // This is how far the top edge of the first view is from the top of the
1385 View lastChild = getChildAt(childCount - 1);
1440 View sel;
1441 View oldSel = null;
1442 View oldFirst = null;
1443 View newSel = null;
1445 View focusLayoutRestoreView = null;
1462 // Remember the previously selected view
1507 View focusLayoutRestoreDirectChild = null;
1528 final View focusedChild = getFocusedChild();
1532 // we can remember the focused view to restore after relayout if the
1536 // remember the specific view that had focus
1611 // to make sure something else outside of the selected view
1613 final View focused = getFocusedChild();
1628 View child = getChildAt(mMotionPosition - mFirstPosition);
1642 // tell focus view we are done mucking with it, if it is still in
1643 // our view hierarchy.
1670 * @return Whether child is a header or footer view.
1672 private boolean isDirectChildHeaderOrFooter(View child) {
1677 if (child == headers.get(i).view) {
1684 if (child == footers.get(i).view) {
1692 * Obtain the view and add it to our list of children. The view can be made
1693 * fresh, converted from an unused view, or used as is if it was in the
1697 * @param y Top or bottom edge of the view to add
1702 * @return View that was added
1704 private View makeAndAddView(int position, int y, boolean flow, int childrenLeft,
1706 View child;
1710 // Try to use an exsiting view for this position
1726 // Make a new view for this position, or convert an unused view if possible
1736 * Add a view as a child and make sure it is measured (if necessary) and
1739 view to add
1741 * @param y The y position relative to which this view will be positioned
1746 * @param recycled Has this view been pulled from the recycle bin? If so it
1749 private void setupChild(View child, int position, int y, boolean flowDown, int childrenLeft,
1759 // Respect layout params that are already in the view. Otherwise make some up...
2006 View focused = getFocusedChild();
2080 handled = handleHorizontalFocusWithinListItem(View.FOCUS_LEFT);
2083 handled = handleHorizontalFocusWithinListItem(View.FOCUS_RIGHT);
2133 * @param direction either {@link View#FOCUS_UP} or {@link View#FOCUS_DOWN}
2178 * @param direction either {@link View#FOCUS_UP} or {@link View#FOCUS_DOWN}
2218 * @param direction one of {View.FOCUS_LEFT, View.FOCUS_RIGHT}
2222 if (direction != View.FOCUS_LEFT && direction != View.FOCUS_RIGHT) {
2224 + " {View.FOCUS_LEFT, View.FOCUS_RIGHT}");
2229 final View selectedView = getSelectedView();
2233 final View currentFocus = selectedView.findFocus();
2234 final View nextFocus = FocusFinder.getInstance().findNextFocus(
2246 // if the global result is going to be some other view within this
2249 final View globalNextFocus = FocusFinder.getInstance().findNextFocus(
2262 * @param direction either {@link View#FOCUS_UP} or {@link View#FOCUS_DOWN}
2283 * @param direction Either {@link android.view.View#FOCUS_UP} or {@link android.view.View#FOCUS_DOWN}.
2291 View selectedView = getSelectedView();
2310 // there was no new view found to take focus, make sure we
2312 final View focused = getFocusedChild();
2322 scrollListItemsBy((direction == View.FOCUS_UP) ? amountToScroll : -amountToScroll);
2330 final View focused = selectedView.findFocus();
2367 * @param selectedView The currently selected view (before changing selection).
2369 * @param direction Either {@link android.view.View#FOCUS_UP} or
2370 * {@link android.view.View#FOCUS_DOWN}.
2375 private void handleNewSelectionChange(View selectedView, int direction, int newSelectedPosition,
2382 // top of whatever view is on top:
2383 // - moving down: the view that had selection
2384 // - moving up: the view that is getting selection
2385 View topView;
2386 View bottomView;
2391 if (direction == View.FOCUS_UP) {
2406 // start with top view: is it changing size?
2412 // is the bottom view changing size?
2423 * @param childIndex The view group index of the child.
2424 * @param numChildren The number of children in the view group.
2426 private void measureAndAdjustDown(View child, int childIndex, int numChildren) {
2430 // lay out the view, preserving its top
2446 private void measureItem(View child) {
2471 private void relayoutMeasuredItem(View child) {
2489 * Determine how much we need to scroll in order to get the next selected view
2493 * @param direction either {@link android.view.View#FOCUS_UP} or
2494 * {@link android.view.View#FOCUS_DOWN}.
2506 if (direction == View.FOCUS_DOWN) {
2513 final View viewToMakeVisible = getChildAt(indexToMakeVisible);
2546 final View viewToMakeVisible = getChildAt(indexToMakeVisible);
2597 * @param direction either {@link android.view.View#FOCUS_UP} or
2598 * {@link android.view.View#FOCUS_DOWN}.
2602 * selectable view on screen in the given direction.
2606 if (direction == View.FOCUS_DOWN) {
2621 && getChildAt(pos - firstPosition).getVisibility() == View.VISIBLE) {
2640 && getChildAt(pos - firstPosition).getVisibility() == View.VISIBLE) {
2649 * Do an arrow scroll based on focus searching. If a new view is
2653 * @param direction either {@link android.view.View#FOCUS_UP} or
2654 * {@link android.view.View#FOCUS_DOWN}.
2658 final View selectedView = getSelectedView();
2659 View newFocus;
2661 View oldFocus = selectedView.findFocus();
2664 if (direction == View.FOCUS_DOWN) {
2695 ((direction == View.FOCUS_DOWN && selectablePosition < positionOfNewFocus) ||
2696 (direction == View.FOCUS_UP && selectablePosition > positionOfNewFocus))) {
2705 // not moving too far, safe to give next view focus
2712 // max scroll amount, we are getting it at least partially in view,
2723 * @param newFocus The view that would have focus.
2726 private int positionOfNewFocus(View newFocus) {
2729 final View child = getChildAt(i);
2741 private boolean isViewAncestorOf(View child, View parent) {
2747 return (theParent instanceof ViewGroup) && isViewAncestorOf((View) theParent, parent);
2751 * Determine how much we need to scroll in order to get newFocus in view.
2752 * @param direction either {@link android.view.View#FOCUS_UP} or
2753 * {@link android.view.View#FOCUS_DOWN}.
2754 * @param newFocus The view that would take focus.
2759 private int amountToScrollToNewFocus(int direction, View newFocus, int positionOfNewFocus) {
2763 if (direction == View.FOCUS_UP) {
2783 * Determine the distance to the nearest edge of a view in a particular
2789 private int distanceToView(View descendant) {
2804 * Scroll the children by amount, adding a view at the end and removing
2821 View last = getChildAt(numChildren - 1);
2840 View first = getChildAt(0);
2854 View first = getChildAt(0);
2869 View last = getChildAt(lastIndex);
2871 // bottom view may be panned off screen
2885 private View addViewAbove(View theView, int position) {
2887 View view = obtainView(abovePosition, mIsScrap);
2889 setupChild(view, abovePosition, edgeOfNewChild, false, mListPadding.left,
2891 return view;
2894 private View addViewBelow(View theView, int position) {
2896 View view = obtainView(belowPosition, mIsScrap);
2898 setupChild(view, belowPosition, edgeOfNewChild, true, mListPadding.left,
2900 return view;
2987 View child = getChildAt(i);
3014 View child = getChildAt(i);
3054 * @param childIndex The index of child (of the View) above the divider.
3129 * @see #addHeaderView(android.view.View)
3142 * @see #addFooterView(android.view.View)
3178 View other = getChildAt(i);
3218 * @see android.view.View#findViewById(int)
3222 protected View findViewTraversal(int id) {
3223 View v;
3240 * Look in the passed in list of headers or footers for the view.
3242 View findViewInHeadersOrFooters(ArrayList<FixedViewInfo> where, int id) {
3245 View v;
3248 v = where.get(i).view;
3263 * @see android.view.View#findViewWithTag(String)
3267 protected View findViewWithTagTraversal(Object tag) {
3268 View v;
3286 * Look in the passed in list of headers or footers for the view with the tag.
3288 View findViewTagInHeadersOrFooters(ArrayList<FixedViewInfo> where, Object tag) {
3291 View v;
3294 v = where.get(i).view;
3349 public boolean performItemClick(View view, int position, long id) {
3382 handled |= super.performItemClick(view, position, id);