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());
}
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);
}
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);
}
Aggregations