JakeWharton / ViewPagerIndicator

Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.
http://viewpagerindicator.com
10.14k stars 4.01k forks source link

enable multiple indicators on same page #122

Open larham opened 12 years ago

larham commented 12 years ago

such as a title strip on top, and dots on bottom. currently, the last indicator "wins"--it shows, but first one does not.

navarr commented 12 years ago

This should already be possible. In one of my apps I have three different indicators - unless you're referring to them both pointing to the same viewpager?

larham commented 12 years ago

thanks for clarifying.

yes, for the same viewpager, e.g., at bottom and top of display

JakeWharton commented 12 years ago

How do you propose this be done? The indicators currently subscribe to the page change events from ViewPager which only accepts a single listener at a time.

I can think of gross ways of doing this but I'm not going to implement them unless the 99.9999% case (single indicator per pager) is still easy.

navarr commented 12 years ago

This is probably one of the gross ways: but couldn't a pager subscribe to the page change events that another pager sends out?

larham commented 12 years ago

Yes, as navarr suggested, one way would be for the PageIndicator.setViewPager() to have an analogous setParentIndicator() if the parent PageIndicator had a setOnPageChangeListener().

This is just a minor feature request. If the interfaces aren't sufficient, there isn't a justification for gross measures.

JakeWharton commented 12 years ago

Ideally we could change ViewPager to accept multiple observers. I may look into that first and contribute to AOSP for the next support library revision.

iamyashrs commented 10 years ago

Any updates regarding implementing this feature?

AlmogBaku commented 9 years ago

Hey, attached my solution here: https://gist.github.com/AlmogBaku/7411ffa44030bc7c641d

This is a simple aggregator.. Nothing complex :)

androidvsourz commented 9 years ago

@AlmogBaku You saved me. Exactly what i want. Thumbs up /////*