Comments (18)
PageIndicarView
extends View, so it's working based on canvas drawing.
from pageindicatorview.
So you have some formula for the transition in between pages, to draw via the canvas?
from pageindicatorview.
Supporting at least 14 would be great.
from pageindicatorview.
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.
Maybe not 11, but 14 is still a lot more popular than 11-13, no?
from pageindicatorview.
I will work on it as soon as possible
from pageindicatorview.
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 viewPager
has addOnPageChangeListener
and with a bit of math I do all the calculations to draw indicators
from pageindicatorview.
What's the math of it?
Also, thank you for this library and testing on API 14 (or lower)
from pageindicatorview.
For interactive animation all the math is in onPageScroll
method.
And for initial drawing, it's based on view size and count, you can see it in drawIndicatorView
method.
from pageindicatorview.
I guess there is no way to understand it without diving, then :)
from pageindicatorview.
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.
But it has a worm-like transition. Do you draw circles there, one after another?
from pageindicatorview.
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.
oh, makes sense.
from pageindicatorview.
Hope it helped you to understand how it works.
I appreciate that you are interested ^)
from pageindicatorview.
What do you mean? You know me? You know my work/repositories/apps?
from pageindicatorview.
You just was the first one, who asked :)
from pageindicatorview.
Oh ok. You are welcomed to check them if you wish:
https://github.com/AndroidDeveloperLB?tab=repositories
from pageindicatorview.
Related Issues (20)
- Changing radius of the selected indicator HOT 1
- PageIndicatorView only work outside viewpager HOT 4
- Increase sdk version to 29
- Issue at first point
- Can i Use this with viewFlipper?
- Can i use android:gravity to centerize page indicator in its view?
- Maybe im doing something wrong, but padding and radius in layout doesnt work to me HOT 3
- ViewPager doesn't receive setOnTouchListener with 1.0.3 Version
- What to do if the number of sections does not fit the screen?
- piv_scaleFactor seems to be ignored HOT 1
- last dot completely transparent
- 支持轮播吗
- can we change the shape of dot as line
- Support for ViewPager2 HOT 3
- Release to jitpack or mavenCentral HOT 8
- Rtl mode not working
- Unable to add lib in new created project (Android Studio Giraffe | 2022.3.1)
- App Crashes in latest version
- Ingin jadi profesor
- Failed to resolve: com.romandanylyk:pageindicatorview:1.0.3 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pageindicatorview.