use of com.youth.banner.listener.OnPageChangeListener in project banner by youth5201314.
the class VideoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_video);
ButterKnife.bind(this);
banner.addBannerLifecycleObserver(this).setAdapter(new MultipleTypesAdapter(this, DataBean.getTestDataVideo())).setIndicator(new NumIndicator(this)).setIndicatorGravity(IndicatorConfig.Direction.RIGHT).addOnPageChangeListener(new OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
stopVideo(position);
}
@Override
public void onPageSelected(int position) {
Log.e("--", "position:" + position);
stopVideo(position);
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
}
Aggregations