### Question:
WXSlider extends WXVContainer<FrameLayout> { @WXComponentProp(name = Constants.Name.OFFSET_X_ACCURACY) public void setOffsetXAccuracy(float accuracy) { this.offsetXAccuracy = accuracy; } @Deprecated  WXSlider(WXSDKInstance instance, WXDomObject dom, WXVContainer parent, String instanceId, boolean isLazy);  WXSlider(WXSDKInstance instance, WXDomObject node, WXVContainer parent); @Override LayoutParams getChildLayoutParams(WXComponent child,View childView, int width, int height, int left, int right, int top, int bottom); @Override void addEvent(String type); @Override boolean containsGesture(WXGestureType WXGestureType); @Override ViewGroup getRealView(); @Override void addSubView(View view, int index); @Override void remove(WXComponent child, boolean destroy); @Override void destroy(); @Override void onActivityResume(); @Override void onActivityStop(); void addIndicator(WXIndicator indicator); @Deprecated @WXComponentProp(name = Constants.Name.VALUE) void setValue(String value); @WXComponentProp(name = Constants.Name.AUTO_PLAY) void setAutoPlay(String autoPlay); @WXComponentProp(name = Constants.Name.SHOW_INDICATORS) void setShowIndicators(String show); @WXComponentProp(name = Constants.Name.INTERVAL) void setInterval(int intervalMS); @WXComponentProp(name = Constants.Name.INDEX) void setIndex(int index); @WXComponentProp(name = Constants.Name.SCROLLABLE) void setScrollable(boolean scrollable); @WXComponentProp(name = Constants.Name.OFFSET_X_ACCURACY) void setOffsetXAccuracy(float accuracy); static final String INDEX; static final String INFINITE; }### Answer:
@Test public void testOnScrollListener() throws Exception { component.mViewPager.addOnPageChangeListener(new WXSlider.SliderOnScrollListener(component)); component.setOffsetXAccuracy(0.05f); component.mViewPager.setCurrentItem(0); for (int index=1;index<component.mViewPager.getRealCount();index++) { component.mViewPager.setCurrentItem(index,true); } for (int index=component.mViewPager.getRealCount() - 1;index>=0;index--) { component.mViewPager.setCurrentItem(index,true); } component.mViewPager.setCurrentItem(3,true); component.mViewPager.setCurrentItem(0,true); }