开发者

Android NYTimes Swipe Animation/Gesture

The NYTimes has a very interesting page turning feature. You can swipe left to right / right to left to view other items (which is easy to implement). Even if you don't cross the threshold values the view moves with your finger and roll back to t开发者_Python百科he initial view once you lift your finger. How do they do this?

Second: can this be done on a TabActivity?

Thanks


  1. They most probably have a custom View.

    Take a look at Marc Reichelt's library: http://marcreichelt.blogspot.com/2010/09/android-use-realviewswitcher-to-switch.html

  2. It CAN be done, but this is not part of the core OS. You would probably need to extend TabHost/TabView.


I've made a modified version of Marc's RealViewSwitcher that comes with demos that include "tabbed" usage (using a RadioGroup, which can be easily skinned to look like conventional tabs if you so choose). It's available on github.


If you are talking about the NY Times Android App Article Activity we don't do anything special it is simply a view pager. Here's a link to how it works with a tabbar like within our app. https://developer.android.com/training/implementing-navigation/lateral.html

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜