A lightweight indicator like in nexus 5 launcher

Overview

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

<me.relex.circleindicator.CircleIndicator
	android:id="@+id/indicator"
	android:layout_width="match_parent"
	android:layout_height="48dp"/>
Properties Default Value
app:ci_width 5dp
app:ci_height 5dp
app:ci_margin 5dp
app:ci_drawable R.drawable.white_radius
app:ci_drawable_unselected R.drawable.white_radius
app:ci_animator R.animator.scale_with_alpha
app:ci_animator_reverse 0
app:ci_orientation horizontal
app:ci_gravity center
Comments
  • Dot not changing on page change

    Dot not changing on page change

    I'm fairly certain I've implemented everything as required, working off the sample with defaultIndicator. But when I change pages, the dots don't change along.

    I'm working within a Fragment, in onViewCreated:

    CircleIndicator pagerIndicator = (CircleIndicator) view.findViewById(R.id.pager_indicator); pagerIndicator.setViewPager(pager);

    I think that's all that is required besides the XML implementation in the view? Or am I missing something?

    opened by aeroperf 12
  • 发现内存泄露

    发现内存泄露

    在项目中LeakCanary检测了内存泄露 使用场景:CircleIndicator搭配ViewPager作为RecyclerView的一个Item

    • Retaining: 4.0 KB.
    • Reference Key: 355d4985-ef1f-4d93-a3ff-6d7cd0a8d2e1
    • Device: OnePlus ONEPLUS A0001 A0001
    • Android Version: 5.0.2 API: 21 LeakCanary: 1.4-beta1 02804f3
    • Durations: watch=5074ms, gc=208ms, heap dump=1507ms, analysis=35894ms

    In com.qingsongchou.social:1.0.3:1.

    • com.qingsongchou.social.ui.activity.project.detail.ProjectDetailSaleActivity has leaked:
    • GC ROOT android.view.Choreographer$FrameDisplayEventReceiver.this$0
    • references android.view.Choreographer.mCallbackQueues
    • references array android.view.Choreographer$CallbackQueue[].[1]
    • references android.view.Choreographer$CallbackQueue.mHead
    • references android.view.Choreographer$CallbackRecord.action
    • references android.animation.ValueAnimator$AnimationHandler.mAnimations
    • references java.util.ArrayList.array
    • references array java.lang.Object[].[0]
    • references android.animation.ObjectAnimator.mInterpolator
    • references me.relex.circleindicator.CircleIndicator$ReverseInterpolator.this$0
    • references me.relex.circleindicator.CircleIndicator.mContext
    • leaks com.qingsongchou.social.ui.activity.project.detail.ProjectDetailSaleActivity instance
    opened by doubleDragon 10
  • Bug - Unable To Import

    Bug - Unable To Import

    Hi, I've tried to import both of ur libs as dependencies. but non of them imported. I have this libs as my custom libs:

    compile 'com.android.support:appcompat-v7:21.0.3' compile 'com.nineoldandroids:library:2.4.0' compile 'com.daimajia.androidanimations:library:1.1.3@aar' compile 'com.joooonho:selectableroundedimageview:1.0.1'

    opened by TurKurT656 10
  • Add support for indicator click events.

    Add support for indicator click events.

    Hi,

    i needed the functionality to respond to click events on the indicators. Happy to adjust if this is not quite how you would have done it.

    Cheers Tobias

    opened by tobibo 9
  • Move away from jcenter since it'll be shutdown on May 1st 2021

    Move away from jcenter since it'll be shutdown on May 1st 2021

    https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/

    This is unfortunate, but there's not much we can do other than moving away from it.

    opened by tfcporciuncula 8
  • Any idea why my selected indicator is wider than the other circles?

    Any idea why my selected indicator is wider than the other circles?

    This is my layout:

    <me.relex.circleindicator.CircleIndicator
               android:id="@+id/banner_indicator"
               android:layout_width="wrap_content"
               android:layout_height="6dp"
               app:ci_width="6dp"
               app:ci_height="6dp"
               app:ci_orientation="horizontal"
               android:layout_marginTop="4dp"
               app:layout_constraintLeft_toLeftOf="@+id/banner_pager"
               app:layout_constraintRight_toRightOf="@+id/banner_pager"
               app:layout_constraintTop_toBottomOf="@+id/banner_pager"/>
    

    And this is what it ends up looking like:

    image

    opened by casolorz 7
  • indicator不显示

    indicator不显示

    <me.relex.circleindicator.CircleIndicator
                android:id="@+id/yf_indicator"
                android:layout_width="match_parent"
                android:layout_height="40dp"
                android:layout_gravity="bottom" />
    
            <me.relex.circleindicator.CircleIndicator
                android:id="@+id/yf_indicator"
                android:layout_width="match_parent"
                android:layout_height="40dp"
                android:layout_gravity="bottom"
                app:ci_animator="@animator/indicator_no_animator"
                app:ci_drawable="@drawable/white_radius"
                app:ci_drawable_unselected="@drawable/yf_gray_radius" />
    

    这两种方式,indicator都不显示

    opened by amyliu1062 7
  • Notify Circle Indicator that Viewpager was changed

    Notify Circle Indicator that Viewpager was changed

    Is there any way to notify circle indicator when my view pager is changed? Example, when i initialize viewpager and circle indicator, my viewpager just contain 0 image, but at some reason i add it so my viewpager contain 3 image. And the result is no circle indicator cz when initialize my pager didnt have any image.

    opened by huzain07 6
  • Automatically slide to the next photo

    Automatically slide to the next photo

    Is there a way to make image gallery(Let's say three photos) automatically slide to the next one?

    From Photo#1 to Photo#2 after certain seconds, From Photo#2 to Photo#3 after certain seconds,

    And Photo#3 to Photo #1 after certain seconds, From Photo#1 to Photo #2 after certain seconds, ,,,, ,,,, infinite

    opened by kogisin 5
  • Selected dot with dynamic add/remove page

    Selected dot with dynamic add/remove page

    First of all, thank you for sharing your work, this material circle indicator is really quite cool ;)

    I would like to let you an issue about the selected state of the CircleIndicator with the use of a dynamic viewpager.

    Despite the fact that I have to call the setViewPager() method each time I notify my adapter that the data size has changed to avoid an exception, I also have another problem which can also be bypassed by another method call.

    Here is the concerned use of CircleIndicator :

    mPagerAdapter.add(object); // dynamic add of an object
    mPagerAdapter.notifyDataSetChanged(); // notify the data change
    mPagerIndicator.setViewPager(mImagesPager); // reset the viewpager to the indicator
    mViewPager.setCurrentItem(0, false); // set the current item to the first position
    mViewPager.setCurrentItem(mPagerAdapter.getCount()-1, false); // set the current item to the wanted position (the last added object)
    

    The question is : why do I set the item to the position 0 just before setting it to wanted position ? Because it permits me to avoid the following bug : the wanted position in a selected state AND also the first one. If I directly set the wanted position, I don't know why (for the moment, I will take time to read the CircleIndicator class) but the first indicator will always be selected.

    Thanks in advance for your answer !

    opened by HappyDr0id 5
  • Crashes when the ViewPager is empty

    Crashes when the ViewPager is empty

     java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setBackgroundResource(int)' on a null object reference
                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2411)
                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2470)
                at android.app.ActivityThread.-wrap11(ActivityThread.java)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1343)
                at android.os.Handler.dispatchMessage(Handler.java:102)
                at android.os.Looper.loop(Looper.java:148)
                at android.app.ActivityThread.main(ActivityThread.java:5401)
                at java.lang.reflect.Method.invoke(Native Method)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:725)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:615)
    
    opened by fahimk 5
  • Changing the size of the indicator icon

    Changing the size of the indicator icon

    I am used ViewPager2 and CircleIndicator 3 for my image slider but the size of the unselected and selected icons isn't equal.

    image

    This is my code:

    <me.relex.circleindicator.CircleIndicator3
            android:layout_width="match_parent"
            android:layout_height="30dp"
            android:layout_gravity="center"
            app:ci_drawable="@drawable/ic_indicator"
            app:ci_drawable_unselected="@drawable/ic_indicator_unselected"
            app:ci_height="8dp"
            app:ci_width="8dp"
            app:ci_margin="8dp"/>
    

    Anyone knows how to set size for the indicator icons? Any help will be appreciated. Thanks!

    opened by dukay159 2
  • Gradle Implementation of CircularIndicator not working in minSdk 23

    Gradle Implementation of CircularIndicator not working in minSdk 23

    I am trying to use Circular Indicator, so I wrote the dependencies as stated, implementation 'me.relex:cirleindicator:2.1.6'

    But when I am trying to sync and rebuild project, the android studio is throwing error:-

    `1: Task failed with an exception.

    • What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find me.relex:cirleindicator:2.1.6. Searched in the following locations: - https://dl.google.com/dl/android/maven2/me/relex/cirleindicator/2.1.6/cirleindicator-2.1.6.pom - https://repo.maven.apache.org/maven2/me/relex/cirleindicator/2.1.6/cirleindicator-2.1.6.pom Required by: project :app

    • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

    2: Task failed with an exception.

    • What went wrong: Execution failed for task ':app:mergeDebugResources'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find me.relex:cirleindicator:2.1.6. Searched in the following locations: - https://dl.google.com/dl/android/maven2/me/relex/cirleindicator/2.1.6/cirleindicator-2.1.6.pom - https://repo.maven.apache.org/maven2/me/relex/cirleindicator/2.1.6/cirleindicator-2.1.6.pom Required by: project :app

    • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

    3: Task failed with an exception.

    • What went wrong: Execution failed for task ':app:processDebugMainManifest'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find me.relex:cirleindicator:2.1.6. Searched in the following locations: - https://dl.google.com/dl/android/maven2/me/relex/cirleindicator/2.1.6/cirleindicator-2.1.6.pom - https://repo.maven.apache.org/maven2/me/relex/cirleindicator/2.1.6/cirleindicator-2.1.6.pom Required by: project :app

    • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

    4: Task failed with an exception.

    • What went wrong: Execution failed for task ':app:mergeDebugAssets'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find me.relex:cirleindicator:2.1.6. Searched in the following locations: - https://dl.google.com/dl/android/maven2/me/relex/cirleindicator/2.1.6/cirleindicator-2.1.6.pom - https://repo.maven.apache.org/maven2/me/relex/cirleindicator/2.1.6/cirleindicator-2.1.6.pom Required by: project :app

    • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

    5: Task failed with an exception.

    • What went wrong: Execution failed for task ':app:checkDebugDuplicateClasses'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find me.relex:cirleindicator:2.1.6. Searched in the following locations: - https://dl.google.com/dl/android/maven2/me/relex/cirleindicator/2.1.6/cirleindicator-2.1.6.pom - https://repo.maven.apache.org/maven2/me/relex/cirleindicator/2.1.6/cirleindicator-2.1.6.pom Required by: project :app

    • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

    6: Task failed with an exception.

    • What went wrong: Execution failed for task ':app:desugarDebugFileDependencies'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find me.relex:cirleindicator:2.1.6. Searched in the following locations: - https://dl.google.com/dl/android/maven2/me/relex/cirleindicator/2.1.6/cirleindicator-2.1.6.pom - https://repo.maven.apache.org/maven2/me/relex/cirleindicator/2.1.6/cirleindicator-2.1.6.pom Required by: project :app

    • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

    7: Task failed with an exception.

    • What went wrong: Execution failed for task ':app:mergeDebugNativeLibs'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find me.relex:cirleindicator:2.1.6. Searched in the following locations: - https://dl.google.com/dl/android/maven2/me/relex/cirleindicator/2.1.6/cirleindicator-2.1.6.pom - https://repo.maven.apache.org/maven2/me/relex/cirleindicator/2.1.6/cirleindicator-2.1.6.pom Required by: project :app

    • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

    • Get more help at https://help.gradle.org

    BUILD FAILED in 2s`

    opened by TheTanmay1 0
  • There isn't any scroll if indicators count more then the screen able to fit

    There isn't any scroll if indicators count more then the screen able to fit

    For example. In my case, it can be 65+ items.

    The active indicator will not be shown until the half of items will be passed. Then it appears, passes the screen to the end, and disappears again

    opened by DanManDKo 0
  • Gone selected indicator

    Gone selected indicator

    Hi! I have 20 pages on a screen, I can show only 16 dots by the task of design. The current issue, when it starts, I can't see the selected dot -> when I swiped a couple of times my view pager if be more precise - swiped four times and saw selected indicator on the first display dot. When I swiped more than qty indicators display, the selected indicator is gone. Could you help me? How can I fix this situation?

    opened by AndryKorry 1
Releases(v2.1.6)
Owner
relex
relex
Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.

Android ViewPagerIndicator Paging indicator widgets that are compatible with the ViewPager from the Android Support Library to improve discoverability

Jake Wharton 10.2k Jan 3, 2023
A rubber indicator

RubberIndicator A rubber indicator for ViewPager Designed by Valentyn Khenkin Here is the CSS version Usage The attributes for RubberIndicator are not

Fei Liang 1.6k Dec 16, 2022
An interactive indicator to navigate between the different pages of a ViewPager

Android PagerSlidingTabStrip (default Material Design) This library is not maintained anymore and there will be no further releases. For most of the c

JPARDOGO 2.2k Jan 4, 2023
A Page Indicator Lib is realized in a different way.

#FlycoPageIndicator A Page Indicator Lib is realized in a different way. Support for Android 2.2 and up. ##Demo ####Here is a DemoApk download ##Gradl

Flyco 537 Dec 17, 2022
Android - A ViewPager page indicator that displays the current page number and (optionally) the page count

NumericPageIndicator A ViewPager page indicator that displays the current page number and (optionally) the page count. It can also display buttons to

Manuel Peinado Gallego 253 Nov 16, 2022
Pager (especially for ViewPager) indicator in two styles: circle & fraction.

PagerIndicator Pager (especially for ViewPager) indicator in two styles: circle & fraction. Demo circle fraction Dependency implementation 'me.liangfe

Fei Liang 212 Nov 28, 2022
Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.

Android ViewPagerIndicator Paging indicator widgets that are compatible with the ViewPager from the Android Support Library to improve discoverability

Jake Wharton 10.2k Jan 5, 2023
Pager (especially for ViewPager) indicator in two styles: circle & fraction.

PagerIndicator Pager (especially for ViewPager) indicator in two styles: circle & fraction. Demo circle fraction Dependency implementation 'me.liangfe

Fei Liang 212 Nov 28, 2022
A lightweight indicator like in nexus 5 launcher

CircleIndicator A lightweight indicator like in nexus 5 launcher Gradle AndroidX dependencies { implementation 'me.relex:circleindicator:2.1.6' }

relex 4.1k Dec 30, 2022
Pixel Launcher Mods a root app for Android 12+ that enables you to add a number of features to the stock Pixel Launcher

A root app that enables you to add a number of features to the stock Pixel Launcher, without needing Xposed

Kieron Quinn 430 Jan 2, 2023
Gradle Plugin for publishing artifacts to Sonatype and Nexus

Introduction Due to Sonatype's strict validation rules, the publishing requirement must be satisfied by every artifact which wants to be published to

Johnson Lee 21 Oct 14, 2022
Step by step,just use HorizontalStepView,VerticalStepView. step indicator,flow indicator,timeline,order process,express status

StepView Step by step. Step indicator. Flow indicator。 snapshot like this:HorizontalStepView like this also like this:VerticalStepView Yeah,I am not w

baoyachi. Aka Rust Hairy crabs 4.1k Dec 30, 2022
A lightweight circular indicator view library for Android

A lightweight circular indicator view library for Android

İbrahim Süren 241 Dec 30, 2022
A spring indicator like Morning Routine guide.

SpringIndicator An indicator like Morning Routine guide.It was originally based on BezierDemo. The sample app: click me #Usage Add the dependency to y

null 2.4k Feb 21, 2022
Android-ScrollBarPanel allows to attach a View to a scroll indicator like it's done in Path 2.0

Path 2.0 like ScrollBarPanel for Android Android-ScrollBarPanel allows to attach a View to a scroll indicator like it's done in Path 2.0. Features Sup

Arnaud Vallat 551 Dec 22, 2022
MaterialLoadingProgressBar provide a styled ProgressBar which looks like SwipeRefreshLayout's loading indicator(support-v4 v21+)

MaterialLoadingProgressBar MaterialLoadingProgressBar provide a styled ProgressBar which looks like SwipeRefreshLayout's loading indicator(support-v4

lsjwzh 1.1k Nov 19, 2022
A 'Google Fit' like activity indicator for Android

WheelIndicatorView A 'Google Fit' like activity indicator for Android Screenshots Usage How to use: Add a "WheelIndicatorView" in the layout editor li

David Lázaro 396 Nov 25, 2022
Indicator like tachometer View Library for Android

Tachometer Android Indicator like tachometer View Library for Android GIF Sample Preview Setup Step 1. Add Jitpack repository to your project build.gr

null 1 Jul 28, 2022
Library to change Android launcher App Icon and App Name programmatically !

AppIconNameChanger Change Android App launcher Icon and App Name programmatically ! Download Demo APK from HERE Kindly use the following links to use

Prabhakar Thota 587 Dec 29, 2022
Pixel Launcher for everyone!

Flick Launcher Flick Launcher is a project started by Michele Lacorte. I want to create a launcher for google pixels style stock, with a few tweaks. O

Michele Lacorte 284 Dec 20, 2022