[TIMOB-19482] Parity: Ti.UI.View.add should support array of views on Android as iOS
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-09-29T12:52:31.000+0000 |
Affected Version/s | Release 4.1.0 |
Fix Version/s | Release 6.1.0 |
Components | Android |
Labels | parity |
Reporter | Fokke Zandbergen |
Assignee | Hans Knöchel |
Created | 2015-09-09T16:37:39.000+0000 |
Updated | 2016-11-22T18:12:30.000+0000 |
Description
On iOS
Ti.UI.View.add()
accepts an array of views:
https://github.com/appcelerator/titanium_mobile/blob/0357b4796abf0032485018fac42614a94f826c9b/iphone/Classes/TiViewProxy.m#L148
On Android it does not:
https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/view/TiUIView.java#L159
This is a very useful feature and looking at the iOS code simple to implement for Android and Windows as well.
Related question on Q&A:
https://community.appcelerator.com/topic/3075/unable-to-add-array-of-views-to-parent-view-on-android
Can we schedule this one for the next release so that - with TIMOB-19394 and TIDOC-2282 already resolved - we can demonstrate how to use this cross-platform in a sample app for the next release.
PR: https://github.com/appcelerator/titanium_mobile/pull/8077 Demo:
PR + demo-code updated, ready for review.
Reviewed and made some changes master: https://github.com/appcelerator/titanium_mobile/pull/8452
Verified fixed by using the code above provided by [~hansknoechel] was able to press the "Add Views Together button" without crashing. Also verified by the code provided by [~gmathews] in https://github.com/appcelerator/titanium_mobile/pull/8452 was able to press "Add View Array" without the app crashing. (Tested on SDK version 6.1.0.v20161121162514). *Environment*