Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25003] iOS: Deprecate Ti.UI.iOS.Toolbar, create parity with Android, change Alloy to handle both

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-08-21T14:52:34.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.2.0
ComponentsAndroid, iOS
Labelsn/a
ReporterHans Knöchel
AssigneeHans Knöchel
Created2017-07-21T04:28:15.000+0000
Updated2017-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

FileDateSize
darkstripes_bg.jpg2017-08-09T15:19:55.000+000080497

Comments

  1. Ewan Harris 2017-07-21

    Might we also be able to combine the Ti.UI.Windows.CommandBar component into this too?
  2. Hans Knöchel 2017-08-08

    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! :-)
  3. Yordan Banev 2017-08-08

    No, it is not merged yet. In what order should we do them - Alloy change first, platforms later or vice-versa ?
  4. Eric Merriman 2017-08-08

    [~hknoechel] Don't forget we need to still be backwards-compatible in a minor.
  5. Hans Knöchel 2017-08-09

    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.
  6. Yordan Banev 2017-08-09

    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.
  7. Hans Knöchel 2017-08-09

    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:
       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 2/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();
       
    Test-Case 3/3:
       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();
       
  8. Abir Mukherjee 2017-08-29

    Changes are seen in SDKs: 6.2.0.v20170828180251 7.0.0.v20170829103419

JSON Source