Material-ViewPagerIndicator
Material-ViewPagerIndicator copied to clipboard
Add support for homescreen-style dot animation
Build alternate dot animation like the one used in the default Android launcher: The dot for the new page grows and changes color, while the dot for the previous page shrinks and fades to match other unselected dots.
This should probably be toggleable via a styleable enum attribute:
<com.itsronald.widget.ViewPagerIndicator
...
app:dotAnimation="scale|ink"/>
where scale
describes the animation above and ink
is the current (and default) style.
There should also be a matching Java API:
@IntDef({ANIMATION_STYLE_INK, ANIMATION_STYLE_SCALE})
public @interface AnimationStyle {}
@AnimationStyle
getAnimationStyle();
setAnimationStyle(@AnimationStyle animationStyle);
Might as well add a none
option too to turn off animation altogether.
<com.itsronald.widget.ViewPagerIndicator
...
app:dotAnimation="scale|ink|none"/>
This feature is in development on the feature/distinct-animation-types
branch.
The ink
and none
settings work as expected, while scale
has not yet been implemented.
For anyone following this issue, the implementation on the other branch is actually pretty complete if you want to try it out. I just haven't had time to test it on anything earlier than my API 24 Nexus 5X and don't want to create a new release until that's done.
If anyone is still following this issue, I'm aiming to test and release this by the end of this weekend.
Hello Ronald,
I'm very interested on this feature about turn off the dot animation. unfortunately in your last version 1.0.4 it's not present.
You think release it very soon? thanks in advance.
Hey, What is your latest version number and where can i find it.