[TIMOB-26060] iOS: Move iOS-only Ti.UI.iOS.NavigationWindow to cross-platform Ti.UI.NavigationWindow
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | Low |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2018-11-15T07:49:49.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 8.0.0 |
| Components | Android, iOS |
| Labels | n/a |
| Reporter | Hans Knöchel |
| Assignee | Vijay Singh |
| Created | 2018-05-21T11:43:58.000+0000 |
| Updated | 2018-11-16T11:44:46.000+0000 |
Description
On iOS, we have the
Ti.UI.iOS.NavigationWindow to handle a stack of windows that can be opened and closed. Unfortunately, on Android and Windows, we have to do that manually and it required the (Alloy) developer to either write custom (per platform) logic or use plugins like [xp.ui](https://github.com/FokkeZB/UTiL/blob/master/app/lib/xp.ui.js).
Proposed API-changes:
* iOS: Deprecate Ti.UI.iOS.NavigationWindow in favor of Ti.UI.NavigationWindow
* Android / Windows: Support NavigationWindow, add the native [back button](https://developer.android.com/training/implementing-navigation/temporal.html)
* Android / Windows: Expose the openWindow, closeWindow and popToRootWindow if possible
* Adjust Alloy to make the <NavigationWindow> tag available for all platforms
This should be done in the Release 7.4.0 timeframe and is a fundamental cross-platform parity improvement.
PR: https://github.com/appcelerator/titanium_mobile/pull/10068 Test-case:
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); var newNavWindow = Ti.UI.createNavigationWindow({ window: win }) Ti.API.warn('API (new) = ' + newNavWindow.apiName); var btn = Ti.UI.createButton({ title: 'Open Modal Window' }); btn.addEventListener('click', function() { var button = Ti.UI.createButton({ title: 'Close' }); var modalWindow = Ti.UI.createWindow({ title: 'Modal Window', backgroundColor: 'red', rightNavButton: button }); var oldNavWindow = Ti.UI.iOS.createNavigationWindow({ window: modalWindow }); Ti.API.warn('API (old) = ' + oldNavWindow.apiName); button.addEventListener('click', function() { oldNavWindow.close(); }); oldNavWindow.open({ modal: true }); }); win.add(btn); newNavWindow.open();FR passed.PR merged
Verified the fix on SDK 7.5.0.v20181004095510. Works fine. Closing.
Operating System Name = Mac OS X Version = 10.13.6 Architecture = 64bit Node.js Node.js Version = 8.9.1 npm Version = 5.5.1 Titanium CLI CLI Version = 5.1.1 Titanium SDK SDK Version =7.5.0.v20181004095510 Device = iPhone xs max -ios 12 iPhone 6 -ios 11 simulatorPR - https://github.com/appcelerator/titanium_mobile/pull/10439
*Closing ticket.* Verified fix in SDK Version
8.0.0.v20181114074027.