[TIMOB-13104] Android: Postlayout event not fired
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | n/a |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2013-06-20T18:38:36.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | 2013 Sprint 10 API, 2013 Sprint 10, Release 3.2.0 |
| Components | Android |
| Labels | android, exalture, iOS, module_imageview, parity, qe-testadded |
| Reporter | Carter Lathrop |
| Assignee | Sunila |
| Created | 2013-02-26T10:29:40.000+0000 |
| Updated | 2013-10-10T09:13:36.000+0000 |
Description
*Problem*
postlayout event not firing on android but works as expected on iOS. Possible Parity.
*Steps to Reproduce*
1. Download image attached (chatbubble.jpeg)
2. Paste this code in app.js
var Window = Ti.UI.createWindow({
backgroundColor: 'white'
});
var imageView = Ti.UI.createImageView({
image : 'chatbubble.jpeg'
})
imageView.addEventListener("postlayout", function() {
alert("test");
});
Window.add(imageView);
Window.open();
3. Run on device (android)
4. Run on iOS simulator
Android
*Expectation* you get alert message with text "test" on android *Actual* No alert messageiOS
*Correct Behavior* 2 times alert messageAttachments
| File | Date | Size |
|---|---|---|
| chatbubble.jpeg | 2013-03-18T19:33:30.000+0000 | 9664 |
Please refer to https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report on how to report a bug. We need to see fully reproducible code along with steps to reproduce in order to review a ticket. This code should run when pasted into app.js and clearly show the problem. Thank you.
Please reopen this bug
Alexander, when testing on iOS simulator I only get 2 alert messages. Regardless, I can confirm this is still parity behavior so I will move to Ti-Mobile for engineering to review. Can you confirm or deny the amount of alert messages you are getting? Regards, Carter
Overrode onLayout of the native control. https://github.com/appcelerator/titanium_mobile/pull/4171
Re-opening as per TC-2492. The following code
Does not generate an alert as expected. This is working as expected with iOS and the base View classvar Window = Ti.UI.createWindow({ backgroundColor: 'white' }); var imageView = Ti.UI.createImageView({ image:"/iphone/appicon.png" }) imageView.addEventListener("postlayout", function() { alert("test"); }); Window.add(imageView); Window.open();I tried with the latest code and it fires the event every time I launch the app.
Resolving as fixed again -- I failed to notice that Ben was using 3.1.1 GA and this fix is for 3.2. Thanks.
Verified the fixed with Environment: Appc-Studio: 3.2.0.201310092427 Sdk:3.2.0.v20131009134844 alloy:1.2.2 npm:1.3.2 titanium:3.2.0 titanium-code-processor:1.0.3 Device:Google Nexus 7(v4.3),ipodTouch1(v7.0) Xcode: 5 PostLayout event is being called both on android and ios. Checked with imageView Control.