开发者

ViewPager indicator like Google+ App, or Google Doc App

I'm trying to implement the title indicator like the one found in Google+ Android App; I've come across two implementation, one by Jake Wharton and the other by Mark Gjoel.

What I want is to be able to swipe on the indicator to switch between the different views, and swipe on viewpager to go back/forth on image results that I load from the SD card开发者_如何学编程.

I've implemented the layout for the indicator, but I don't know how to "move it" (follow the users finger within the indicator layout) as the user swipes on it. Also, I don't know, how to move the viewpager at the same time with the indicator, so the interaction looks natural.

If you have Google+ App, try to do a swipe on the indicator in the stream section, and you will know what I am talking about.

Any tips would be greatly appreciated.


Following links may help you.

  1. GreenDroid
  2. AndroViews code
  3. AndroViews video
  4. ADW launcher
  5. PageScroller


Look at the listeners in ViewPager, copy the same action to your listeners only the movement part, not everything what it does. Now, when you detect user swiping on your indicator, implement or call the function that does the swipe on the ViewPager , so that they move together.

HTH.


Try the implementation by chainsdd for Superuser app:

https://github.com/ChainsDD/Superuser/blob/master-dev/src/com/noshufou/android/su/widget/PagerHeader.java

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜