Dot indicator for viewpager in Android similar like Instagram multi image posts [closed]
Asked Answered
C

1

14

Wanted to achieve dot indicator as attached image. I want if items are more than 5 then small dot should appear and during sliding, it's resized. Check Instagram for live view(Look for any post which has uploaded more than 5 pictures)

I tried to play with the sizes of dots only and redraw them (by invalidate()) on every page change, however I couldn't achieve to maintain the dots in the middle. Playing with left and right dots wont make any big problem. but when the active dot is in the middle a scroll effect takes place. How can I achieve that?

I am holding a List of dots and play with the dots sizes and positions when page changes, than I invalidate and draw circles based on the dot properties in the list. However cannot find any idea on how to maintain middle dots so I can make that scrolling effect. Any other idea is appreciated

Dot indicator

enter image description here

Commentative answered 14/9, 2017 at 7:14 Comment(5)
i also want this feature on android.. right know.. only ios have it github.com/shima11/FlexiblePageControl..Fondle
here you go github.com/hrskrs/InstaDotViewFondle
Thanks ! It's exactly what i wanted.Commentative
This library github.com/shuhart/BubblePagerIndicator is more fancy than InstaDotViewBarnebas
you can checkout this post this just what you want: androidexample365.com/…Pastrami
I
3

you can checkout this library, https://github.com/ongakuer/CircleIndicator

Iloilo answered 14/9, 2017 at 7:33 Comment(7)
Here dots are fixed to 5. I don't want to fix them. Kindly check once instagram example.Commentative
i think the indicators increase with the viewpager adapter's count()Iloilo
My requirement is different, you can see 4th and 5th row in attached image. No matter how many items are there i need to show max 7 dots.Commentative
for that you need override getCount() in the PagerAdapter, the dots count will be depends on number you return in getCount()Iloilo
I think you misunderstood requirement. I have to set max dot to 7 in case of more than 5 items. Then after sliding left and right dots should appear in less width and height.Commentative
updates for more libs: github.com/TinkoffCreditSystems/ScrollingPagerIndicatorSourpuss
github.com/shima11/FlexiblePageControlSourpuss

© 2022 - 2024 — McMap. All rights reserved.