Tab contents shouldn't reload every time, like how iOS works #200
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.