ronaldsmartin / Material-ViewPagerIndicator

Dot-based Android ViewPager indicator with Material Design animations.
http://itsronald.com/blog/2016/10/my-first-library/
Apache License 2.0
520 stars 76 forks source link

Add support for homescreen-style dot animation #4

Open ronaldsmartin opened 8 years ago

ronaldsmartin commented 8 years ago

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);
ronaldsmartin commented 8 years ago

Might as well add a none option too to turn off animation altogether.

<com.itsronald.widget.ViewPagerIndicator
        ...
        app:dotAnimation="scale|ink|none"/>
ronaldsmartin commented 7 years ago

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.

ronaldsmartin commented 7 years ago

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.

ronaldsmartin commented 7 years ago

If anyone is still following this issue, I'm aiming to test and release this by the end of this weekend.

ghost commented 7 years ago

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.

Digi18 commented 6 years ago

Hey, What is your latest version number and where can i find it.