All Projects → BeppiMenozzi → ArcPageIndicator

BeppiMenozzi / ArcPageIndicator

Licence: other
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.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to ArcPageIndicator

react-native-viewpager-indicator
修改自react-native-scrollable-tab-view,增加了根据文字内容适配下划线长度的功能。
Stars: ✭ 52 (-28.77%)
Mutual labels:  viewpager, indicator, viewpager-indicator, viewpagerindicator
IndicatorView
IndicatorView Library For Android
Stars: ✭ 41 (-43.84%)
Mutual labels:  viewpager, indicator, viewpager-indicator
Scrollingpagerindicator
Pager indicator inspired by Instagram. Lightweight and easy to set up.
Stars: ✭ 419 (+473.97%)
Mutual labels:  viewpager, android-ui, indicator
MultiIndicator
多功能指示器,适用于ViewPager 多场景
Stars: ✭ 44 (-39.73%)
Mutual labels:  viewpager, indicator, viewpager-indicator
Pageindicatorview
An page indicator for Android ViewPager
Stars: ✭ 4,498 (+6061.64%)
Mutual labels:  viewpager, viewpager-indicator, viewpagerindicator
Walk-Through-Screen
This library provides easy ways to add onboarding or pager screens with different animation and indicators.
Stars: ✭ 31 (-57.53%)
Mutual labels:  viewpager, animations, indicator
Animatedbottombar
A customizable and easy to use BottomBar navigation view with sleek animations, with support for ViewPager, ViewPager2, NavController, and badges.
Stars: ✭ 797 (+991.78%)
Mutual labels:  viewpager, animations, android-ui
Dotsindicator
Three material Dots Indicators for view pagers in Android !
Stars: ✭ 2,447 (+3252.05%)
Mutual labels:  viewpager, indicator, 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 (+12186.3%)
Mutual labels:  viewpager, indicator, viewpagerindicator
Pageindicator
An Instagram like page indicator compatible with RecyclerView and ViewPager.
Stars: ✭ 236 (+223.29%)
Mutual labels:  viewpager, android-ui, indicator
Sequent
A simple continuous animation library for Android UI.
Stars: ✭ 263 (+260.27%)
Mutual labels:  material-ui, animations, android-ui
Bottomsheet
BottomSheet dialog library for Android
Stars: ✭ 219 (+200%)
Mutual labels:  material-ui, android-ui
Motion Shapeofview
Explain how to use MotionLayout with ShapeOfView
Stars: ✭ 236 (+223.29%)
Mutual labels:  material-ui, animations
Uiutil
UIUtil for Android, Lyrics, Tick animations, Comparisons, Satellite menus, Praise, Slide buttons, TAB indicators, Contact sorting, Drag sorting, Skidding deletes, Shadow effects, RecyclerView nesting RecyclerView, Map list Poi/Drawer effects, Progress settings, Clock set, Damping, Progress, Album, Snap, Progress, CircleDownload, AdvertSwitcher, Carousel ad, FlowLayout, Tag...; 歌词控件、打勾动画、对比、卫星菜单、点赞、滑动按钮、TAB指示器、联系人排序、拖曳排序、侧滑删除、阴影效果.、RecyclerView嵌套RecyclerView.、地图列表Poi/抽屉效果、进度设置、时钟设置、滑动阻尼、相册媒体快照、圆形下载进度,轮播广告, 流式布局,标签...
Stars: ✭ 1,018 (+1294.52%)
Mutual labels:  clock, indicator
SimpleSlider
A simple slider allows you to easily use.
Stars: ✭ 78 (+6.85%)
Mutual labels:  viewpager, indicator
Materialdrawer
The flexible, easy to use, all in one drawer library for your Android project. Now brand new with material 2 design.
Stars: ✭ 11,498 (+15650.68%)
Mutual labels:  material-ui, android-ui
Flipclock
FlipClock It's a minimalist page-turning clock.
Stars: ✭ 54 (-26.03%)
Mutual labels:  clock, animations
Material-BottomBarLayout
🎉A material navigation bar library which has pretty animations and different ways of arrangement.
Stars: ✭ 56 (-23.29%)
Mutual labels:  viewpager, animations
Ibackdrop
A library to simply use Backdrop in your project (make it easy). Read more ->
Stars: ✭ 137 (+87.67%)
Mutual labels:  material-ui, android-ui
TabView
TabView for Android ——Slide indicator/button/tab; 滑动指示器/按钮/TAB控件
Stars: ✭ 22 (-69.86%)
Mutual labels:  indicator, viewpager-indicator

ArcPageIndicator

Bored of the usual small points or stressed by the space occupied by a tab bar?
Try this elevator-like elegant and original page indicator! A fully customizable super-easy Page Indicator, with stunning animations and very original and discreet graphics, for Android. Needs a very small screen, perfect when many pages need to be shown and reached in a small time.


  • Out-of-the-box working indicator
  • Fully customizable and styleable
  • Can be programmatically controlled
  • Includes rather complex ellipses calculations :-)


An old elevator that inspired this project.

Setup (Gradle)

In your project's build.gradle file:

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

In your Application's or Module's build.gradle file:

dependencies {
    ...
    compile 'com.github.BeppiMenozzi:ArcPageIndicator:1.0.2'
    ...
}

Minimal usage

Layout for bottom 180° ellipse:

...
xmlns:app="http://schemas.android.com/apk/res-auto"
...
<it.beppi.arcpageindicator.ArcPageIndicator
    android:id="@+id/arc_pi"
    android:layout_width="400dp"
    android:layout_height="120dp"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    app:apiArcOrientation="toUp"
    app:apiViewPager="@id/view_pager"
    />

Layout for upper-left 90° ellipse:

...
xmlns:app="http://schemas.android.com/apk/res-auto"
...
<it.beppi.arcpageindicator.ArcPageIndicator
    android:id="@+id/arc_pi"
    android:layout_width="120dp"
    android:layout_height="120dp"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    app:apiArcOrientation="toDownRight"
    app:apiViewPager="@id/view_pager"
    />

Attributes description

List of attributes with description:

General
apiViewPagerThe ViewPager associated to the Indicator
Arc appearance
apiArcOrientationOrientation of the "belly" of the arc. This parameter also affects if the arc will be 90° (corner arc) or 180° (edge arc)
Spot appearance
apiSpotsColorColor of the spots
apiSelectedSpotColorColor of the selected spot
apiSpotsRadiusSize of the spots
apiSpotsShapeShape of the spots: Circle, RoundedSquare or Square
Spots distribution and movement
apiIntervalMeasureHow spots are distributed on the circumference: constant angle or constant arc length. With constant angle, the spots will not be distributed evenly, because of ellipse's eccentricity. Normally constant arc length is used: being a non-finite math problem, here an approximation function is used, as explained later on.
apiInvertDirectionIf spots will be selected in inverted direction
apiAnimationTypeSee below to detailed explanation of animation types
Hand appearance
apiHandEnabledIf hand is drawn
apiHandColorHand's color
apiHandWidthHand's width
apiHandRelativeLengthHand's relative length starting from center to edges (1 = full length)

Animation types

List of animation types:

NametoBottomRighttoUpNotes
Color
Color cross-fade
Slide
Simple movement
Pinch
Simple movement
with size reduction
Bump
Simple movement
with size growth.
Might need additional padding
Rotate
Inverted movement of all spots
Rotate Pinch
Inverted movement of all spots
with size reduction
Cover
Spots are filled from inside
Fill
Spots are empty and filled from inside
Surround
Simple movement of a circle
surrounding smaller spots
Necklace
Inverted movement of all spots,
with center spot biggest
and lateral spots smaller
Necklace 2
Inverted movement of all spots,
with selected spot biggest
and farthest spot smallest
Example of hand
Example of rounded squared spots

New in 1.0.2

  • Fixed a crash when the ViewPager was not found
  • Added setViewPager(), to attach the Indicator to dynamically created viewpagers, by referring the Object and not the id reference number

Some maths

This question I made helped me solve the ellipse's problem. Indeed, finding arcs of constant length on a known ellipse is a problem with a non-finite solution, that needs integrals to be calculated. There were at least 5 approaches to solve this problem with acceptable performance:

  • find the points recursively, by iteratively reducing the error until it's close enough to zero. Pros: easy to do. Cons: adds a indetermined (although very small) time to the drawing process
  • create a big table of sampled data and storing them to provide a database of pre-calculated solutions. Pros: fastest. Cons: can't work for any number of elements
  • distribute the points on the radius and project them on the circumference. Pros: very fast. Cons: error still pretty large
  • use an approximated function. Pros: fast and good enough. Cons: never perfect
  • calculate the elliptic integrals. Pros: perfect. Cons: very very very heavy on performance

I chose to find a good approximated function and that is what you can find inside the code, it's fast enough and the error is near to invisibility. In case you need more performance, you can remove the e6 part of the formula and have a slightly bigger error.

The formula used is the one of the referenced question, and thanks very much to its author, Ng Chung Tak that is both the author of the answer, and the author of the formula itself.

Author

License

The MIT License (MIT)

Copyright (c) 2016 Beppi Menozzi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
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].