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-13000] Fixed load event on image view #4996

Closed
wants to merge 3 commits into from

Conversation

pec1985
Copy link
Contributor

@pec1985 pec1985 commented Nov 19, 2013

Load event was not working if the image view had touchEnabled set to false

Load event was not working if the image view had touchEnabled set to false
@ghost ghost assigned vishalduggal Nov 19, 2013
@@ -1649,7 +1649,7 @@ -(void)fireEvent:(NSString*)type withObject:(id)obj propagate:(BOOL)propagate re
// Have to handle the situation in which the proxy's view might be nil... like, for example,
// with table rows. Automagically assume any nil view we're firing an event for is A-OK.
// NOTE: We want to fire postlayout events on ANY view, even those which do not allow interactions.
if (proxyView == nil || [proxyView interactionEnabled] || [type isEqualToString:@"postlayout"]) {
if (proxyView == nil || [proxyView interactionEnabled] || [type isEqualToString:@"postlayout"] || [type isEqualToString:@"load"]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This will work but I would prefer more scalable code.
Define a method in TiViewProxy which returns an array of state events.
By default it will return postlayout.
ImageView will return postlayout and load.
Then you can check if state array contains event type and we can just modify that array for our proxies

{
NSMutableArray *arr = [NSMutableArray array];
[arr addObject:@"postlayout"];
if([self isKindOfClass:[TiUIImageViewProxy class]]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This check should not be here. Instead the TiUIImageViewProxy class must override the method to return a different array

@vishalduggal
Copy link
Contributor

Code reviewed. Please address comments

@pec1985
Copy link
Contributor Author

pec1985 commented Aug 12, 2014

Comments addressed.

@pec1985
Copy link
Contributor Author

pec1985 commented Feb 10, 2015

Closing per #6630

@pec1985 pec1985 closed this Feb 10, 2015
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

2 participants