[TIMOB-25003] iOS: Deprecate Ti.UI.iOS.Toolbar, create parity with Android, change Alloy to handle both
| GitHub Issue | n/a |
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2017-08-21T14:52:34.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 6.2.0 |
| Components | Android, iOS |
| Labels | n/a |
| Reporter | Hans Knöchel |
| Assignee | Hans Knöchel |
| Created | 2017-07-21T04:28:15.000+0000 |
| Updated | 2017-08-30T17:36:20.000+0000 |
Description
As one of the engineering week decisions, we will move the iOS-only Ti.UI.iOS.Toolbar core-component to the unified Ti.UI.Toolbar namespace. We will combine it with the new Toolbar exposed by Android (TIMOB-17964). In addition, this ticket should also hold the PR for Alloy to remove the platform-specific handling of the <Toolbar> tag.
Attachments
Might we also be able to combine the Ti.UI.Windows.CommandBar component into this too?
We should! Quick question for [~gmathews] and [~ybanev]: Is the Android Toolbar PR merged already, having the toolbar on the Ti.UI.Toolbar namespace? If so, we can go ahead and move iOS and Windows to it as well. Great parity achievement! :-)
No, it is not merged yet. In what order should we do them - Alloy change first, platforms later or vice-versa ?
[~hknoechel] Don't forget we need to still be backwards-compatible in a minor.
Agree! iOS would simply link to the new API. The Alloy-part would be copied over, so we can keep it for a few releases without issues.
PR for Alloy: https://github.com/appcelerator/alloy/pull/841 It works fine on Android. It shouldn't break compatibility on iOS as well, but I can't test that.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/9292 PR (6_2_X): https://github.com/appcelerator/titanium_mobile/pull/9293 Test-Case 1/3:
Test-Case 2/3:var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); var send = Titanium.UI.createButton({ title: 'Send', style: Titanium.UI.iOS.SystemButtonStyle.DONE, }); var camera = Titanium.UI.createButton({ systemButton: Titanium.UI.iOS.SystemButton.CAMERA, }); var cancel = Titanium.UI.createButton({ systemButton: Titanium.UI.iOS.SystemButton.CANCEL }); var flexSpace = Titanium.UI.createButton({ systemButton:Titanium.UI.iOS.SystemButton.FLEXIBLE_SPACE }); var toolbar = Titanium.UI.createToolbar({ items:[send, flexSpace, camera, flexSpace, cancel], bottom:0, borderTop:true, borderBottom:false }); // Should be "Ti.UI.Toolbar". Try to rename Titanium.UI.createToolbar to // Titanium.UI.iOS.createToolbar to test the deprecated API. It should then also // throw a deprecation-warning Ti.API.info(toolbar.apiName); win.add(toolbar); win.open();Test-Case 3/3:var send = Titanium.UI.createButton({ title: 'Send', style: Titanium.UI.iOS.SystemButtonStyle.DONE, }); var camera = Titanium.UI.createButton({ systemButton: Titanium.UI.iOS.SystemButton.CAMERA, }); var cancel = Titanium.UI.createButton({ systemButton: Titanium.UI.iOS.SystemButton.CANCEL }); var bookmark = Titanium.UI.createButton({ systemButton: Titanium.UI.iOS.SystemButton.BOOKMARKS }); flexSpace = Titanium.UI.createButton({ systemButton:Titanium.UI.iOS.SystemButton.FLEXIBLE_SPACE }); var tb1 = Titanium.UI.iOS.createToolbar({ items:[send, flexSpace, camera], top:20, backgroundImage:'images/chip.jpg', extendBackground:true }); var tb2 = Titanium.UI.iOS.createToolbar({ items:[bookmark, flexSpace, cancel], bottom:0, backgroundImage:'darkstripes_bg.jpg', }); var label = Ti.UI.createLabel({text:'SEE TOOLBARS !'}); var win = Ti.UI.createWindow({backgroundColor:'white',orientationModes:[1,2,3,4]}); win.add(tb1); win.add(tb2); win.add(label); win.open();var win = Ti.UI.createWindow({ backgroundColor: 'red', extendEdges: [Ti.UI.EXTEND_EDGE_ALL] }); win.add(Ti.UI.iOS.createToolbar({ items: [Ti.UI.createButton({ systemButton: Titanium.UI.iOS.SystemButton.CAMERA, })], top: 0, // 20 leaves a gap height: 64, // doesn't work borderTop: false, borderBottom: true })); win.open();Changes are seen in SDKs: 6.2.0.v20170828180251 7.0.0.v20170829103419