use of com.shizhefei.view.indicator.slidebar.SpringBar 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);
}
use of com.shizhefei.view.indicator.slidebar.SpringBar 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);
}
Aggregations