@Test public void testGetRealPosition() throws Exception { testAddPageView(); assertEquals(adapter.getRealPosition(0), adapter.getRealCount() - 1); assertEquals(adapter.getRealPosition(1), 0); assertEquals(adapter.getRealPosition(adapter.getRealCount() + 1), 0); assertEquals(adapter.getRealPosition(100), -1); assertEquals(adapter.getRealPosition(-1), -1); }
public int getRealPosition(int shadowPosition) { if (shadowPosition < 0 || shadowPosition >= shadow.size()) { return -1; } else { return getItemIndex(shadow.get(shadowPosition)); } }
WXCirclePageAdapter extends PagerAdapter { public int getRealPosition(int shadowPosition) { if (shadowPosition < 0 || shadowPosition >= shadow.size()) { return -1; } else { return getItemIndex(shadow.get(shadowPosition)); } } }
WXCirclePageAdapter extends PagerAdapter { public int getRealPosition(int shadowPosition) { if (shadowPosition < 0 || shadowPosition >= shadow.size()) { return -1; } else { return getItemIndex(shadow.get(shadowPosition)); } } WXCirclePageAdapter(List<View> views, boolean needLoop);  WXCirclePageAdapter();  WXCirclePageAdapter(boolean needLoop); }
WXCirclePageAdapter extends PagerAdapter { public int getRealPosition(int shadowPosition) { if (shadowPosition < 0 || shadowPosition >= shadow.size()) { return -1; } else { return getItemIndex(shadow.get(shadowPosition)); } } WXCirclePageAdapter(List<View> views, boolean needLoop);  WXCirclePageAdapter();  WXCirclePageAdapter(boolean needLoop); void addPageView(View view); void removePageView(View view); void replacePageView(View oldView, View newView); @Override int getCount(); int getRealCount(); @Override Object instantiateItem(ViewGroup container, int position); @Override void destroyItem(ViewGroup container, int position, Object object); @Override boolean isViewFromObject(View view, Object object); @Override int getItemPosition(Object object); int getPagePosition(View page); int getItemIndex(Object object); List<View> getViews(); int getRealPosition(int shadowPosition); int getFirst(); }
WXCirclePageAdapter extends PagerAdapter { public int getRealPosition(int shadowPosition) { if (shadowPosition < 0 || shadowPosition >= shadow.size()) { return -1; } else { return getItemIndex(shadow.get(shadowPosition)); } } WXCirclePageAdapter(List<View> views, boolean needLoop);  WXCirclePageAdapter();  WXCirclePageAdapter(boolean needLoop); void addPageView(View view); void removePageView(View view); void replacePageView(View oldView, View newView); @Override int getCount(); int getRealCount(); @Override Object instantiateItem(ViewGroup container, int position); @Override void destroyItem(ViewGroup container, int position, Object object); @Override boolean isViewFromObject(View view, Object object); @Override int getItemPosition(Object object); int getPagePosition(View page); int getItemIndex(Object object); List<View> getViews(); int getRealPosition(int shadowPosition); int getFirst();  }