Search in sources :

Example 1 with NumIndicator

use of com.test.banner.indicator.NumIndicator 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) {
        }
    });
}
Also used : MultipleTypesAdapter(com.test.banner.adapter.MultipleTypesAdapter) NumIndicator(com.test.banner.indicator.NumIndicator) OnPageChangeListener(com.youth.banner.listener.OnPageChangeListener)

Aggregations

MultipleTypesAdapter (com.test.banner.adapter.MultipleTypesAdapter)1 NumIndicator (com.test.banner.indicator.NumIndicator)1 OnPageChangeListener (com.youth.banner.listener.OnPageChangeListener)1