/frameworks/base/core/tests/coretests/src/android/widget/listview/arrowscroll/ |
D | ListOfItemsTallerThanScreenTest.java | 30 private ListView mListView; field in ListOfItemsTallerThanScreenTest 37 mListView = getActivity().getListView(); in setUp() 46 assertNotNull(mListView); in testPreconditions() 47 assertEquals("should only be one visible child", 1, mListView.getChildCount()); in testPreconditions() 48 …final int amountOffScreen = mListView.getChildAt(0).getBottom() - (mListView.getBottom() - mListVi… in testPreconditions() 50 amountOffScreen > mListView.getMaxScrollAmount()); in testPreconditions() 55 final View view = mListView.getSelectedView(); in testScrollDownAcrossItem() 58 assertEquals(mListView.getListPaddingTop(), in testScrollDownAcrossItem() 62 view.getBottom() > mListView.getBottom()); in testScrollDownAcrossItem() 69 mListView.getListPaddingTop() - mListView.getMaxScrollAmount() * i, in testScrollDownAcrossItem() [all …]
|
D | ListOfItemsShorterThanScreenTest.java | 30 private ListView mListView; field in ListOfItemsShorterThanScreenTest 41 mListView = getActivity().getListView(); in setUp() 46 assertEquals(0, mListView.getSelectedItemPosition()); in testPreconditions() 47 assertTrue(mListView.getChildAt(0).isSelected()); in testPreconditions() 48 assertEquals(mListView.getListPaddingTop(), mListView.getSelectedView().getTop()); in testPreconditions() 53 final View next = mListView.getChildAt(1); in testMoveDownToOnScreenNextItem() 55 final int secondPosition = mListView.getSelectedView().getBottom(); in testMoveDownToOnScreenNextItem() 61 assertEquals(1, mListView.getSelectedItemPosition()); in testMoveDownToOnScreenNextItem() 73 assertEquals(0, mListView.getSelectedItemPosition()); in testMoveUpToOnScreenItem() 79 final int lastOnScreenItemIndex = mListView.getChildCount() - 1; in testMoveDownToItemRequiringScrolling() [all …]
|
D | ListWithOffScreenNextSelectableTest.java | 31 private ListView mListView; field in ListWithOffScreenNextSelectableTest 41 mListView = getActivity().getListView(); in setUp() 46 assertNotNull(mListView); in testPreconditions() 47 assertEquals(5, mListView.getAdapter().getCount()); in testPreconditions() 48 assertFalse(mListView.getAdapter().areAllItemsEnabled()); in testPreconditions() 49 assertFalse(mListView.getAdapter().isEnabled(1)); in testPreconditions() 50 assertFalse(mListView.getAdapter().isEnabled(2)); in testPreconditions() 51 assertFalse(mListView.getAdapter().isEnabled(3)); in testPreconditions() 54 4, mListView.getChildCount()); in testPreconditions() 55 assertEquals(0, mListView.getSelectedItemPosition()); in testPreconditions() [all …]
|
D | ListOfThinItemsTest.java | 29 private ListView mListView; field in ListOfThinItemsTest 38 mListView = getActivity().getListView(); in setUp() 44 assertNotNull(mListView); in testPreconditions() 46 mListView.getSelectedView().getHeight() < mListView.getVerticalFadingEdgeLength()); in testPreconditions() 48 mListView.getChildCount() < mListView.getAdapter().getCount()); in testPreconditions() 53 final int numItems = mListView.getAdapter().getCount(); in testScrollToBottom() 54 final int listBottom = mListView.getHeight() - mListView.getListPaddingBottom(); in testScrollToBottom() 57 i, mListView.getSelectedItemPosition()); in testScrollToBottom() 58 final int bottomFadingEdge = listBottom - mListView.getVerticalFadingEdgeLength(); in testScrollToBottom() 59 final View lastChild = mListView.getChildAt(mListView.getChildCount() - 1); in testScrollToBottom() [all …]
|
D | ListOfShortShortTallShortShortTest.java | 28 private ListView mListView; field in ListOfShortShortTallShortShortTest 38 mListView = getActivity().getListView(); in setUp() 39 mListUtil = new ListUtil(mListView, getInstrumentation()); in setUp() 45 assertEquals("list item count", 5, mListView.getCount()); in testPreconditions() 46 assertEquals("list visible child count", 3, mListView.getChildCount()); in testPreconditions() 47 … int firstTwoHeight = mListView.getChildAt(0).getHeight() + mListView.getChildAt(1).getHeight(); in testPreconditions() 49 firstTwoHeight <= mListView.getVerticalFadingEdgeLength()); in testPreconditions() 51 firstTwoHeight <= mListView.getMaxScrollAmount()); in testPreconditions() 63 assertEquals("selected item position", 2, mListView.getSelectedItemPosition()); in testFadeTopTwoItemsOut() 65 mListView.getSelectedView().getTop() < mListUtil.getListTop()); in testFadeTopTwoItemsOut() [all …]
|
D | ListItemsExpandOnSelectionTest.java | 28 private ListView mListView; field in ListItemsExpandOnSelectionTest 42 mListView = getActivity().getListView(); in setUp() 43 mListTop = mListView.getListPaddingTop(); in setUp() 44 mListBottom = mListView.getHeight() - mListView.getListPaddingBottom(); in setUp() 45 mExpandedHeight = mListView.getChildAt(0).getHeight(); in setUp() 46 mNormalHeight = mListView.getChildAt(1).getHeight(); in setUp() 51 assertEquals(0, mListView.getSelectedItemPosition()); in testPreconditions() 61 assertEquals(1, mListView.getSelectedItemPosition()); in testMoveSelectionDownNotRequiringScroll() 63 mListTop, mListView.getChildAt(0).getTop()); in testMoveSelectionDownNotRequiringScroll() 71 assertEquals(1, mListView.getSelectedItemPosition()); in testMoveSelectionUpNotRequiringScroll() [all …]
|
D | ListWithScreenOfNoSelectablesTest.java | 29 private ListView mListView; field in ListWithScreenOfNoSelectablesTest 38 mListView = getActivity().getListView(); in setUp() 44 mListView.getAdapter().isEnabled(0)); in testPreconditions() 45 final int numItems = mListView.getCount(); in testPreconditions() 48 mListView.getAdapter().isEnabled(i)); in testPreconditions() 51 mListView.getChildCount() < mListView.getCount()); in testPreconditions() 59 View first = mListView.getChildAt(0); in testGoFromSelectedViewExistsToNoSelectedViewExists() 65 … assertEquals("selected position", ListView.INVALID_POSITION, mListView.getSelectedItemPosition()); in testGoFromSelectedViewExistsToNoSelectedViewExists() 66 assertNull("selected view", mListView.getSelectedView()); in testGoFromSelectedViewExistsToNoSelectedViewExists() 71 final int lastPosition = mListView.getCount() - 1; in testPanDownAcrossUnselectableChildrenToBottom() [all …]
|
D | ListItemFocusablesCloseTest.java | 27 private ListView mListView; field in ListItemFocusablesCloseTest 38 mListView = getActivity().getListView(); in setUp() 39 mListTop = mListView.getListPaddingTop(); in setUp() 40 mListBottom = mListView.getHeight() - mListView.getListPaddingBottom(); in setUp() 45 assertNotNull(mListView); in testPreconditions() 46 assertTrue(mListView.getAdapter().areAllItemsEnabled()); in testPreconditions() 47 assertTrue(mListView.getItemsCanFocus()); in testPreconditions() 48 assertEquals(0, mListView.getSelectedItemPosition()); in testPreconditions() 49 final LinearLayout first = (LinearLayout) mListView.getSelectedView(); in testPreconditions() 52 mListView.getListPaddingTop(), in testPreconditions() [all …]
|
D | ListOfShortTallShortTest.java | 26 private ListView mListView; field in ListOfShortTallShortTest 36 mListView = getActivity().getListView(); in setUp() 42 mListView.getChildAt(1).getHeight() > mListView.getHeight()); in testPreconditions() 47 int topBeforeMove = mListView.getChildAt(1).getTop(); in testGoDownFromShortToTall() 51 1, mListView.getSelectedItemPosition()); in testGoDownFromShortToTall() 54 mListView.getSelectedView().getTop()); in testGoDownFromShortToTall() 60 while (mListView.getSelectedItemPosition() != 2 && maxMoves > 0) { in testGoUpFromShortToTall() 65 mListView.getSelectedItemPosition()); in testGoUpFromShortToTall() 68 2, mListView.getChildCount()); in testGoUpFromShortToTall() 70 mListView.getChildAt(1), mListView.getSelectedView()); in testGoUpFromShortToTall() [all …]
|
D | ListLastItemPartiallyVisibleTest.java | 27 private ListView mListView; field in ListLastItemPartiallyVisibleTest 38 mListView = getActivity().getListView(); in setUp() 39 mListBottom = mListView.getHeight() - mListView.getPaddingBottom(); in setUp() 45 "in adapter", mListView.getCount(), mListView.getChildCount()); in testPreconditions() 47 final View lastChild = mListView.getChildAt(mListView.getChildCount() - 1); in testPreconditions() 50 assertEquals("selected position", 0, mListView.getSelectedItemPosition()); in testPreconditions() 56 final View firstChild = mListView.getChildAt(0); in testMovingDownToFullyVisibleNoScroll() 66 int numMovesToLast = mListView.getCount() - 1; in testMovingUpToFullyVisibleNoScroll() 71 mListView.getChildCount() - 1, mListView.getSelectedItemPosition()); in testMovingUpToFullyVisibleNoScroll() 73 final View lastChild = mListView.getSelectedView(); in testMovingUpToFullyVisibleNoScroll()
|
D | ListWithNoFadingEdgeTest.java | 29 private ListView mListView; field in ListWithNoFadingEdgeTest 39 mListView = getActivity().getListView(); in setUp() 44 assertNotNull(mListView); in testPreconditions() 45 assertEquals("listview vertical fading edge", 0, mListView.getVerticalFadingEdgeLength()); in testPreconditions() 47 mListView.getChildCount() < mListView.getCount()); in testPreconditions() 52 final int numItems = mListView.getCount(); in testScrollDownToBottom() 55 assertEquals("selected position", i, mListView.getSelectedItemPosition()); in testScrollDownToBottom() 58 … assertEquals("selected position", numItems - 1, mListView.getSelectedItemPosition()); in testScrollDownToBottom() 63 final int numItems = mListView.getCount(); in testScrollFromBottomToTop() 67 mListView.setSelection(numItems - 1); in testScrollFromBottomToTop() [all …]
|
D | ListItemFocusablesFarApartTest.java | 29 private ListView mListView; field in ListItemFocusablesFarApartTest 40 mListView = getActivity().getListView(); in setUp() 41 mListTop = mListView.getListPaddingTop(); in setUp() 42 mListBottom = mListView.getHeight() - mListView.getListPaddingBottom(); in setUp() 51 return ((ViewGroup) mListView.getChildAt(listIndex)).getChildAt(index); in getChildOfItem() 56 ViewGroup listItem = (ViewGroup) mListView.getChildAt(listIndex); in getTopOfChildOfItem() 62 ViewGroup listItem = (ViewGroup) mListView.getChildAt(listIndex); in getBottomOfChildOfItem() 69 assertNotNull(mListView); in testPreconditions() 71 1, mListView.getChildCount()); in testPreconditions() 75 topOfSecondButton - topOfFirstButton > mListView.getMaxScrollAmount()); in testPreconditions() [all …]
|
D | ListWithSeparatorsTest.java | 27 private ListView mListView; field in ListWithSeparatorsTest 38 mListView = getActivity().getListView(); in setUp() 44 assertNotNull(mListView); in testPreconditions() 45 assertFalse(mListView.getAdapter().areAllItemsEnabled()); in testPreconditions() 46 assertFalse(mListView.getAdapter().isEnabled(0)); in testPreconditions() 47 assertFalse(mListView.getAdapter().isEnabled(2)); in testPreconditions() 48 assertEquals(1, mListView.getSelectedItemPosition()); in testPreconditions() 55 1, mListView.getSelectedItemPosition()); in testGoingUpDoesnNotHitUnselectableItem() 58 mListView.getListPaddingTop(), mListView.getChildAt(0).getTop()); in testGoingUpDoesnNotHitUnselectableItem() 66 mListView.getSelectedItemPosition()); in testGoingDownSkipsOverUnselectable() [all …]
|
D | ListInterleaveFocusablesTest.java | 28 private ListView mListView; field in ListInterleaveFocusablesTest 39 mListView = getActivity().getListView(); in setUp() 40 mListUtil = new ListUtil(mListView, getInstrumentation()); in setUp() 45 assertEquals(7, mListView.getChildCount()); in testPreconditions() 46 assertTrue(mListView.getChildAt(1).isFocusable()); in testPreconditions() 47 assertTrue(mListView.getChildAt(3).isFocusable()); in testPreconditions() 48 assertTrue(mListView.getChildAt(6).isFocusable()); in testPreconditions() 55 assertEquals("selected item position", 1, mListView.getSelectedItemPosition()); in testGoingFromUnFocusableSelectedToFocusable() 66 assertEquals("selected item position", 3, mListView.getSelectedItemPosition()); in testGoingDownFromUnFocusableSelectedToFocusableWithOtherFocusableAbove() 75 assertEquals("selected item position", 1, mListView.getSelectedItemPosition()); in testGoingUpFromUnFocusableSelectedToFocusableWithOtherFocusableAbove() [all …]
|
/frameworks/base/core/tests/coretests/src/android/widget/listview/ |
D | ListFocusableTest.java | 27 private ListView mListView; field in ListFocusableTest 38 mListView = getActivity().getListView(); in setUp() 44 assertNotNull(mListView); in testPreconditions() 47 assertEquals(0, mListView.getSelectedItemPosition()); in testPreconditions() 53 assertTrue(mListView.isFocusable()); in testAdapterFull() 59 assertFalse(mListView.isFocusable()); in testAdapterEmpty() 65 assertFalse(mListView.isFocusable()); in testAdapterNull() 70 assertTrue(mListView.isFocusable()); in testAdapterFullSetFocusable() 73 assertTrue(mListView.isFocusable()); in testAdapterFullSetFocusable() 78 assertTrue(mListView.isFocusable()); in testAdapterFullSetNonFocusable() [all …]
|
D | ListGetCheckItemIdsTest.java | 30 private ListView mListView; field in ListGetCheckItemIdsTest 40 mListView = getActivity().getListView(); in setUp() 45 long[] checkItemIds = mListView.getCheckItemIds(); in assertChecked() 60 mListView.setChoiceMode(ListView.CHOICE_MODE_NONE); in testNoneCheck() 62 mListView.setItemChecked(0, true); in testNoneCheck() 69 mListView.setChoiceMode(ListView.CHOICE_MODE_SINGLE); in testSimpleCheck() 73 int childCount = mListView.getChildCount(); in testSimpleCheck() 75 mListView.setItemChecked(i, true); in testSimpleCheck() 81 mListView.setItemChecked(i, true); in testSimpleCheck() 82 mListView.setItemChecked((i - 3 + childCount) % childCount, false); in testSimpleCheck() [all …]
|
D | ListItemRequestRectAboveThinFirstItemTest.java | 31 private ListView mListView; field in ListItemRequestRectAboveThinFirstItemTest 39 mListView = getActivity().getListView(); in setUp() 47 mListView.getChildAt(0).getBottom() < mListView.getVerticalFadingEdgeLength()); in testPreconditions() 49 mListView.getChildCount() >= 2); in testPreconditions() 59 assertEquals("selected position", 1, mListView.getSelectedItemPosition()); in testSecondItemRequestRectAboveTop() 61 final View second = mListView.getChildAt(1); in testSecondItemRequestRectAboveTop() 70 mListView.getListPaddingTop(), mListView.getChildAt(0).getTop()); in testSecondItemRequestRectAboveTop() 78 final int secondToLastPos = mListView.getCount() - 2; in testSecondToLastItemRequestRectBelowBottom() 80 while (mListView.getSelectedItemPosition() < secondToLastPos) { in testSecondToLastItemRequestRectBelowBottom() 84 mListView.getSelectedItemPosition()); in testSecondToLastItemRequestRectBelowBottom() [all …]
|
/frameworks/base/core/tests/coretests/src/android/widget/listview/touch/ |
D | ListTouchBottomGravityManyTest.java | 36 private ListView mListView; field in ListTouchBottomGravityManyTest 47 mListView = getActivity().getListView(); in setUp() 53 assertNotNull(mListView); in testPreconditions() 56 assertEquals(mListView.getAdapter().getCount() - 1, mListView.getSelectedItemPosition()); in testPreconditions() 61 int originalCount = mListView.getChildCount(); in testPullDown() 63 TouchUtils.scrollToTop(this, mListView); in testPullDown() 67 mListView.getSelectedItemPosition()); in testPullDown() 69 View firstChild = mListView.getChildAt(0); in testPullDown() 73 assertEquals("Item zero not at the top of the list", mListView.getListPaddingTop(), in testPullDown() 77 mListView.getChildCount(), originalCount + 1), in testPullDown() [all …]
|
D | ListTouchManyTest.java | 35 private ListView mListView; field in ListTouchManyTest 46 mListView = getActivity().getListView(); in setUp() 52 assertNotNull(mListView); in testPreconditions() 55 assertEquals(0, mListView.getSelectedItemPosition()); in testPreconditions() 60 TouchUtils.scrollToTop(this, mListView); in testPullDown() 64 mListView.getSelectedItemPosition()); in testPullDown() 66 View firstChild = mListView.getChildAt(0); in testPullDown() 70 assertEquals("Item zero not at the top of the list", mListView.getListPaddingTop(), in testPullDown() 76 int originalCount = mListView.getChildCount(); in testPushUp() 78 TouchUtils.scrollToBottom(this, mListView); in testPushUp() [all …]
|
D | ListTouchBottomGravityTest.java | 33 private ListView mListView; field in ListTouchBottomGravityTest 44 mListView = getActivity().getListView(); in setUp() 50 assertNotNull(mListView); in testPreconditions() 53 assertEquals(mListView.getAdapter().getCount() - 1, mListView.getSelectedItemPosition()); in testPreconditions() 58 View firstChild = mListView.getChildAt(0); in testPullDown() 62 View lastChild = mListView.getChildAt(mListView.getChildCount() - 1); in testPullDown() 66 mListView.getSelectedItemPosition()); in testPullDown() 68 assertEquals("List is not scrolled to the bottom", mListView.getAdapter().getCount() - 1, in testPullDown() 72 mListView.getHeight() - mListView.getListPaddingBottom(), lastChild.getBottom()); in testPullDown() 77 View lastChild = mListView.getChildAt(mListView.getChildCount() - 1); in testPushUp() [all …]
|
D | ListSetSelectionTest.java | 35 private ListView mListView; field in ListSetSelectionTest 46 mListView = getActivity().getListView(); in setUp() 52 assertNotNull(mListView); in testPreconditions() 62 mListView.getSelectedItemPosition()); in testSetSelection() 64 final int targetPosition = mListView.getAdapter().getCount() / 2; in testSetSelection() 68 mListView.setSelection(targetPosition); in testSetSelection() 74 int childCount = mListView.getChildCount(); in testSetSelection() 76 View child = mListView.getChildAt(i); in testSetSelection() 92 mListView.getSelectedItemPosition()); in testSetSelectionFromTop() 94 final int targetPosition = mListView.getAdapter().getCount() / 2; in testSetSelectionFromTop() [all …]
|
D | ListTouchTest.java | 32 private ListView mListView; field in ListTouchTest 43 mListView = getActivity().getListView(); in setUp() 49 assertNotNull(mListView); in testPreconditions() 52 assertEquals(0, mListView.getSelectedItemPosition()); in testPreconditions() 57 View firstChild = mListView.getChildAt(0); in testPullDown() 63 mListView.getSelectedItemPosition()); in testPullDown() 65 firstChild = mListView.getChildAt(0); in testPullDown() 69 assertEquals("Item zero not at the top of the list", mListView.getListPaddingTop(), in testPullDown() 75 View lastChild = mListView.getChildAt(mListView.getChildCount() - 1); in testPushUp() 81 mListView.getSelectedItemPosition()); in testPushUp() [all …]
|
/frameworks/base/core/tests/coretests/src/android/widget/focus/ |
D | ScrollingThroughListOfFocusablesTest.java | 37 private ListView mListView; field in ScrollingThroughListOfFocusablesTest 52 mListView = mActivity.getListView(); in setUp() 54 mListView.setVerticalFadingEdgeEnabled(true); in setUp() 55 mListView.setFadingEdgeLength(10); in setUp() 68 assertNotNull(mListView); in testPreconditions() 77 assertEquals(0, mListView.getSelectedItemPosition()); in testScrollingDownInFirstItem() 91 assertEquals(0, mListView.getSelectedItemPosition()); in testScrollingDownInFirstItem() 93 mListView.getSelectedView(); in testScrollingDownInFirstItem() 97 mListView.getBottom() - mListView.getVerticalFadingEdgeLength(); in testScrollingDownInFirstItem() 105 2, mListView.getChildCount()); in testScrollingDownInFirstItem() [all …]
|
/frameworks/base/core/tests/coretests/src/android/widget/listview/focus/ |
D | ListWithEditTextHeaderTest.java | 32 private ListView mListView; field in ListWithEditTextHeaderTest 41 mListView = getActivity().getListView(); in setUp() 46 assertTrue("listview.getItemsCanFocus()", mListView.getItemsCanFocus()); in testPreconditions() 47 assertFalse("out of touch-mode", mListView.isInTouchMode()); in testPreconditions() 48 assertEquals("header view count", 1, mListView.getHeaderViewsCount()); in testPreconditions() 49 assertTrue("header does not have focus", mListView.getChildAt(0).isFocused()); in testPreconditions() 55 TouchUtils.clickView(this, mListView.getChildAt(0)); in testClickingHeaderKeepsFocus() 56 assertTrue("header does not have focus", mListView.getChildAt(0).isFocused()); in testClickingHeaderKeepsFocus() 57 …assertEquals("something is selected", AbsListView.INVALID_POSITION, mListView.getSelectedItemPosit… in testClickingHeaderKeepsFocus() 64 assertEquals("selected position", 1, mListView.getSelectedItemPosition()); in testClickingHeaderWhenOtherItemHasFocusGivesHeaderFocus() [all …]
|
/frameworks/base/core/tests/coretests/src/android/util/ |
D | ListUtil.java | 30 private final ListView mListView; field in ListUtil 38 mListView = listView; in ListUtil() 47 mListView.post(new Runnable() { in setSelectedPosition() 49 mListView.setSelection(pos); in setSelectedPosition() 59 return mListView.getListPaddingTop(); in getListTop() 66 return mListView.getHeight() - mListView.getListPaddingBottom(); in getListBottom() 75 if (desiredPos > mListView.getSelectedItemPosition()) { in arrowScrollToSelectedPosition() 84 while(mListView.getSelectedItemPosition() < position && --maxDowns > 0) { in arrowDownToSelectedPosition() 87 if (position != mListView.getSelectedItemPosition()) { in arrowDownToSelectedPosition() 95 while(mListView.getSelectedItemPosition() > position && --maxUps > 0) { in arrowUpToSelectedPosition() [all …]
|