Home
last modified time | relevance | path

Searched refs:mListView (Results 1 – 25 of 64) sorted by relevance

123

/frameworks/base/core/tests/coretests/src/android/widget/listview/arrowscroll/
DListOfItemsTallerThanScreenTest.java31 private ListView mListView; field in ListOfItemsTallerThanScreenTest
38 mListView = getActivity().getListView(); in setUp()
47 assertNotNull(mListView); in testPreconditions()
48 assertEquals("should only be one visible child", 1, mListView.getChildCount()); in testPreconditions()
49 …final int amountOffScreen = mListView.getChildAt(0).getBottom() - (mListView.getBottom() - mListVi… in testPreconditions()
51 amountOffScreen > mListView.getMaxScrollAmount()); in testPreconditions()
56 final View view = mListView.getSelectedView(); in testScrollDownAcrossItem()
59 assertEquals(mListView.getListPaddingTop(), in testScrollDownAcrossItem()
63 view.getBottom() > mListView.getBottom()); in testScrollDownAcrossItem()
70 mListView.getListPaddingTop() - mListView.getMaxScrollAmount() * i, in testScrollDownAcrossItem()
[all …]
DListOfItemsShorterThanScreenTest.java31 private ListView mListView; field in ListOfItemsShorterThanScreenTest
42 mListView = getActivity().getListView(); in setUp()
47 assertEquals(0, mListView.getSelectedItemPosition()); in testPreconditions()
48 assertTrue(mListView.getChildAt(0).isSelected()); in testPreconditions()
49 assertEquals(mListView.getListPaddingTop(), mListView.getSelectedView().getTop()); in testPreconditions()
54 final View next = mListView.getChildAt(1); in testMoveDownToOnScreenNextItem()
56 final int secondPosition = mListView.getSelectedView().getBottom(); in testMoveDownToOnScreenNextItem()
62 assertEquals(1, mListView.getSelectedItemPosition()); in testMoveDownToOnScreenNextItem()
74 assertEquals(0, mListView.getSelectedItemPosition()); in testMoveUpToOnScreenItem()
80 final int lastOnScreenItemIndex = mListView.getChildCount() - 1; in testMoveDownToItemRequiringScrolling()
[all …]
DListWithOffScreenNextSelectableTest.java32 private ListView mListView; field in ListWithOffScreenNextSelectableTest
42 mListView = getActivity().getListView(); in setUp()
47 assertNotNull(mListView); in testPreconditions()
48 assertEquals(5, mListView.getAdapter().getCount()); in testPreconditions()
49 assertFalse(mListView.getAdapter().areAllItemsEnabled()); in testPreconditions()
50 assertFalse(mListView.getAdapter().isEnabled(1)); in testPreconditions()
51 assertFalse(mListView.getAdapter().isEnabled(2)); in testPreconditions()
52 assertFalse(mListView.getAdapter().isEnabled(3)); in testPreconditions()
55 4, mListView.getChildCount()); in testPreconditions()
56 assertEquals(0, mListView.getSelectedItemPosition()); in testPreconditions()
[all …]
DListOfThinItemsTest.java30 private ListView mListView; field in ListOfThinItemsTest
39 mListView = getActivity().getListView(); in setUp()
45 assertNotNull(mListView); in testPreconditions()
47 mListView.getSelectedView().getHeight() < mListView.getVerticalFadingEdgeLength()); in testPreconditions()
49 mListView.getChildCount() < mListView.getAdapter().getCount()); in testPreconditions()
55 getActivity().runOnUiThread(() -> mListView.requestFocus()); in testScrollToBottom()
58 final int numItems = mListView.getAdapter().getCount(); in testScrollToBottom()
59 final int listBottom = mListView.getHeight() - mListView.getListPaddingBottom(); in testScrollToBottom()
62 i, mListView.getSelectedItemPosition()); in testScrollToBottom()
63 final int bottomFadingEdge = listBottom - mListView.getVerticalFadingEdgeLength(); in testScrollToBottom()
[all …]
DListOfShortShortTallShortShortTest.java29 private ListView mListView; field in ListOfShortShortTallShortShortTest
39 mListView = getActivity().getListView(); in setUp()
40 mListUtil = new ListUtil(mListView, getInstrumentation()); in setUp()
46 assertEquals("list item count", 5, mListView.getCount()); in testPreconditions()
47 assertEquals("list visible child count", 3, mListView.getChildCount()); in testPreconditions()
48 … int firstTwoHeight = mListView.getChildAt(0).getHeight() + mListView.getChildAt(1).getHeight(); in testPreconditions()
50 firstTwoHeight <= mListView.getVerticalFadingEdgeLength()); in testPreconditions()
52 firstTwoHeight <= mListView.getMaxScrollAmount()); in testPreconditions()
64 assertEquals("selected item position", 2, mListView.getSelectedItemPosition()); in testFadeTopTwoItemsOut()
66 mListView.getSelectedView().getTop() < mListUtil.getListTop()); in testFadeTopTwoItemsOut()
[all …]
DListItemsExpandOnSelectionTest.java29 private ListView mListView; field in ListItemsExpandOnSelectionTest
43 mListView = getActivity().getListView(); in setUp()
44 mListTop = mListView.getListPaddingTop(); in setUp()
45 mListBottom = mListView.getHeight() - mListView.getListPaddingBottom(); in setUp()
46 mExpandedHeight = mListView.getChildAt(0).getHeight(); in setUp()
47 mNormalHeight = mListView.getChildAt(1).getHeight(); in setUp()
52 assertEquals(0, mListView.getSelectedItemPosition()); in testPreconditions()
62 assertEquals(1, mListView.getSelectedItemPosition()); in testMoveSelectionDownNotRequiringScroll()
64 mListTop, mListView.getChildAt(0).getTop()); in testMoveSelectionDownNotRequiringScroll()
72 assertEquals(1, mListView.getSelectedItemPosition()); in testMoveSelectionUpNotRequiringScroll()
[all …]
DListWithScreenOfNoSelectablesTest.java30 private ListView mListView; field in ListWithScreenOfNoSelectablesTest
39 mListView = getActivity().getListView(); in setUp()
45 mListView.getAdapter().isEnabled(0)); in testPreconditions()
46 final int numItems = mListView.getCount(); in testPreconditions()
49 mListView.getAdapter().isEnabled(i)); in testPreconditions()
52 mListView.getChildCount() < mListView.getCount()); in testPreconditions()
60 View first = mListView.getChildAt(0); in testGoFromSelectedViewExistsToNoSelectedViewExists()
66 … assertEquals("selected position", ListView.INVALID_POSITION, mListView.getSelectedItemPosition()); in testGoFromSelectedViewExistsToNoSelectedViewExists()
67 assertNull("selected view", mListView.getSelectedView()); in testGoFromSelectedViewExistsToNoSelectedViewExists()
72 final int lastPosition = mListView.getCount() - 1; in testPanDownAcrossUnselectableChildrenToBottom()
[all …]
DListItemFocusablesCloseTest.java28 private ListView mListView; field in ListItemFocusablesCloseTest
39 mListView = getActivity().getListView(); in setUp()
40 mListTop = mListView.getListPaddingTop(); in setUp()
41 mListBottom = mListView.getHeight() - mListView.getListPaddingBottom(); in setUp()
46 assertNotNull(mListView); in testPreconditions()
47 assertTrue(mListView.getAdapter().areAllItemsEnabled()); in testPreconditions()
48 assertTrue(mListView.getItemsCanFocus()); in testPreconditions()
49 assertEquals(0, mListView.getSelectedItemPosition()); in testPreconditions()
50 final LinearLayout first = (LinearLayout) mListView.getSelectedView(); in testPreconditions()
53 mListView.getListPaddingTop(), in testPreconditions()
[all …]
DListOfShortTallShortTest.java27 private ListView mListView; field in ListOfShortTallShortTest
37 mListView = getActivity().getListView(); in setUp()
43 mListView.getChildAt(1).getHeight() > mListView.getHeight()); in testPreconditions()
48 int topBeforeMove = mListView.getChildAt(1).getTop(); in testGoDownFromShortToTall()
52 1, mListView.getSelectedItemPosition()); in testGoDownFromShortToTall()
55 mListView.getSelectedView().getTop()); in testGoDownFromShortToTall()
61 while (mListView.getSelectedItemPosition() != 2 && maxMoves > 0) { in testGoUpFromShortToTall()
66 mListView.getSelectedItemPosition()); in testGoUpFromShortToTall()
69 2, mListView.getChildCount()); in testGoUpFromShortToTall()
71 mListView.getChildAt(1), mListView.getSelectedView()); in testGoUpFromShortToTall()
[all …]
DListWithNoFadingEdgeTest.java29 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 getActivity().runOnUiThread(() -> mListView.requestFocus()); in testScrollDownToBottom()
54 final int numItems = mListView.getCount(); in testScrollDownToBottom()
57 assertEquals("selected position", i, mListView.getSelectedItemPosition()); in testScrollDownToBottom()
60 assertEquals("selected position", numItems - 1, mListView.getSelectedItemPosition()); in testScrollDownToBottom()
65 getActivity().runOnUiThread(() -> mListView.requestFocus()); in testScrollFromBottomToTop()
[all …]
DListLastItemPartiallyVisibleTest.java28 private ListView mListView; field in ListLastItemPartiallyVisibleTest
39 mListView = getActivity().getListView(); in setUp()
40 mListBottom = mListView.getHeight() - mListView.getPaddingBottom(); in setUp()
46 "in adapter", mListView.getCount(), mListView.getChildCount()); in testPreconditions()
48 final View lastChild = mListView.getChildAt(mListView.getChildCount() - 1); in testPreconditions()
51 assertEquals("selected position", 0, mListView.getSelectedItemPosition()); in testPreconditions()
57 final View firstChild = mListView.getChildAt(0); in testMovingDownToFullyVisibleNoScroll()
67 int numMovesToLast = mListView.getCount() - 1; in testMovingUpToFullyVisibleNoScroll()
72 mListView.getChildCount() - 1, mListView.getSelectedItemPosition()); in testMovingUpToFullyVisibleNoScroll()
74 final View lastChild = mListView.getSelectedView(); in testMovingUpToFullyVisibleNoScroll()
DListItemFocusablesFarApartTest.java30 private ListView mListView; field in ListItemFocusablesFarApartTest
41 mListView = getActivity().getListView(); in setUp()
42 mListTop = mListView.getListPaddingTop(); in setUp()
43 mListBottom = mListView.getHeight() - mListView.getListPaddingBottom(); in setUp()
52 return ((ViewGroup) mListView.getChildAt(listIndex)).getChildAt(index); in getChildOfItem()
57 ViewGroup listItem = (ViewGroup) mListView.getChildAt(listIndex); in getTopOfChildOfItem()
63 ViewGroup listItem = (ViewGroup) mListView.getChildAt(listIndex); in getBottomOfChildOfItem()
70 assertNotNull(mListView); in testPreconditions()
72 1, mListView.getChildCount()); in testPreconditions()
76 topOfSecondButton - topOfFirstButton > mListView.getMaxScrollAmount()); in testPreconditions()
[all …]
DListWithSeparatorsTest.java28 private ListView mListView; field in ListWithSeparatorsTest
39 mListView = getActivity().getListView(); in setUp()
45 assertNotNull(mListView); in testPreconditions()
46 assertFalse(mListView.getAdapter().areAllItemsEnabled()); in testPreconditions()
47 assertFalse(mListView.getAdapter().isEnabled(0)); in testPreconditions()
48 assertFalse(mListView.getAdapter().isEnabled(2)); in testPreconditions()
49 assertEquals(1, mListView.getSelectedItemPosition()); in testPreconditions()
56 1, mListView.getSelectedItemPosition()); in testGoingUpDoesnNotHitUnselectableItem()
59 mListView.getListPaddingTop(), mListView.getChildAt(0).getTop()); in testGoingUpDoesnNotHitUnselectableItem()
67 mListView.getSelectedItemPosition()); in testGoingDownSkipsOverUnselectable()
[all …]
DListInterleaveFocusablesTest.java29 private ListView mListView; field in ListInterleaveFocusablesTest
40 mListView = getActivity().getListView(); in setUp()
41 mListUtil = new ListUtil(mListView, getInstrumentation()); in setUp()
46 assertEquals(7, mListView.getChildCount()); in testPreconditions()
47 assertTrue(mListView.getChildAt(1).isFocusable()); in testPreconditions()
48 assertTrue(mListView.getChildAt(3).isFocusable()); in testPreconditions()
49 assertTrue(mListView.getChildAt(6).isFocusable()); in testPreconditions()
56 assertEquals("selected item position", 1, mListView.getSelectedItemPosition()); in testGoingFromUnFocusableSelectedToFocusable()
67 assertEquals("selected item position", 3, mListView.getSelectedItemPosition()); in testGoingDownFromUnFocusableSelectedToFocusableWithOtherFocusableAbove()
76 assertEquals("selected item position", 1, mListView.getSelectedItemPosition()); in testGoingUpFromUnFocusableSelectedToFocusableWithOtherFocusableAbove()
[all …]
/frameworks/base/core/tests/coretests/src/android/widget/listview/
DListFocusableTest.java28 private ListView mListView; field in ListFocusableTest
39 mListView = getActivity().getListView(); in setUp()
45 assertNotNull(mListView); in testPreconditions()
48 assertEquals(0, mListView.getSelectedItemPosition()); in testPreconditions()
54 assertTrue(mListView.isFocusable()); in testAdapterFull()
60 assertFalse(mListView.isFocusable()); in testAdapterEmpty()
66 assertFalse(mListView.isFocusable()); in testAdapterNull()
71 assertTrue(mListView.isFocusable()); in testAdapterFullSetFocusable()
74 assertTrue(mListView.isFocusable()); in testAdapterFullSetFocusable()
79 assertTrue(mListView.isFocusable()); in testAdapterFullSetNonFocusable()
[all …]
DListGetCheckItemIdsTest.java31 private ListView mListView; field in ListGetCheckItemIdsTest
41 mListView = getActivity().getListView(); in setUp()
46 long[] checkItemIds = mListView.getCheckItemIds(); in assertChecked()
61 mListView.setChoiceMode(ListView.CHOICE_MODE_NONE); in testNoneCheck()
63 mListView.setItemChecked(0, true); in testNoneCheck()
70 mListView.setChoiceMode(ListView.CHOICE_MODE_SINGLE); in testSimpleCheck()
74 int childCount = mListView.getChildCount(); in testSimpleCheck()
76 mListView.setItemChecked(i, true); in testSimpleCheck()
82 mListView.setItemChecked(i, true); in testSimpleCheck()
83 mListView.setItemChecked((i - 3 + childCount) % childCount, false); in testSimpleCheck()
[all …]
DListItemRequestRectAboveThinFirstItemTest.java31 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/
DListTouchBottomGravityManyTest.java36 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 …]
DListTouchManyTest.java35 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 …]
DListTouchBottomGravityTest.java33 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 …]
DListSetSelectionTest.java35 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 …]
DListTouchTest.java32 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/
DScrollingThroughListOfFocusablesTest.java37 private ListView mListView; field in ScrollingThroughListOfFocusablesTest
52 mListView = mActivity.getListView(); in setUp()
54 mListView.setVerticalFadingEdgeEnabled(true); in setUp()
55 mListView.setFadingEdgeLength(10); in setUp()
59 mActivity.runOnUiThread(() -> mListView.requestFocus()); in setUp()
72 assertNotNull(mListView); in testPreconditions()
81 assertEquals(0, mListView.getSelectedItemPosition()); in testScrollingDownInFirstItem()
95 assertEquals(0, mListView.getSelectedItemPosition()); in testScrollingDownInFirstItem()
97 mListView.getSelectedView(); in testScrollingDownInFirstItem()
101 mListView.getBottom() - mListView.getVerticalFadingEdgeLength(); in testScrollingDownInFirstItem()
[all …]
/frameworks/base/core/tests/coretests/src/android/widget/listview/focus/
DListWithEditTextHeaderTest.java33 private ListView mListView; field in ListWithEditTextHeaderTest
42 mListView = getActivity().getListView(); in setUp()
47 assertTrue("listview.getItemsCanFocus()", mListView.getItemsCanFocus()); in testPreconditions()
48 assertFalse("out of touch-mode", mListView.isInTouchMode()); in testPreconditions()
49 assertEquals("header view count", 1, mListView.getHeaderViewsCount()); in testPreconditions()
50 assertTrue("header does not have focus", mListView.getChildAt(0).isFocused()); in testPreconditions()
56 TouchUtils.clickView(this, mListView.getChildAt(0)); in testClickingHeaderKeepsFocus()
57 assertTrue("header does not have focus", mListView.getChildAt(0).isFocused()); in testClickingHeaderKeepsFocus()
58 …assertEquals("something is selected", AbsListView.INVALID_POSITION, mListView.getSelectedItemPosit… in testClickingHeaderKeepsFocus()
65 assertEquals("selected position", 1, mListView.getSelectedItemPosition()); in testClickingHeaderWhenOtherItemHasFocusGivesHeaderFocus()
[all …]
/frameworks/base/core/tests/coretests/src/android/util/
DListUtil.java28 private final ListView mListView; field in ListUtil
36 mListView = listView; in ListUtil()
45 mListView.post(new Runnable() { in setSelectedPosition()
47 mListView.setSelection(pos); in setSelectedPosition()
57 return mListView.getListPaddingTop(); in getListTop()
64 return mListView.getHeight() - mListView.getListPaddingBottom(); in getListBottom()
73 if (desiredPos > mListView.getSelectedItemPosition()) { in arrowScrollToSelectedPosition()
82 while(mListView.getSelectedItemPosition() < position && --maxDowns > 0) { in arrowDownToSelectedPosition()
85 if (position != mListView.getSelectedItemPosition()) { in arrowDownToSelectedPosition()
93 while(mListView.getSelectedItemPosition() > position && --maxUps > 0) { in arrowUpToSelectedPosition()
[all …]

123