Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25302] iPhone X: Add new home-indicator related API's

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2018-05-15T23:59:03.000+0000
Affected Version/sRelease 6.2.0
Fix Version/sRelease 7.3.0
ComponentsiOS
Labelsdemo_app
ReporterHans Knöchel
AssigneeVijay Singh
Created2017-09-16T19:14:45.000+0000
Updated2018-07-20T08:36:13.000+0000

Description

There are some utility API's in the iOS 11 GM seed that we might want to add to the SDK: - prefersHomeIndicatorAutoHidden - Returns a Boolean indicating whether the system displays a visual indicator for returning to the Home screen. - Could be exposed as a Ti.UI.Window boolean-property "homeIndicatorAutoHidden" - setNeedsUpdateOfHomeIndicatorAutoHidden - Notifies UIKit that your view controller updated its preference regarding the visual indicator for returning to the Home screen. - Could be exposed as a Ti.UI.Window event "homeindicatorupdate"

Comments

  1. Vijay Singh 2018-02-06

    PR - https://github.com/appcelerator/titanium_mobile/pull/9804 Test Case 1 -
       var win = Ti.UI.createWindow({
           backgroundColor: '#fff',
           homeIndicatorAutoHidden : false
       });
       
       var btn = Ti.UI.createButton({
           title: 'Open New Window'
       });
       
       btn.addEventListener('click', function() {
           win1.open({modal:true});
       });
       
       win.add(btn);
       win.open();
       
       var win1 = Ti.UI.createWindow({
           backgroundColor: '#fff',
           homeIndicatorAutoHidden : true
       });
       
       var btn1 = Ti.UI.createButton({
           title: 'Close'
       });
       
       btn1.addEventListener('click', function() {
           win1.close();
       });
       
       win1.add(btn1);
       
    Test Case 2-
       var win = Ti.UI.createWindow({
           backgroundColor: '#fff',
       });
       
       var btn = Ti.UI.createButton({
       	top : 100,
           title: 'Set Home Indicator true'
       });
       
       btn.addEventListener('click', function() {
           win.setHomeIndicatorAutoHidden(true);
           Ti.API.info('homeIndicatorAutoHidden is ' +win.homeIndicatorAutoHidden);
       });
       win.add(btn);
       
       var btn1 = Ti.UI.createButton({
       	top : 200,
           title: 'Set Home Indicator false'
       });
       
       btn1.addEventListener('click', function() {
           win.setHomeIndicatorAutoHidden(false);
           Ti.API.info('homeIndicatorAutoHidden is ' +win.homeIndicatorAutoHidden);
       });
       win.add(btn1);
       win.open();
       
    Test Case 3 -
       var win = Ti.UI.createWindow({
           backgroundColor: '#fff',
           homeIndicatorAutoHidden : true
       });
       
       var btn = Ti.UI.createButton({
           title: 'Push Window'
       });
       
       btn.addEventListener('click', function() {
           navWindow.openWindow(win1);
       });
       
       win.add(btn);
       
       var navWindow = Titanium.UI.iOS.createNavigationWindow({
          window: win
       });
       navWindow.open();
       
       var win1 = Ti.UI.createWindow({
           backgroundColor: '#fff',
           homeIndicatorAutoHidden : false
       });
       
       var btn1 = Ti.UI.createButton({
           title: 'Pop Window'
       });
       
       btn1.addEventListener('click', function() {
           win1.close();
       });
       
       win1.add(btn1);
       
    Test Case 4 -
       var win1 = Ti.UI.createWindow({
           backgroundColor: 'blue',
           title: 'Blue',
           homeIndicatorAutoHidden : true
       });
       win1.add(Ti.UI.createLabel({text: 'I am a blue window.'}));
       
       var win2 = Ti.UI.createWindow({
           backgroundColor: 'red',
           title: 'Red'
       });
       win2.add(Ti.UI.createLabel({text: 'I am a red window.'}));
       
       var tab1 = Ti.UI.createTab({
           window: win1,
           title: 'Blue'
       }),
       tab2 = Ti.UI.createTab({
           window: win2,
           title: 'Red'
       }),
       tabGroup = Ti.UI.createTabGroup({
           tabs: [tab1, tab2]
       });
       tabGroup.open();
       

JSON Source