Search in sources :

Example 1 with RecyclerIndicatorView

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

the class YearActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_year);
    ViewPager viewPager = (ViewPager) findViewById(R.id.year_viewPager);
    Indicator indicator = (RecyclerIndicatorView) findViewById(R.id.year_indicator);
    int selectColorId = Color.parseColor("#f8f8f8");
    int unSelectColorId = Color.parseColor("#010101");
    indicator.setOnTransitionListener(new OnTransitionTextListener().setColor(selectColorId, unSelectColorId));
    indicator.setScrollBar(new SpringBar(getApplicationContext(), Color.GRAY));
    viewPager.setOffscreenPageLimit(4);
    indicatorViewPager = new IndicatorViewPager(indicator, viewPager);
    indicatorViewPager.setAdapter(new YearAdapter(1800, 10000000));
    indicatorViewPager.setCurrentItem(2016 - 1800, 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) Indicator(com.shizhefei.view.indicator.Indicator) RecyclerIndicatorView(com.shizhefei.view.indicator.RecyclerIndicatorView)

Example 2 with RecyclerIndicatorView

use of com.shizhefei.view.indicator.RecyclerIndicatorView 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

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