Sameer Segal
Sameer Segal

Reputation: 22023

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 the initial view once you lift your finger. How do they do this?

Second: can this be done on a TabActivity?

Thanks

Upvotes: 5

Views: 2504

Answers (3)

FriendlyMikhail
FriendlyMikhail

Reputation: 2927

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

Upvotes: 2

Yoni Samlan
Yoni Samlan

Reputation: 38065

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.

Upvotes: 2

Peter Knego
Peter Knego

Reputation: 80340

  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.

Upvotes: 3

Related Questions