Popularity
1.8
Declining
Activity
0.0
Stable
41
3
12

Description

A simple library to add indicators for your Carousel or ViewPagers.

Code Quality Rank: L5
Programming language: Java
License: Apache License 2.0
Tags: Animations     ViewPager     Views     Carousel    
Latest version: v1.25

IndicatorView alternatives and similar packages

Based on the "Animations" category.
Alternatively, view IndicatorView alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of IndicatorView or a related project?

Add another 'Animations' Package

README

IndicatorView

Build Status Android Arsenal

A simple library to add indicators for your Carousel or ViewPagers.

Download

Step 1. Add the JitPack repository to your build file

Gradle

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Maven
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Step 2. Add the dependency

Gradle
dependencies{
    compile 'com.github.Kshitij-Jain:IndicatorView:1.25'
}

Maven
<dependency>
    <groupId>com.github.Kshitij-Jain</groupId>
    <artifactId>IndicatorView</artifactId>
    <version>1.25</version>
</dependency>

Usage

Include following code in your layout:

<io.github.kshitij_jain.indicatorview.IndicatorView
            android:id="@+id/circle_indicator_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_gravity="center"/>

Include following code in your activity:

IndicatorView mIndicatorView = (IndicatorView) findViewById(R.id.circle_indicator_view);
mIndicatorView.setPageIndicators(4);
mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
       @Override
       public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
       }

       @Override
       public void onPageSelected(int position) {
            mIndicatorView.setCurrentPage(position);
       }

       @Override
       public void onPageScrollStateChanged(int state) {
       }
});
Supported xml attributes:
 app:activeColor="@color/colorPrimary" // Set Active Indicator Color
 app:inactiveColor="@color/colorAccent" // Set Inactive Indicator Color
 app:indicatorSize="6dp" // Set Indicator Size (Default 8dp)
Other supported methods:
 mIndicatorView.setActiveIndicatorColor(R.color.colorAccent); // Set Active Indicator Color
 mIndicatorView.setInactiveIndicatorColor(R.color.colorPrimary); // Set Inactive Indicator Color

License

Copyright 2017 Kshitij Jain

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


*Note that all licence references and agreements mentioned in the IndicatorView README section above are relevant to that project's source code only.