PageIndicatorView

项目地址: romandanylyk/PageIndicatorView
简介:An page indicator for Android ViewPager

PageIndicatorView

PageIndicatorView will simplify your life while you working with Android ViewPager and need to indicate selected page. It's easy to setup and customize as you need with run-time preview rendering.

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 independencies section of your project build.gradle.

See latest library version 

compile 'com.romandanylyk:pageindicatorview:X.X.X'

Keep in mind, that PageIndicatorView has min API level 14

Usage Sample

During implementation of PageIndicatorView I tried to make it's setup as easy as possible. After you set adapter to your ViewPager, all you need to do is to setViewPager() and that's it! PageIndicatorView will get count from your adapter and start working with instance of your ViewPager automatically.

ViewPager viewPager = (ViewPager) findViewById(R.id.viewPager);
viewPager.setAdapter(adapter);
//instance of android.support.v4.view.PagerAdapter adapterPageIndicatorView pageIndicatorView = (PageIndicatorView) view.findViewById(R.id.pageIndicatorView);
pageIndicatorView.setViewPager(viewPager);

Keep in mind that all public methods are also exist as attributes, so you can even setup and customize page indicator without any java code.

    <com.rd.PageIndicatorViewandroid:id="@+id/pageIndicatorView"android:layout_width="wrap_content"android:layout_height="wrap_content"attrs:piv_viewPager="@id/viewPager"/>

Customization

One of the most important feature of every custom view is ability to customize its look as user need. By calling the following methods (or attributes) you will be able to customize PageIndicatorView as you need.

//set size
setCount(int count)
setDynamicCount(boolean dynamicCount)setRadius(int radiusDp)
setPadding(int paddingDp)//set color
setUnselectedColor(int color)
setSelectedColor(int color)//set animation
setAnimationDuration(long duration)
setAnimationType(AnimationType type)
setInteractiveAnimation(boolean isInteractive)//set selection
setProgress(int selectingPosition, float progress)
setSelection(int position)

Here you can see all the animations PageIndicatorView support.

Name Support version Preview
AnimationType.NONE 0.0.1
AnimationType.COLOR 0.0.1
AnimationType.SCALE 0.0.1
AnimationType.SLIDE 0.0.1
AnimationType.WORM 0.0.1

Release Note

See release notes on github releases or Bintray release notes.

PageIndicatorView相关推荐

  1. 最新最全的 Android 开源项目合集(一)

    原文链接:https://github.com/opendigg/awesome-github-android-ui 抽屉菜单 MaterialDrawer ★7337 - 安卓抽屉效果实现方案 Si ...

  2. [Android Pro] AndroidX重构和映射

    原文地址:https://developer.android.com/topic/libraries/support-library/refactor https://blog.csdn.net/ch ...

  3. Android 开源优秀 Library 推荐

    之后的每月会推荐一些优秀的开源 Android libraries,不仅仅是学习,也可以方便的使用到项目中,避免重复的造轮子. PageIndicatorView 如果你需要在 ViewPager 中 ...

  4. Android开发技术周报 Issue#101

    新闻 [视频]Android版Google Assistant已流出:体验方法如下 Android 7.1 Nougat正式版定于今年12月到来 教程 理解Android进程启动之全过程 Androi ...

  5. GitHub 上受欢迎的 Android UI Library 整理(一)

    内容较多,可以用 ctrl+F 来搜索 抽屉菜单 https://github.com/mikepenz/MaterialDrawer ★7337 - 安卓抽屉效果实现方案 https://githu ...

  6. Github常用框架集合

    Script桥接 https://github.com/JackyAndroid/AndroidChromium ★1476 - 谷歌浏览器安卓版源码项目 https://github.com/The ...

  7. GitHub 上受欢迎的 Android UI Library 整理

    抽屉菜单 https://github.com/mikepenz/MaterialDrawer ★7337 - 安卓抽屉效果实现方案 https://github.com/Yalantis/Side- ...

  8. GitHub 上受欢迎的 Android UI Library(part_one)

    抽屉菜单 https://github.com/mikepenz/MaterialDrawer ★7337 - 安卓抽屉效果实现方案 https://github.com/Yalantis/Side- ...

  9. 最新最全的Android开源项目集合(转)

    抽屉菜单 MaterialDrawer ★7337 - 安卓抽屉效果实现方案 Side-Menu.Android ★3865 - 创意边侧菜单 FlowingDrawer ★1744 - 向右滑动流动 ...

最新文章

  1. DateEdit如果开启Vista模式并显示日期+时间模式
  2. Win10中VMware14安装CentOS7详细步骤
  3. 【已解决】查看Python中已经安装的包
  4. 虚拟现实大潮渐近:Oculus VR、EA和Avegant等多家公司...
  5. asp ado 连接测试_ASP.NET Core 简介
  6. 七牛云异步抓取java_带你玩转七牛云存储——高级篇
  7. 电脑用电量_为什么换了智能电表后,我家用电量一下子多了这么多呢?
  8. optistruct线性求解一次二次单元应力位移比较
  9. udp java 实例_udp例子,javaudp简单实例分享
  10. NI MultiSim 正版软件的下载链接
  11. 戴尔服务器系统备份还原工具,DELL备份恢复系统的小工具 Dell DataSafe Local Backup[网络技术]...
  12. 如何使用手机打开CAJ文件?
  13. 网站分析-网站流量分析
  14. js将金额转为大写汉字
  15. X Lossless Decoder for mac(XLD无损音频转码软件)
  16. java 验证手机号码、电话号码(包括最新的电信、联通和移动号码) 1
  17. Driller源码阅读笔记(二)
  18. 利用Redis原子计数器incr实现计数器及接口限流
  19. 上位机.net大佬博客大全-菜鸟学习上位机C#那些事儿
  20. 第一行代码——第十三章:继续进阶——你还应该掌握的高级技巧

热门文章

  1. Excel批量一键切换英文字母大小写
  2. mysql对时间范围的查询
  3. SegmentFault 思否发布开源问答社区软件 Answer
  4. JavaApplet运行
  5. 【Java.JMS】一个简单的JMS实例
  6. 【转】Principles of User Interface Design
  7. c++ stl栈容器stack用法介绍
  8. 《产品管理精华》目录
  9. http——学习记录
  10. 计算机网络常见名词及其解释