Search in sources :

Example 1 with ScaleCircleNavigator

use of net.lucode.hackware.magicindicatordemo.ext.navigator.ScaleCircleNavigator in project MagicIndicator by hackware1993.

the class CustomNavigatorExampleActivity method initMagicIndicator3.

private void initMagicIndicator3() {
    MagicIndicator magicIndicator = (MagicIndicator) findViewById(R.id.magic_indicator3);
    ScaleCircleNavigator scaleCircleNavigator = new ScaleCircleNavigator(this);
    scaleCircleNavigator.setCircleCount(CHANNELS.length);
    scaleCircleNavigator.setNormalCircleColor(Color.LTGRAY);
    scaleCircleNavigator.setSelectedCircleColor(Color.DKGRAY);
    scaleCircleNavigator.setCircleClickListener(new ScaleCircleNavigator.OnCircleClickListener() {

        @Override
        public void onClick(int index) {
            mViewPager.setCurrentItem(index);
        }
    });
    magicIndicator.setNavigator(scaleCircleNavigator);
    ViewPagerHelper.bind(magicIndicator, mViewPager);
}
Also used : ScaleCircleNavigator(net.lucode.hackware.magicindicatordemo.ext.navigator.ScaleCircleNavigator) MagicIndicator(net.lucode.hackware.magicindicator.MagicIndicator)

Aggregations

MagicIndicator (net.lucode.hackware.magicindicator.MagicIndicator)1 ScaleCircleNavigator (net.lucode.hackware.magicindicatordemo.ext.navigator.ScaleCircleNavigator)1