/** * Invalidates wheel * @param clearCaches if true then cached views will be clear */ public void invalidateWheel(boolean clearCaches) { if (clearCaches) { recycle.clearAll(); if (itemsLayout != null) { itemsLayout.removeAllViews(); } scrollingOffset = 0; } else if (itemsLayout != null) { // cache all items recycle.recycleItems(itemsLayout, firstItem, new ItemsRange()); } invalidate(); }
/** * Invalidates wheel * * @param clearCaches * if true then cached views will be clear */ public void invalidateWheel(boolean clearCaches) { if (clearCaches) { recycle.clearAll(); if (itemsLayout != null) { itemsLayout.removeAllViews(); } scrollingOffset = 0; } else if (itemsLayout != null) { // cache all items recycle.recycleItems(itemsLayout, firstItem, new ItemsRange()); } invalidate(); }
/** * Builds view for measuring */ private void buildViewForMeasuring() { // clear all items if (itemsLayout != null) { recycle.recycleItems(itemsLayout, firstItem, new ItemsRange()); } else { createItemsLayout(); } // add views int addItems = visibleItems / 2; for (int i = currentItem + addItems; i >= currentItem - addItems; i--) { if (addViewItem(i, true)) { firstItem = i; } } }
/** * Builds view for measuring */ private void buildViewForMeasuring() { // clear all items if (itemsLayout != null) { recycle.recycleItems(itemsLayout, firstItem, new ItemsRange()); } else { createItemsLayout(); } // add views int addItems = visibleItems / 2; for (int i = currentItem + addItems; i >= currentItem - addItems; i--) { if (addViewItem(i, true)) { firstItem = i; } } }
ItemsRange range = getItemsRange(); if (itemsLayout != null) { int first = recycle.recycleItems(itemsLayout, firstItem, range); updated = firstItem != first; firstItem = first;
ItemsRange range = getItemsRange(); if (itemsLayout != null) { int first = recycle.recycleItems(itemsLayout, firstItem, range); updated = firstItem != first; firstItem = first;