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

[TIMOB-10361] added touchPassThrough property on iOS which allows touches to go throug... #2696

Closed
wants to merge 7 commits into from

Conversation

farfromrefug
Copy link
Contributor

...h when transparent

jira ticket

@negupta
Copy link
Contributor

negupta commented Aug 9, 2012

Signed CLA is in place.

@WhichKatieDid
Copy link
Contributor

CR passed.

@WhichKatieDid
Copy link
Contributor

Have been communicating with Android teams on how feasible this is on Android, will have to do same with MW.

@WhichKatieDid
Copy link
Contributor

Okay, having talked with the other teams, this sounds highly unfeasible in terms of parity, i.e., making something there is either impossible or could cause significant performance problems. What's the underlying use case? The Jira ticket didn't really show a need.

@farfromrefug
Copy link
Contributor Author

That doesnt seem hard to do an android
http://stackoverflow.com/questions/6374592/passing-touch-events-to-the-parent-view
I am going to go for it and test implementing it.

Now their are thousands of use cases:

  • Buttons over camera view. You want them to respect a certain layout (horizontal for example), so you put them into a "group" view. Yet you dont want that group view to get any touch event (because touching the camera will focus).
  • puller: You have a sliding view hidden on the left. You can show it with a puller. To do such thing you need an horizontal layout with the content of the view and the puller. But the puller is often not the same height as the view itself.
    Without passthrough, touching above and below the puller will get blocked

I actually use the 2 cases.

Conflicts:
	android/titanium/src/java/org/appcelerator/titanium/view/TiUIView.java
@farfromrefug
Copy link
Contributor Author

I just commited a working android version.

@dawsontoth
Copy link
Contributor

I can vouch for the validity of these use cases, and others. I've encountered these in apps I've built for Appcelerator, and having this property would greatly reduce the complexity of my code in some cases and make other cases, formerly impossible, possible.

@WhichKatieDid
Copy link
Contributor

Okay, will talk with mobile web and see if this is possible or painful.

@ghost ghost assigned WhichKatieDid Oct 3, 2012
@farfromrefug
Copy link
Contributor Author

any news on this?
Thanks

@@ -1004,7 +1013,14 @@ - (UIView *)hitTest:(CGPoint) point withEvent:(UIEvent *)event
}
*/

return [super hitTest:point withEvent:event];
UIView *hitView = [super hitTest:point withEvent:event];
if (touchPassThrough)
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nitpick: This could be more elegantly written as
if (touchPassThrough && (hitview == self))
{
return nil;
}
return hitView;

@WhichKatieDid
Copy link
Contributor

Despite Bryan making an odd face when I asked about this, this does have value. Include documentation and update the code (and update the merge) and I'll rereview.

 into PR/TC-1151

Conflicts:
	android/titanium/src/java/org/appcelerator/titanium/view/TiUIView.java
@farfromrefug
Copy link
Contributor Author

I am not the best at writing doc. Hope it will be fine!

@hansemannn
Copy link
Collaborator

@ashcoding Can you check the android part? I'd look at the iOS part.
@farfromrefug Can you resolve the merge conflicts so we get this merged in the 6.0.0 timeframe? Thank you!

@hansemannn
Copy link
Collaborator

Closing this PR, since the merge conflicts have not been addressed since 2 months.

@hansemannn hansemannn closed this Mar 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants