Search in sources :

Example 1 with CircleNavigator

use of net.lucode.hackware.magicindicator.buildins.circlenavigator.CircleNavigator in project MagicIndicator by hackware1993.

the class CustomNavigatorExampleActivity method initMagicIndicator2.

private void initMagicIndicator2() {
    MagicIndicator magicIndicator = (MagicIndicator) findViewById(R.id.magic_indicator2);
    CircleNavigator circleNavigator = new CircleNavigator(this);
    circleNavigator.setFollowTouch(false);
    circleNavigator.setCircleCount(CHANNELS.length);
    circleNavigator.setCircleColor(Color.RED);
    circleNavigator.setCircleClickListener(new CircleNavigator.OnCircleClickListener() {

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

Example 2 with CircleNavigator

use of net.lucode.hackware.magicindicator.buildins.circlenavigator.CircleNavigator in project MagicIndicator by hackware1993.

the class CustomNavigatorExampleActivity method initMagicIndicator1.

private void initMagicIndicator1() {
    MagicIndicator magicIndicator = (MagicIndicator) findViewById(R.id.magic_indicator1);
    CircleNavigator circleNavigator = new CircleNavigator(this);
    circleNavigator.setCircleCount(CHANNELS.length);
    circleNavigator.setCircleColor(Color.RED);
    circleNavigator.setCircleClickListener(new CircleNavigator.OnCircleClickListener() {

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

Aggregations

MagicIndicator (net.lucode.hackware.magicindicator.MagicIndicator)2 CircleNavigator (net.lucode.hackware.magicindicator.buildins.circlenavigator.CircleNavigator)2 ScaleCircleNavigator (net.lucode.hackware.magicindicatordemo.ext.navigator.ScaleCircleNavigator)2