Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17804] iOS8: Refactor OptionDialog

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-10-02T20:35:05.000+0000
Affected Version/sRelease 3.4.0
Fix Version/sRelease 3.4.2, Release 3.5.0, Release 4.0.0
ComponentsiOS
Labelsios8, module_optiondialog, optiondialog, qe-manualtest
ReporterVishal Duggal
AssigneeVishal Duggal
Created2014-09-29T22:15:49.000+0000
Updated2015-01-14T20:52:38.000+0000

Description

iOS8 has moved over AlertDialog and OptionDialog to UIAlertController Also the correct way to show popovers is now to set the modalPresentationStyle to UIModalPresentationPopover Titanium needs to refactor these three proxy classes. Will probably also need to change the supported API.

Comments

  1. Vishal Duggal 2014-10-02

    Additional test case to be run on iPAD
       var win = Ti.UI.createWindow({backgroundColor:'white',title:'WIN1'});
       
       var label = Ti.UI.createLabel({text:'SHOW HERE',top:30});
       
       win.add(label);
       
       var label2 = Ti.UI.createLabel({text:'IN TABBAR',top:70});
       
       win.add(label2);
       
       var label3 = Ti.UI.createLabel({text:'IN WINDOW',top:110,dialogView:win});
       
       win.add(label3);
       
       
       var label4 = Ti.UI.createLabel({text:'Without View',top:150});
       
       win.add(label4);
       
       var one = Titanium.UI.createButton({
           title: 'HERE'
       });
       var two = Titanium.UI.createButton({
           title: 'HERE'
       });
       var three = Titanium.UI.createButton({
           title: 'HERE'
       });
       var four = Titanium.UI.createButton({
           title: 'TOOLBAR'
       });
       var flexSpace = Titanium.UI.createButton({
           systemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE
       });
       
       
       var toolbar = Titanium.UI.iOS.createToolbar({
           items:[one, flexSpace, two,flexSpace,four],
           bottom:0,
       }); 
       four.dialogView = toolbar;
       win.add(toolbar);
       
       win.rightNavButton = three;
       
       
       var opts = {
         //cancel: 2,
         options: ['Confirm', 'Help', 'Cancel'],
         selectedIndex: 2,
         destructive: 0,
         title: 'Delete File?',
         message: 'Be Sure!!'
       };
       
       function clickHandler(e){
       	var dialogView = e.source.dialogView;
       	if(!dialogView) {
       		dialogView = e.source;
       	}
       	var dialog = Ti.UI.createOptionDialog(opts).show({animated:true,view:dialogView});
       }
       
       one.addEventListener('click',clickHandler);
       two.addEventListener('click',clickHandler);
       three.addEventListener('click',clickHandler);
       four.addEventListener('click',clickHandler);
       label.addEventListener('click',clickHandler);
       label2.addEventListener('click',clickHandler);
       label3.addEventListener('click',clickHandler);
       label4.addEventListener('click',function(e){
         var dialog = Ti.UI.createOptionDialog(opts).show();
       });
       
       var tab = Ti.UI.createTab({
       	title:'TAB1',
       	window:win
       })
       
       label2.dialogView = tab;
       var tabGroup = Ti.UI.createTabGroup({
       	tabs:[tab],
       	orientationModes:[1,2,3,4]
       })
       tabGroup.open();
       
  2. Vishal Duggal 2014-10-02

    Pull pending master - https://github.com/appcelerator/titanium_mobile/pull/6191 3_4_X - https://github.com/appcelerator/titanium_mobile/pull/6193
  3. Olga Romero 2014-10-06

    Tested the above code using Mac osx 10.9.5 Mavericks Appcelerator Studio, build: 3.4.0.201409261245 Titanium SDK, build: 3.4.1.v20141003114920 acs@1.0.18 alloy 1.5.1 install@0.1.7 npm@1.4.23 sudo@1.0.3 titanium 3.4.0 titanium-code-processor@1.1.1 Xcode6.1GM Devices: iPad mini iOS 8.1 iPad mini iOS 7.0.3 Works as expected per [~vduggal]

JSON Source