Search in sources :

Example 1 with ScrollIndicatorView

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

the class MoreTab2Activity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_moretab2);
    ViewPager viewPager = (ViewPager) findViewById(R.id.moretab_viewPager);
    ScrollIndicatorView scrollIndicatorView = (ScrollIndicatorView) findViewById(R.id.moretab_indicator);
    float unSelectSize = 12;
    float selectSize = unSelectSize * 1.3f;
    scrollIndicatorView.setOnTransitionListener(new OnTransitionTextListener().setColor(0xFF2196F3, Color.GRAY).setSize(selectSize, unSelectSize));
    scrollIndicatorView.setScrollBar(new ColorBar(this, 0xFF2196F3, 4));
    viewPager.setOffscreenPageLimit(2);
    indicatorViewPager = new IndicatorViewPager(scrollIndicatorView, viewPager);
    indicatorViewPager.setAdapter(new MyAdapter());
}
Also used : IndicatorViewPager(com.shizhefei.view.indicator.IndicatorViewPager) OnTransitionTextListener(com.shizhefei.view.indicator.transition.OnTransitionTextListener) IndicatorViewPager(com.shizhefei.view.indicator.IndicatorViewPager) ViewPager(android.support.v4.view.ViewPager) ScrollIndicatorView(com.shizhefei.view.indicator.ScrollIndicatorView) ColorBar(com.shizhefei.view.indicator.slidebar.ColorBar)

Example 2 with ScrollIndicatorView

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

the class SpringActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_spring);
    ViewPager viewPager = (ViewPager) findViewById(R.id.spring_viewPager);
    Indicator indicator = (ScrollIndicatorView) findViewById(R.id.spring_indicator);
    int selectColor = Color.parseColor("#f8f8f8");
    unSelectColor = Color.parseColor("#010101");
    indicator.setOnTransitionListener(new OnTransitionTextListener().setColor(selectColor, unSelectColor));
    indicator.setScrollBar(new SpringBar(getApplicationContext(), Color.GRAY));
    //        indicator.setScrollBar(new ColorBar(getApplicationContext(), Color.RED, 5));
    viewPager.setOffscreenPageLimit(4);
    indicatorViewPager = new IndicatorViewPager(indicator, viewPager);
    inflate = LayoutInflater.from(getApplicationContext());
    indicatorViewPager.setAdapter(adapter);
    indicatorViewPager.setCurrentItem(5, false);
}
Also used : SpringBar(com.shizhefei.view.indicator.slidebar.SpringBar) IndicatorViewPager(com.shizhefei.view.indicator.IndicatorViewPager) OnTransitionTextListener(com.shizhefei.view.indicator.transition.OnTransitionTextListener) IndicatorViewPager(com.shizhefei.view.indicator.IndicatorViewPager) ViewPager(android.support.v4.view.ViewPager) ScrollIndicatorView(com.shizhefei.view.indicator.ScrollIndicatorView) Indicator(com.shizhefei.view.indicator.Indicator)

Example 3 with ScrollIndicatorView

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

the class SingleTabActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_singletab);
    ScrollIndicatorView scrollIndicatorView = (ScrollIndicatorView) findViewById(R.id.singleTab_scrollIndicatorView);
    FixedIndicatorView fixedIndicatorView = (FixedIndicatorView) findViewById(R.id.singleTab_fixedIndicatorView);
    RecyclerIndicatorView recyclerIndicatorView = (RecyclerIndicatorView) findViewById(R.id.singleTab_reyclerIndicatorView);
    set(scrollIndicatorView, 16);
    set(fixedIndicatorView, 5);
    set(recyclerIndicatorView, 10000);
}
Also used : ScrollIndicatorView(com.shizhefei.view.indicator.ScrollIndicatorView) RecyclerIndicatorView(com.shizhefei.view.indicator.RecyclerIndicatorView) FixedIndicatorView(com.shizhefei.view.indicator.FixedIndicatorView)

Aggregations

ScrollIndicatorView (com.shizhefei.view.indicator.ScrollIndicatorView)3 ViewPager (android.support.v4.view.ViewPager)2 IndicatorViewPager (com.shizhefei.view.indicator.IndicatorViewPager)2 OnTransitionTextListener (com.shizhefei.view.indicator.transition.OnTransitionTextListener)2 FixedIndicatorView (com.shizhefei.view.indicator.FixedIndicatorView)1 Indicator (com.shizhefei.view.indicator.Indicator)1 RecyclerIndicatorView (com.shizhefei.view.indicator.RecyclerIndicatorView)1 ColorBar (com.shizhefei.view.indicator.slidebar.ColorBar)1 SpringBar (com.shizhefei.view.indicator.slidebar.SpringBar)1