All Projects → romandanylyk → Pageindicatorview

romandanylyk / Pageindicatorview

An page indicator for Android ViewPager

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Pageindicatorview

ArcPageIndicator
Android Page Indicator for ViewPager with original animations. It uses an ellipse to dispose indication spots, and can draw a hand, like in old elevators.
Stars: ✭ 73 (-98.38%)
Mutual labels:  viewpager, viewpager-indicator, viewpagerindicator
react-native-viewpager-indicator
修改自react-native-scrollable-tab-view,增加了根据文字内容适配下划线长度的功能。
Stars: ✭ 52 (-98.84%)
Mutual labels:  viewpager, viewpager-indicator, viewpagerindicator
IndicatorView
IndicatorView Library For Android
Stars: ✭ 41 (-99.09%)
Mutual labels:  viewpager, viewpager-indicator
Magicindicator
A powerful, customizable and extensible ViewPager indicator framework. As the best alternative of ViewPagerIndicator, TabLayout and PagerSlidingTabStrip —— 强大、可定制、易扩展的 ViewPager 指示器框架。是ViewPagerIndicator、TabLayout、PagerSlidingTabStrip的最佳替代品。支持角标,更支持在非ViewPager场景下使用(使用hide()、show()切换Fragment或使用setVisibility切换FrameLayout里的View等),http://www.jianshu…
Stars: ✭ 8,969 (+99.4%)
Mutual labels:  viewpager, viewpagerindicator
Dotsindicator
Three material Dots Indicators for view pagers in Android !
Stars: ✭ 2,447 (-45.6%)
Mutual labels:  viewpager, viewpager-indicator
stepper-indicator
Step indicator for onboarding or simple viewpager
Stars: ✭ 180 (-96%)
Mutual labels:  viewpager, viewpager-indicator
UnderlinePageIndicator
Paging indicator widget compatible with the ViewPager
Stars: ✭ 65 (-98.55%)
Mutual labels:  viewpager, viewpager-indicator
MultiIndicator
多功能指示器,适用于ViewPager 多场景
Stars: ✭ 44 (-99.02%)
Mutual labels:  viewpager, viewpager-indicator
LoopBanner
一个简单好用且超轻量的自动轮播控件,支持UI风格完全自定义
Stars: ✭ 56 (-98.76%)
Mutual labels:  viewpager, viewpager-indicator
Loopingviewpager
A ViewPager and PagerAdapter combination that support auto scroll, infinite loop and page indicators.
Stars: ✭ 310 (-93.11%)
Mutual labels:  viewpager
Viewpagerindicator
一个简单好用的ViewPagerIndicator,提供了六种类型,为viewpager添加酷炫效果,并且支持轮播图( A simple, cool, customizable ViewPagerIndicator.show cool indicator for viewpager , it also good for viewpager as carousel )
Stars: ✭ 366 (-91.86%)
Mutual labels:  viewpager
Flowhelper
帮助您迅速构建顶部Tab,比如今日头条效果,热搜、搜索记录、与ViewPager/ViewPager2搭配的工具类;
Stars: ✭ 295 (-93.44%)
Mutual labels:  viewpager
Offsetanimator
Animations driven by finger movement
Stars: ✭ 317 (-92.95%)
Mutual labels:  viewpager
Adapter
A quick adapter library for RecyclerView, GridView, ListView, ViewPager, Spinner
Stars: ✭ 376 (-91.64%)
Mutual labels:  viewpager
Cardslideview
一行代码实现ViewPager卡片效果,比ViewPager2更强大,底层同样是RecyclerView
Stars: ✭ 301 (-93.31%)
Mutual labels:  viewpager
Viewpagercards
ViewPager cards inspired by Duolingo
Stars: ✭ 4,040 (-10.18%)
Mutual labels:  viewpager
Eleme Master
高仿饿了么3.0版本点餐页面
Stars: ✭ 297 (-93.4%)
Mutual labels:  viewpager
Bannerview
横幅广告图片轮播控件
Stars: ✭ 290 (-93.55%)
Mutual labels:  viewpager
Pagetransformerhelp
👍 A PageTransformer library for Android ViewPager,have some Banner styles. ViewPager 实现轮播图、实现卡片切换。
Stars: ✭ 478 (-89.37%)
Mutual labels:  viewpager
Scrollingpagerindicator
Pager indicator inspired by Instagram. Lightweight and easy to set up.
Stars: ✭ 419 (-90.68%)
Mutual labels:  viewpager

PageIndicatorView

Download Android Arsenal
API

PageIndicatorView is light library to indicate ViewPager's selected page with different animations and ability to customise it as you need.

Integration

To add pageindicatorview to your project, first make sure in root build.gradle you have specified the following repository:

    repositories {
        jcenter()
    }

Note: by creating new project in Android Studio it will have jcenter repository specified by default, so you will not need to add it manually.

Once you make sure you have jcenter repository in your project, all you need to do is to add the following line in dependencies section of your project build.gradle.

See latest library version Download

implementation 'com.romandanylyk:pageindicatorview:X.X.X'

If your project already use appcompat-v7 support library, you can omit PageIndicatorView dependencies by adding a single .aar file to your project, that will decrease total amount of methods used in your project.

implementation 'com.romandanylyk:pageindicatorview:X.X.X@aar'

Keep in mind, that PageIndicatorView has min API level 14 and these dependencies:

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:support-core-ui:27.1.1'

Usage Sample

Usage of PageIndicatorView is quite simple. All you need to do is to declare a view in your layout.xml and call setSelection method to select specific indicator - that's it!

PageIndicatorView pageIndicatorView = findViewById(R.id.pageIndicatorView);
        pageIndicatorView.setCount(5); // specify total count of indicators
        pageIndicatorView.setSelection(2);

But if you're as lazy as I'm - then there is another option to handle PageIndicatorView

     <com.rd.PageIndicatorView
        android:id="@+id/pageIndicatorView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        app:piv_animationType="scale"
        app:piv_dynamicCount="true"
        app:piv_interactiveAnimation="true"
        app:piv_selectedColor="@color/gray_50"
        app:piv_unselectedColor="@color/gray_300"
        app:piv_viewPager="@id/viewPager"
        attrs:piv_padding="12dp"
        attrs:piv_radius="8dp" />

All the piv_ attributes here are specific for PageIndicatorView so you can customise it as you want with attributes - pretty handy.

But what is more important here is app:piv_viewPager="@id/viewPager". What it actually do is catch up your ViewPager and automatically handles all the event's to selected the right page - so you don't need to call setSelection method on your own.

Another handy options here that works with your ViewPager as a whole is app:piv_dynamicCount="true" and app:piv_interactiveAnimation="true"

Dynamic count will automatically updates PageIndicatorView total count as you updates pages count in your ViewPager - so that's pretty useful.

While interactive animation will progress the animation process within your swipe position, which makes animation more natural and responsive to end user.

Note: Because setViewPagerId uses an instance of ViewPager, using it in recycler could lead to id conflicts, so PageIndicatorView will not know properly what is the right ViewPager to work with. Instead you should handle selected indicators on your own programatically.

  pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
            @Override
            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {/*empty*/}

            @Override
            public void onPageSelected(int position) {
                pageIndicatorView.setSelection(position);
            }

            @Override
            public void onPageScrollStateChanged(int state) {/*empty*/}
        });

Here you can see all the animations PageIndicatorView support.

Name Support version Preview
AnimationType.NONE 0.0.1 anim_none
AnimationType.COLOR 0.0.1 anim_color
AnimationType.SCALE 0.0.1 anim_scale
AnimationType.SLIDE 0.0.1 anim_slide
AnimationType.WORM 0.0.1 anim_worm
AnimationType.FILL 0.0.6 anim_worm
AnimationType.THIN_WORM 0.0.7 anim_thin_worm
AnimationType.DROP 0.1.0 anim_drop
AnimationType.SWAP 0.1.1 anim_swap

Release Note

See release notes on github releases or Bintray release notes.

License

Copyright 2017 Roman Danylyk

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 the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].