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

TC-4029: normalize tab selection/unselection cross-platform, and keyboard hiding improvement #5636

Closed
wants to merge 1 commit into from

Conversation

mokesmokes
Copy link
Contributor

Prior to this PR, in Android we had no reliable event for tab selection and unselection. The tab focus and blur events would fire in these cases, but as the JIRA issue shows they also fired under additional circumstances as well. In order to not mess with the (rather complex!!!) focus/blur bubbling logic in Titanium Android (and not break existing apps), this PR simply added the selected and unselected events for tabs (with the additional benefit of the clearer event name than focus and blur).

In iOS, the focus and blur events functioned exactly as tab selection indicators, and there was no bubbling event confusion in their case between window, tab, and tab group. However, to be compatible with Android these events were renamed to selected and unselected. The tab focus and blur events have been removed for iOS.

Additionally, in Android the keyboard is now hidden when the tab selection changes, and not when the tab loses focus (e.g. when the screen is locked), providing for a much smoother user experience.

…droid, and improve keyboard hiding in Android
@mokesmokes
Copy link
Contributor Author

See the test app in the JIRA issue: https://jira.appcelerator.org/browse/TC-4029
Note there are platform-specific differences between focus and blur, but selected/unselected work reliably and identically cross platform.

if ([self _hasListeners:@"blur"]) {
[self fireEvent:@"blur" withObject:nil withSource:self propagate:NO reportSuccess:NO errorCode:0 message:nil];
if ([self _hasListeners:@"unselected"]) {
[self fireEvent:@"unselected" withObject:nil withSource:self propagate:NO reportSuccess:NO errorCode:0 message:nil];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In iOS the tab focus/blur events functioned as selection indicators, so we renamed them to match the Android selected/unselected events.

@mokesmokes
Copy link
Contributor Author

As a side note: in Android the entire TabGroup implementation is needlessly complicated, perhaps since prior to 3.3.0 we had to deal with two different types of TabGroups. The entire implementation can use a serious cleanup sometime in the future. However, this PR is urgently needed now.

@mitulbhalia
Copy link

done :)

On Sun, Apr 27, 2014 at 2:11 AM, mokesmokes notifications@github.comwrote:

Mitul, please delete your comment above, tnx.


Reply to this email directly or view it on GitHubhttps://github.com//pull/5636#issuecomment-41480219
.

Thank you.

Mitul Bhalia,
http://about.me/mitul.bhalia.

@mokesmokes
Copy link
Contributor Author

@mitulbhalia lol, and this one too :)

@mokesmokes
Copy link
Contributor Author

Closed due to the new swipe tabs PR: #5651

@mokesmokes mokesmokes closed this Apr 30, 2014
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.

None yet

3 participants