Search in sources :

Example 6 with Indicator

use of com.shizhefei.view.indicator.Indicator in project ViewPagerIndicator by LuckyJayce.

the class GuideActivity method onCreate.

@Override
protected void onCreate(Bundle arg0) {
    super.onCreate(arg0);
    setContentView(R.layout.activity_guide);
    //ViewPager,Indicator
    ViewPager viewPager = (ViewPager) findViewById(R.id.guide_viewPager);
    Indicator indicator = (Indicator) findViewById(R.id.guide_indicator);
    indicatorViewPager = new IndicatorViewPager(indicator, viewPager);
    inflate = LayoutInflater.from(getApplicationContext());
    indicatorViewPager.setAdapter(adapter);
    Toast.makeText(getApplicationContext(), "6秒后更新界面适配器", Toast.LENGTH_SHORT).show();
    new Thread() {

        @Override
        public void run() {
            super.run();
            try {
                Thread.sleep(6000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            runOnUiThread(new Runnable() {

                @Override
                public void run() {
                    images = new int[] { R.drawable.p3, R.drawable.p4 };
                    adapter.notifyDataSetChanged();
                }
            });
        }
    }.start();
}
Also used : IndicatorViewPager(com.shizhefei.view.indicator.IndicatorViewPager) IndicatorViewPager(com.shizhefei.view.indicator.IndicatorViewPager) ViewPager(android.support.v4.view.ViewPager) Indicator(com.shizhefei.view.indicator.Indicator)

Aggregations

ViewPager (android.support.v4.view.ViewPager)6 Indicator (com.shizhefei.view.indicator.Indicator)6 IndicatorViewPager (com.shizhefei.view.indicator.IndicatorViewPager)6 OnTransitionTextListener (com.shizhefei.view.indicator.transition.OnTransitionTextListener)4 ColorBar (com.shizhefei.view.indicator.slidebar.ColorBar)3 SpringBar (com.shizhefei.view.indicator.slidebar.SpringBar)2 Resources (android.content.res.Resources)1 Bundle (android.os.Bundle)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 PagesAdapter (com.shizhefei.test.view.adapters.PagesAdapter)1 BannerComponent (com.shizhefei.view.indicator.BannerComponent)1 RecyclerIndicatorView (com.shizhefei.view.indicator.RecyclerIndicatorView)1 ScrollIndicatorView (com.shizhefei.view.indicator.ScrollIndicatorView)1 LayoutBar (com.shizhefei.view.indicator.slidebar.LayoutBar)1