How to animate TabActivity change in Android?

By : gskbyte

Is it possible to animate the transition between an Activity in a tab to another one? I mean, when the user clicks a tab in the TabWidget and the shown tab content changes to another Activity. With the default configuration it just changes but I would like to have a smooth transition like a left-to-right slide or something similar.

Thank you for your help.

By : gskbyte


If you clone the TabActivity/Host/Widget implementation, it is easy to add animations to the tab switching. Here's a modified copy of a "tutorial" I did back when Donut was released. It was a clone of the Donut core Tab implementation with some modifications to move/show/hide tab indicators, swap tab content, swipe between tabs.

I just added animations to tab transitions.

It's probably not a "good" solution or the most efficient, but it works.

This video can help you solving your question :)
By: admin