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-10005] Only fire 'postlayout' when the layout actually changes #2632

Merged
merged 2 commits into from Jul 25, 2012
Merged

[TIMOB-10005] Only fire 'postlayout' when the layout actually changes #2632

merged 2 commits into from Jul 25, 2012

Conversation

sptramer
Copy link
Contributor

Note that this can still result in extraneous events if multiple resizes/repositionings are done during a layout pass, since the end result delivered to the user will only grab the latest available size/rect and not necessarily the values at the time of the layout. It may actually be useful to pass, as the event object, the rect (not size) of the view at layout time, giving a way to detect which pass was the "final" one.

TICKET

- Only fire postlayout when frame/bounds/center change
- Don't propigate postlayout events
@vishalduggal
Copy link
Contributor

Code reviewed. ACCEPTED

@vishalduggal
Copy link
Contributor

Functional Passed. The number of postlayout events is reduced. This does introduce a behavior change for IOS where the postlayout event is no longer propagated. Have verified that MW does not propagate the event either. Will wait for confirmation from Android about event behavior before merge.

Old Event Stream from Sample App

[INFO] Button postlayout [object TiUIButton]
[INFO] Window postlayout [object TiUIButton]
[INFO] Label postlayout [object TiUILabel]
[INFO] Window postlayout [object TiUILabel]
[INFO] Window postlayout [object TiUIWindow]
[INFO] Button postlayout [object TiUIButton]
[INFO] Window postlayout [object TiUIButton]
[INFO] Button postlayout [object TiUIButton]
[INFO] Window postlayout [object TiUIButton]
[INFO] Window postlayout [object TiUIWindow]
[INFO] Button postlayout [object TiUIButton]
[INFO] Window postlayout [object TiUIButton]

New Event Stream from Sample App

[INFO] Window postlayout [object TiUIWindow]
[INFO] Button postlayout [object TiUIButton]
[INFO] Label postlayout [object TiUILabel]
[INFO] Button postlayout [object TiUIButton]
[INFO] Label postlayout [object TiUILabel]

@sptramer
Copy link
Contributor Author

The latest event discussions from the technical leads and the architecture group have decided that it is inappropriate for postlayout to bubble upwards. A bug should be filed against Android if they do propagate it.

@ayeung
Copy link
Contributor

ayeung commented Jul 25, 2012

I just checked the code, and Android does bubble up the event for postlayout. I will file a bug for this, so it will be changed on the android side.

@vishalduggal
Copy link
Contributor

Since Android will file a parity ticket accepting this PR. ACCEPTED

vishalduggal added a commit that referenced this pull request Jul 25, 2012
[TIMOB-10005] Only fire 'postlayout' when the layout actually changes
@vishalduggal vishalduggal merged commit f9e938d into tidev:master Jul 25, 2012
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

3 participants