-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Closed
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d3c9d0c
added touchPassThrough property on iOS which allows touches to go thr…
farfromrefug ee58f1e
Merge branch 'master' of https://github.com/appcelerator/titanium_mob…
farfromrefug 180e040
touchPassThrough working on android
farfromrefug 47b042b
added getter for touchPassThrough property
farfromrefug d05f3b4
Merge branch 'master' of https://github.com/appcelerator/titanium_mob…
farfromrefug 84835ae
doc
farfromrefug 1589d67
more elegant
farfromrefug File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,7 +215,7 @@ - (id) init | |
self = [super init]; | ||
if (self != nil) | ||
{ | ||
|
||
touchPassThrough = false; | ||
} | ||
return self; | ||
} | ||
|
@@ -571,6 +571,15 @@ -(BOOL) touchEnabled { | |
return touchEnabled; | ||
} | ||
|
||
-(void)setTouchPassThrough_:(id)arg | ||
{ | ||
touchPassThrough = [TiUtils boolValue:arg]; | ||
} | ||
|
||
-(BOOL)touchPassThrough { | ||
return touchPassThrough; | ||
} | ||
|
||
-(UIView *)gradientWrapperView | ||
{ | ||
return self; | ||
|
@@ -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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor nitpick: This could be more elegantly written as |
||
{ | ||
if (hitView != self) | ||
return hitView; | ||
return nil; | ||
} | ||
return hitView; | ||
} | ||
|
||
// TODO: Revisit this design decision in post-1.3.0 | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because how the data flows, you don't need to implement this method. From JS, foo.touchPassThrough never consults with the view, only with the proxy, which has already stashed away the property before even passing it on to setTouchPassThrough_.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well how would the proxy know that it needs to change the Bool touchPassThrough from the view itself?
Remember that i need to have access to that property within hitTest.
EDIT: you are just talking about the getter right? If so i dont like not to write it because the proxy value and the view value could (shouldnt) be out of sync.