use of me.relex.circleindicator.Config in project CircleIndicator by ongakuer.
the class CustomAnimationFragment method onViewCreated.
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
int indicatorWidth = (int) (TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, getResources().getDisplayMetrics()) + 0.5f);
int indicatorHeight = (int) (TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 4, getResources().getDisplayMetrics()) + 0.5f);
int indicatorMargin = (int) (TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 6, getResources().getDisplayMetrics()) + 0.5f);
ViewPager viewpager = view.findViewById(R.id.viewpager);
CircleIndicator indicator = view.findViewById(R.id.indicator);
Config config = new Config.Builder().width(indicatorWidth).height(indicatorHeight).margin(indicatorMargin).animator(R.animator.indicator_animator).animatorReverse(R.animator.indicator_animator_reverse).drawable(R.drawable.black_radius_square).build();
indicator.initialize(config);
viewpager.setAdapter(new SamplePagerAdapter());
indicator.setViewPager(viewpager);
}
Aggregations