Search in sources :

Example 6 with CircleIndicator

use of me.relex.circleindicator.CircleIndicator in project CircleIndicator by ongakuer.

the class ChangeColorFragment method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    ViewPager viewpager = (ViewPager) view.findViewById(R.id.viewpager);
    CircleIndicator indicator = (CircleIndicator) view.findViewById(R.id.indicator);
    viewpager.setAdapter(new SamplePagerAdapter());
    indicator.setViewPager(viewpager);
}
Also used : CircleIndicator(me.relex.circleindicator.CircleIndicator) ViewPager(android.support.v4.view.ViewPager) SamplePagerAdapter(me.relex.circleindicator.sample.SamplePagerAdapter)

Example 7 with CircleIndicator

use of me.relex.circleindicator.CircleIndicator in project CircleIndicator by ongakuer.

the class DynamicAdapterFragment method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    view.findViewById(R.id.add).setOnClickListener(this);
    view.findViewById(R.id.remove).setOnClickListener(this);
    mAdapter = new SamplePagerAdapter(1) {

        @Override
        public int getItemPosition(Object object) {
            return POSITION_NONE;
        }
    };
    ViewPager viewpager = (ViewPager) view.findViewById(R.id.viewpager);
    CircleIndicator indicator = (CircleIndicator) view.findViewById(R.id.indicator);
    viewpager.setAdapter(mAdapter);
    indicator.setViewPager(viewpager);
    mAdapter.registerDataSetObserver(indicator.getDataSetObserver());
}
Also used : CircleIndicator(me.relex.circleindicator.CircleIndicator) ViewPager(android.support.v4.view.ViewPager) SamplePagerAdapter(me.relex.circleindicator.sample.SamplePagerAdapter)

Aggregations

CircleIndicator (me.relex.circleindicator.CircleIndicator)7 ViewPager (android.support.v4.view.ViewPager)6 SamplePagerAdapter (me.relex.circleindicator.sample.SamplePagerAdapter)6 View (android.view.View)2 Intent (android.content.Intent)1 FragmentPagerAdapter (android.support.v13.app.FragmentPagerAdapter)1 LoopViewPager (com.imbryk.viewPager.LoopViewPager)1 TutorialAdapter (com.xabber.android.ui.adapter.TutorialAdapter)1