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
Conversation
Load event was not working if the image view had touchEnabled set to false
@@ -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"]) { |
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.
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]]) { |
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.
This check should not be here. Instead the TiUIImageViewProxy class must override the method to return a different array
Code reviewed. Please address comments |
Comments addressed. |
Closing per #6630 |
Load event was not working if the image view had touchEnabled set to false