Browse Tag

viewpager

Indicators library

Recently, I created a custom view, and after having used it for several of my projects, I decided to publish it as a library.

How to use it: https://github.com/Pulimet/Indicators-Library

<net.alexandroid.utils.indicators.IndicatorsView
    android:id="@+id/indicatorsView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"

    app:indicatorSize="20dp"
    app:paddingBetweenIndicators="16dp"

    app:selectedDrawable="@drawable/custom_selected"
    app:unSelectedDrawable="@drawable/custom_unselected"/>

Infinite ViewPager

MainActivity – onCreate()

...
SectionsPagerAdapter mSectionsPagerAdapter = 
        new SectionsPagerAdapter(getSupportFragmentManager(), numOfPages);
ViewPager viewPager = (ViewPager) findViewById(R.id.container_view_pager);
viewPager.setAdapter(mSectionsPagerAdapter);
viewPager.setCurrentItem(1000 * numOfPages);
...

Keep Reading