Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab contents shouldn't reload every time, like how iOS works #200

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

gliechtenstein
Copy link
Contributor

Currently the Android version handles tab switching differently than the iOS Jasonette.

On iOS, since the tab bar is natively built in and every tab co-exist without having to refresh every time you tap on a tab bar item.

But on Android tabs this has not been the case. On Android, if there are 5 tabs, all 5 tabs share the same activity since there is no native support for tab bar. Instead of having a parent tabs container that houses 5 views, on Android there's only one activity that gets "replace" transitioned out.

At least this was how it used to work. This meant whenever you press a tab bar item, it did a fresh reload of the view (since underneath it was just a replace transition).

In this update, we still keep the single activity structure, but instead of getting rid of all the rendered content, we store them globally. And when it's time to switch back to a previously-rendered tab, we look it up and restore its content seamlessly instead of reloading the URL from scratch.

This makes the tabs work the same way it works on iOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant