Lines Matching refs:recyclerView
320 final RecyclerView recyclerView = new RecyclerView(getActivity());
322 recyclerView.setAdapter(adapter);
323 recyclerView.addItemDecoration(new RecyclerView.ItemDecoration() {
350 recyclerView.setLayoutManager(layoutManager);
352 setRecyclerView(recyclerView);
364 final RecyclerView recyclerView = new RecyclerView(getActivity());
366 recyclerView.setAdapter(adapter);
381 recyclerView.setLayoutManager(layoutManager);
383 setRecyclerView(recyclerView);
400 final RecyclerView recyclerView = new RecyclerView(getActivity());
418 recyclerView.setAdapter(adapter);
419 recyclerView.setLayoutManager(tlm);
421 setRecyclerView(recyclerView);
423 final View child = recyclerView.getChildAt(0);
428 recyclerView.requestChildRectangleOnScreen(child, new Rect(3, 4, 5, 6), true);
437 final RecyclerView recyclerView = new RecyclerView(getActivity());
463 recyclerView.setAdapter(adapter);
464 recyclerView.setLayoutManager(tlm);
466 setRecyclerView(recyclerView);
471 getActivity().getContainer().removeView(recyclerView);
472 getActivity().getContainer().addView(recyclerView);
478 recyclerView.scrollBy(0, 10);
484 RecyclerView recyclerView = new RecyclerView(getActivity());
530 recyclerView.setAdapter(adapter);
531 recyclerView.setLayoutManager(tlm);
533 setRecyclerView(recyclerView);
541 TouchUtils.dragViewTo(getInstrumentation(), recyclerView,
555 TouchUtils.dragViewTo(getInstrumentation(), recyclerView,
565 final RecyclerView recyclerView = new RecyclerView(getActivity());
586 recyclerView.setLayoutManager(tlm);
595 recyclerView.setAdapter(adapter);
597 setRecyclerView(recyclerView);
604 recyclerView.focusSearch(recyclerView.getChildAt(1), View.FOCUS_DOWN);
612 final RecyclerView recyclerView = new RecyclerView(getActivity());
613 recyclerView.setItemAnimator(null);
615 recyclerView.setLayoutManager(tlm);
624 recyclerView.setAdapter(adapter);
626 setRecyclerView(recyclerView);
628 final RecyclerView.ViewHolder toFocus = recyclerView.findViewHolderForAdapterPosition(9);
636 recyclerView.focusSearch(toFocus.itemView, View.FOCUS_DOWN);
645 RecyclerView recyclerView = new RecyclerView(getActivity());
674 recyclerView.setAdapter(adapter);
675 recyclerView.setLayoutManager(tlm);
677 setRecyclerView(recyclerView);
679 final View c = recyclerView.getChildAt(recyclerView.getChildCount() - 1);
683 focusSearch(recyclerView, c, View.FOCUS_DOWN);
706 RecyclerView recyclerView = new RecyclerView(getActivity());
734 recyclerView.setAdapter(adapter);
735 recyclerView.setLayoutManager(tlm);
737 setRecyclerView(recyclerView);
743 assertFalse(recyclerView.isLayoutFrozen());
744 assertSame(adapter2, recyclerView.getAdapter());
749 assertFalse(recyclerView.isLayoutFrozen());
750 assertSame(adapter3, recyclerView.getAdapter());
804 final RecyclerView recyclerView = new RecyclerView(getActivity());
813 recyclerView.setLayoutManager(tlm);
814 recyclerView.setAdapter(adapter);
816 setRecyclerView(recyclerView);
836 RecyclerView recyclerView = new RecyclerView(getActivity());
856 recyclerView.setLayoutManager(tlm);
858 recyclerView.setAdapter(adapter);
861 recyclerView.getViewTreeObserver().addOnScrollChangedListener(
868 recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
870 public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
872 super.onScrolled(recyclerView, dx, dy);
877 setRecyclerView(recyclerView);
895 requestLayoutOnUIThread(recyclerView);
925 RecyclerView recyclerView = new RecyclerView(getActivity());
936 recyclerView.setLayoutManager(tlm);
938 recyclerView.setAdapter(adapter);
940 setRecyclerView(recyclerView);
944 recyclerView.addOnScrollListener(mockListener);
949 requestLayoutOnUIThread(recyclerView);
952 verify(mockListener).onScrolled(recyclerView, 0, 0);
957 RecyclerView recyclerView = new RecyclerView(getActivity());
966 recyclerView.setLayoutManager(tlm);
968 recyclerView.setAdapter(adapter);
970 setRecyclerView(recyclerView);
974 recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
976 public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
977 super.onScrolled(recyclerView, dx, dy);
989 requestLayoutOnUIThread(recyclerView);
1049 RecyclerView recyclerView = new RecyclerView(getActivity());
1090 recyclerView.setAdapter(adapter);
1091 recyclerView.setLayoutManager(tlm);
1093 setRecyclerView(recyclerView);
1162 RecyclerView recyclerView = new RecyclerView(getActivity());
1198 recyclerView.setAdapter(adapter);
1199 recyclerView.setLayoutManager(tlm);
1201 setRecyclerView(recyclerView);
1209 TouchUtils.dragViewTo(getInstrumentation(), recyclerView, Gravity.LEFT | Gravity.TOP,
1235 RecyclerView recyclerView = new RecyclerView(getActivity());
1238 setupBasic(recyclerView, layoutManager, testAdapter, false);
1256 private void setupBasic(RecyclerView recyclerView, TestLayoutManager tlm,
1258 recyclerView.setLayoutManager(tlm);
1259 recyclerView.setAdapter(adapter);
1262 setRecyclerView(recyclerView);
1265 setRecyclerView(recyclerView);
1271 RecyclerView recyclerView = new RecyclerView(getActivity());
1274 setupBasic(recyclerView, layoutManager, testAdapter, false);
1280 RecyclerView recyclerView = new RecyclerView(getActivity());
1283 setupBasic(recyclerView, layoutManager, testAdapter, true);
1383 RecyclerView recyclerView = new RecyclerView(getActivity());
1384 recyclerView.setAdapter(testAdapter);
1385 recyclerView.setLayoutManager(tlm);
1386 recyclerView.setItemAnimator(null);
1387 setRecyclerView(recyclerView);
1391 View view = recyclerView.getChildAt(3);//this has to be greater than def cache size.
1394 requestLayoutOnUIThread(recyclerView);
1403 final RecyclerView recyclerView = new RecyclerView(getActivity());
1412 recyclerView.setAdapter(adapter);
1413 recyclerView.setLayoutManager(tlm);
1415 setRecyclerView(recyclerView);
1422 recyclerView.getChildAdapterPosition(tlm.getChildAt(i)),
1428 recyclerView.getChildAdapterPosition(tlm.getChildAt(i)),
1613 final TestRecyclerView recyclerView = new TestRecyclerView(getActivity());
1614 recyclerView.setLayoutManager(tlm);
1615 recyclerView.setAdapter(testAdapter);
1616 recyclerView.setItemAnimator(animator);
1619 setRecyclerView(recyclerView);
1631 assertThat("test sanity", recyclerView.getChildCount(), CoreMatchers.is(11));
1635 for (int i = 0; i < recyclerView.getChildCount(); i ++) {
1636 View view = recyclerView.getChildAt(i);
1637 RecyclerView.ViewHolder vh = recyclerView.getChildViewHolder(view);
1658 swapViewsAtIndices(recyclerView, index1, index2);
1662 assertThat(recyclerView.findViewHolderForAdapterPosition(2),
1664 assertThat(recyclerView.findViewHolderForLayoutPosition(2),
1666 assertThat(recyclerView.findViewHolderForItemId(itemId),
1670 swapViewsAtIndices(recyclerView, index1, index2);
1673 assertThat(recyclerView.findViewHolderForAdapterPosition(2),
1675 assertThat(recyclerView.findViewHolderForLayoutPosition(2),
1677 assertThat(recyclerView.findViewHolderForItemId(itemId),
1684 assertThat(recyclerView.findViewHolderForAdapterPosition(2),
1686 assertThat(recyclerView.findViewHolderForLayoutPosition(2),
1688 assertThat(recyclerView.findViewHolderForItemId(itemId),
1695 private void swapViewsAtIndices(TestRecyclerView recyclerView, int index1, int index2) {
1704 final View v1 = recyclerView.getChildAt(index1);
1705 final View v2 = recyclerView.getChildAt(index2);
1706 boolean v1Hidden = recyclerView.mChildHelper.isHidden(v1);
1707 boolean v2Hidden = recyclerView.mChildHelper.isHidden(v2);
1715 recyclerView.detachViewFromParent(index2);
1716 recyclerView.attachViewToParent(v2, index1, v2.getLayoutParams());
1717 recyclerView.detachViewFromParent(index1 + 1);
1718 recyclerView.attachViewToParent(v1, index2, v1.getLayoutParams());
1742 final RecyclerView recyclerView = new RecyclerView(getActivity());
1743 recyclerView.setLayoutManager(tlm);
1744 recyclerView.setAdapter(testAdapter);
1746 setRecyclerView(recyclerView);
1752 final int count = recyclerView.getChildCount();
1756 View view = recyclerView.getChildAt(i);
1757 TestViewHolder vh = (TestViewHolder) recyclerView.getChildViewHolder(view);
1760 recyclerView.findViewHolderForAdapterPosition(index));
1768 View view = recyclerView.getChildAt(i);
1769 TestViewHolder vh = (TestViewHolder) recyclerView
1775 recyclerView.findViewHolderForAdapterPosition(index));
1798 RecyclerView recyclerView = new RecyclerView(getActivity());
1799 recyclerView.setAdapter(testAdapter);
1800 recyclerView.setLayoutManager(tlm);
1801 setRecyclerView(recyclerView);
1803 assertEquals(SCROLL_STATE_IDLE, recyclerView.getScrollState());
1806 recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
1808 public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
1829 RecyclerView recyclerView = new RecyclerView(getActivity());
1830 recyclerView.setAdapter(testAdapter);
1831 recyclerView.setLayoutManager(tlm);
1832 setRecyclerView(recyclerView);
1834 assertEquals(SCROLL_STATE_IDLE, recyclerView.getScrollState());
1837 recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
1839 public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
1857 assertEquals(SCROLL_STATE_IDLE, recyclerView.getScrollState());
1867 RecyclerView recyclerView = new RecyclerView(getActivity());
1868 recyclerView.setAdapter(testAdapter);
1869 recyclerView.setLayoutManager(tlm);
1870 setRecyclerView(recyclerView);
1872 assertEquals(SCROLL_STATE_IDLE, recyclerView.getScrollState());
1875 recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
1877 public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
1901 RecyclerView recyclerView = new RecyclerView(getActivity());
1902 recyclerView.setAdapter(testAdapter);
1903 recyclerView.setLayoutManager(tlm);
1904 setRecyclerView(recyclerView);
1906 assertEquals(SCROLL_STATE_IDLE, recyclerView.getScrollState());
1909 recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
1911 public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
1932 assertEquals(SCROLL_STATE_IDLE, recyclerView.getScrollState());
1942 RecyclerView recyclerView = new RecyclerView(getActivity());
1943 recyclerView.setAdapter(testAdapter);
1944 recyclerView.setLayoutManager(tlm);
1945 setRecyclerView(recyclerView);
1947 assertEquals(SCROLL_STATE_IDLE, recyclerView.getScrollState());
1949 recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
1951 public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
2056 RecyclerView recyclerView = new RecyclerView(getActivity());
2057 recyclerView.setAdapter(testAdapter);
2058 recyclerView.setLayoutManager(lm);
2059 ((SimpleItemAnimator)recyclerView.getItemAnimator()).setSupportsChangeAnimations(true);
2061 setRecyclerView(recyclerView);
2125 public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state,
2128 new LinearSmoothScroller(recyclerView.getContext()) {
2309 RecyclerView recyclerView = new RecyclerView(getActivity());
2310 recyclerView.setLayoutManager(lm);
2311 recyclerView.setAdapter(testAdapter);
2312 recyclerView.setLayoutManager(lm);
2314 setRecyclerView(recyclerView);
2355 RecyclerView recyclerView = new RecyclerView(getActivity());
2356 recyclerView.setLayoutManager(lm);
2357 recyclerView.setAdapter(testAdapter);
2358 recyclerView.setRecyclerListener(new RecyclerView.RecyclerListener() {
2365 setRecyclerView(recyclerView, !useCustomPool);
2402 RecyclerView recyclerView = new RecyclerView(getActivity());
2403 recyclerView.setLayoutManager(lm);
2404 recyclerView.setAdapter(testAdapter);
2405 recyclerView.setLayoutManager(lm);
2407 setRecyclerView(recyclerView, !useCustomPool);
2426 final RecyclerView recyclerView = new RecyclerView(getActivity());
2427 recyclerView.setAdapter(adapter);
2428 recyclerView.setLayoutManager(lm);
2430 setRecyclerView(recyclerView);
2440 lm.removeAndRecycleAllViews(recyclerView.mRecycler);
2469 final RecyclerView recyclerView = new RecyclerView(getActivity());
2470 recyclerView.setAdapter(adapter);
2471 recyclerView.setLayoutManager(lm);
2473 setRecyclerView(recyclerView);
2501 final RecyclerView recyclerView = new RecyclerView(getActivity());
2503 recyclerView.setAdapter(adapter);
2543 recyclerView.setItemViewCacheSize(5);
2544 recyclerView.setLayoutManager(testLayoutManager);
2546 setRecyclerView(recyclerView, true, false);
2553 requestLayoutOnUIThread(recyclerView);
2559 invalidateDecorOffsets(recyclerView);
2561 invalidateDecorOffsets(recyclerView);
2575 requestLayoutOnUIThread(recyclerView);
2581 invalidateDecorOffsets(recyclerView);
2583 invalidateDecorOffsets(recyclerView);
2599 invalidateDecorOffsets(recyclerView);
2611 public void addItemDecoration(final RecyclerView recyclerView, final
2616 recyclerView.addItemDecoration(itemDecoration);
2621 public void removeItemDecoration(final RecyclerView recyclerView, final
2626 recyclerView.removeItemDecoration(itemDecoration);
2631 public void invalidateDecorOffsets(final RecyclerView recyclerView) throws Throwable {
2635 recyclerView.invalidateItemDecorations();
2644 final RecyclerView recyclerView = new RecyclerView(getActivity());
2645 recyclerView.setAdapter(adapter);
2683 recyclerView.setLayoutManager(testLayoutManager);
2685 setRecyclerView(recyclerView);
2776 RecyclerView recyclerView = new RecyclerView(this.getActivity());
2777 recyclerView.setAdapter(testAdapter);
2778 recyclerView.setLayoutManager(lm);
2780 setRecyclerView(recyclerView);
2783 movedView[0] = recyclerView.getChildAt(movedViewFromIndex);
2851 RecyclerView recyclerView = new RecyclerView(getActivity());
2852 recyclerView.setLayoutManager(lm);
2853 recyclerView.setAdapter(testAdapter);
2855 setRecyclerView(recyclerView);
2859 requestLayoutOnUIThread(recyclerView);
2949 RecyclerView recyclerView = new RecyclerView(getActivity());
2950 recyclerView.setLayoutManager(lm);
2951 recyclerView.setAdapter(testAdapter);
2953 setRecyclerView(recyclerView);
2965 final RecyclerView recyclerView = new RecyclerView(getActivity());
2983 recyclerView.setAdapter(testAdapter);
2984 recyclerView.setLayoutManager(lm);
2986 setRecyclerView(recyclerView);
2990 assertEquals("All children should be recycled", recyclerView.getChildCount(), 0);
2995 final RecyclerView recyclerView = new RecyclerView(getActivity());
3008 recyclerView.setAdapter(adapter);
3009 recyclerView.setLayoutManager(lm);
3010 recyclerView.setHasFixedSize(true);
3018 final RecyclerView recyclerView = new RecyclerView(getActivity());
3031 recyclerView.setAdapter(adapter);
3032 recyclerView.setLayoutManager(lm);
3034 recyclerView.setHasFixedSize(true);
3035 setRecyclerView(recyclerView);
3131 final RecyclerView recyclerView = new RecyclerView(getActivity());
3132 recyclerView.setItemAnimator(null);
3133 recyclerView.setAdapter(adapter);
3134 recyclerView.setLayoutManager(lm);
3135 recyclerView.setItemViewCacheSize(10);
3137 setRecyclerView(recyclerView);
3143 requestLayoutOnUIThread(recyclerView);
3265 final RecyclerView recyclerView = new RecyclerView(getActivity());
3270 recyclerView.setAdapter(adapter);
3327 recyclerView.setLayoutManager(lm);
3329 setRecyclerView(recyclerView);
3365 final RecyclerView recyclerView = new RecyclerView(getActivity());
3366 recyclerView.setItemAnimator(null);
3367 recyclerView.setAdapter(adapter);
3368 recyclerView.setLayoutManager(lm);
3369 recyclerView.setItemViewCacheSize(10);
3371 setRecyclerView(recyclerView);
3376 requestLayoutOnUIThread(recyclerView);
3389 RecyclerView.ViewHolder vh = recyclerView.findViewHolderForLayoutPosition(i);
3439 final RecyclerView recyclerView = new RecyclerView(getActivity());
3440 recyclerView.setAdapter(adapter);
3441 recyclerView.setLayoutManager(lm);
3443 setRecyclerView(recyclerView);
3457 final RecyclerView recyclerView = new RecyclerView(getActivity());
3458 recyclerView.setAdapter(adapter);
3459 recyclerView.setItemAnimator(null);
3472 recyclerView.setLayoutManager(testLayoutManager);
3477 getActivity().getContainer().addView(recyclerView);
3491 recyclerView.requestLayout();
3518 final RecyclerView recyclerView = new RecyclerView(getActivity());
3523 setRecyclerView(recyclerView);
3535 final RecyclerView recyclerView = new RecyclerView(getActivity());
3572 recyclerView.getItemAnimator().setMoveDuration(4000);
3573 recyclerView.getItemAnimator().setRemoveDuration(4000);
3575 recyclerView.setAdapter(adapter);
3576 recyclerView.setLayoutManager(tlm);
3578 setRecyclerView(recyclerView);
3902 public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state,
3907 new LinearSmoothScroller(recyclerView.getContext()) {
3955 final RecyclerView recyclerView = new RecyclerView(getActivity());
3957 recyclerView.setLayoutManager(new TestLayoutManager() {
3978 recyclerView.setAdapter(adapter);
3984 setRecyclerView(recyclerView);
3985 recyclerView.scrollBy(10, 19);
4012 public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state,
4015 new LinearSmoothScroller(recyclerView.getContext()) {