Giter Site home page Giter Site logo

Comments (18)

romandanylyk avatar romandanylyk commented on September 23, 2024

PageIndicarViewextends View, so it's working based on canvas drawing.

from pageindicatorview.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on September 23, 2024

So you have some formula for the transition in between pages, to draw via the canvas?

from pageindicatorview.

alashow avatar alashow commented on September 23, 2024

Supporting at least 14 would be great.

from pageindicatorview.

romandanylyk avatar romandanylyk commented on September 23, 2024

All the animation works by ValueAnimator added in API 11. For increasing stability for now it has minSdk 15 and wasn't tested on lower API yet.
It future releases it will be tested on API 11 and if it is ok, minSdk will be decreased.

from pageindicatorview.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on September 23, 2024

Maybe not 11, but 14 is still a lot more popular than 11-13, no?

from pageindicatorview.

romandanylyk avatar romandanylyk commented on September 23, 2024

I will work on it as soon as possible

from pageindicatorview.

romandanylyk avatar romandanylyk commented on September 23, 2024

So you have some formula for the transition in between pages, to draw via the canvas?

It's a bit simpler that formula actually, because viewPagerhas addOnPageChangeListener and with a bit of math I do all the calculations to draw indicators

from pageindicatorview.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on September 23, 2024

What's the math of it?

Also, thank you for this library and testing on API 14 (or lower)

from pageindicatorview.

romandanylyk avatar romandanylyk commented on September 23, 2024

For interactive animation all the math is in onPageScrollmethod.
And for initial drawing, it's based on view size and count, you can see it in drawIndicatorViewmethod.

from pageindicatorview.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on September 23, 2024

I guess there is no way to understand it without diving, then :)

from pageindicatorview.

romandanylyk avatar romandanylyk commented on September 23, 2024

If explaining on word, I get count of indicator that user set, than knowing it's radius and padding, measure view size. Then after calculating general view size I just draw circles on canvas one by one.

Interactive animation is a bit more interesting. It's is performing by frames. So thanks to ValueAnimator I set start and end value and it returns me that value several times so I can redraw my view based on than value every time it changed - that's how animation works.

from pageindicatorview.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on September 23, 2024

But it has a worm-like transition. Do you draw circles there, one after another?

from pageindicatorview.

romandanylyk avatar romandanylyk commented on September 23, 2024

It's a bit tricky :)
Worm animation is not actually a circle - it's a rectangle with rounded corners that changes its width all the way.

(it actually has circles, those which are now selected, and selected one is rectangle with rounded corners over unselected circle)

from pageindicatorview.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on September 23, 2024

oh, makes sense.

from pageindicatorview.

romandanylyk avatar romandanylyk commented on September 23, 2024

Hope it helped you to understand how it works.
I appreciate that you are interested ^)

from pageindicatorview.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on September 23, 2024

What do you mean? You know me? You know my work/repositories/apps?

from pageindicatorview.

romandanylyk avatar romandanylyk commented on September 23, 2024

You just was the first one, who asked :)

from pageindicatorview.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on September 23, 2024

Oh ok. You are welcomed to check them if you wish:
https://github.com/AndroidDeveloperLB?tab=repositories

from pageindicatorview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.