Need help with CircleIndicator?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

ongakuer
3.9K Stars 701 Forks Apache License 2.0 118 Commits 21 Opened issues

Description

A lightweight indicator like in nexus 5 launcher

Services available

!
?

Need anything else?

Contributors list

# 56,923
Java
21 commits
# 33,635
dagger2
mvvm-ar...
android...
Java
2 commits
# 178,097
Java
instrum...
Kotlin
Shell
2 commits
# 171,884
Swift
GitHub ...
GitHub
Shell
2 commits
# 232,378
Kotlin
Java
Shell
image-p...
1 commit
# 40,612
Python
C
telegra...
google-...
1 commit
# 217,367
Java
1 commit
# 32,915
Java
exoplay...
Android
Kotlin
1 commit

CircleIndicator

A lightweight indicator like in nexus 5 launcher

Download

Maven Central

Gradle

AndroidX
dependencies {
    implementation 'me.relex:circleindicator:2.1.6'
}
Android Support Library
dependencies {
    implementation 'me.relex:circleindicator:1.3.2'
}

Usage

| Class | Widget | | --------------------------------------------- | ----------------------------- | | me.relex.circleindicator.CircleIndicator | ViewPager | | me.relex.circleindicator.CircleIndicator2 | RecyclerView | | me.relex.circleindicator.CircleIndicator3 | ViewPager2 (AndroidX) |

ViewPager (CircleIndicator)
ViewPager viewpager = (ViewPager) view.findViewById(R.id.viewpager);
viewpager.setAdapter(adapter);

CircleIndicator indicator = (CircleIndicator) view.findViewById(R.id.indicator); indicator.setViewPager(viewpager);

// optional adapter.registerDataSetObserver(indicator.getDataSetObserver());

RecyclerView (CircleIndicator2)
RecyclerView recyclerView = view.findViewById(R.id.recycler_view);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(adapter);

PagerSnapHelper pagerSnapHelper = new PagerSnapHelper(); pagerSnapHelper.attachToRecyclerView(recyclerView);

CircleIndicator2 indicator = view.findViewById(R.id.indicator); indicator.attachToRecyclerView(recyclerView, pagerSnapHelper);

// optional adapter.registerAdapterDataObserver(indicator.getAdapterDataObserver());

ViewPager2 (CircleIndicator3)
ViewPager2 viewpager = view.findViewById(R.id.viewpager);
viewpager.setAdapter(mAdapter);

CircleIndicator3 indicator = view.findViewById(R.id.indicator); indicator.setViewPager(viewpager);

// optional adapter.registerAdapterDataObserver(indicator.getAdapterDataObserver());

Manual control
CircleIndicator indicator = view.findViewById(R.id.indicator);
indicator.createIndicators(5,0);

indicator.animatePageSelected(2)

XML Properties


| Properties | Default Value | | ----------------------------- | ----------------------------- | | app:ciwidth | 5dp | | app:ciheight | 5dp | | app:cimargin | 5dp | | app:cidrawable | R.drawable.whiteradius | | app:cidrawableunselected | R.drawable.whiteradius | | app:cianimator | R.animator.scalewithalpha | | app:cianimatorreverse | 0 | | app:ciorientation | horizontal | | app:ci_gravity | center |

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.