[ALOY-818] iOS7: NavigationWindow should work also inside Ti.UI.iPad.SplitWindow
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-09-04T23:35:46.000+0000 |
Affected Version/s | Alloy 1.3.0, Alloy 1.2.1 |
Fix Version/s | Alloy 1.3.0, Alloy 1.2.2, 2013 Sprint 18 |
Components | Titanium SDK, XML |
Labels | n/a |
Reporter | Federico Casali |
Assignee | Tony Lukasavage |
Created | 2013-09-04T18:40:05.000+0000 |
Updated | 2013-09-06T20:57:46.000+0000 |
Description
Description
Sample
In classic Titanium projects, this is showing two NavigationWindows inside a SplitView object (one as master view, the other as detail view)
var win1 = Ti.UI.createWindow({
backgroundColor:'gray'
});
var label1 = Ti.UI.createLabel({
text:'detail view',
color:'orange',
font:{
fontSize:'24dp'
},
fontWeight:'bold'
});
win1.add(label1);
var win2 = Ti.UI.createWindow({
backgroundColor:'purple'
});
var label2 = Ti.UI.createLabel({
text:'master view',
color:'orange',
font:{
fontSize:'24dp'
},
fontWeight:'bold'
});
win2.add(label2);
var nav = Ti.UI.iOS.createNavigationWindow({
window: win1
});
var masterView = Ti.UI.iOS.createNavigationWindow({
window: win2
});
var splitwin = Ti.UI.iPad.createSplitWindow({
detailView: nav,
masterView: masterView
});
splitwin.addEventListener('visible',function(e){
if (e.view == 'detail'){
e.button.title = "Master";
win1.leftNavButton = e.button;
} else if (e.view == 'master'){
win1.leftNavButton = null;
}
});
splitwin.open();
Alloy sample
On Alloy, this sample code is throwing the following exception when run:
[ERROR] : SplitWindow must have exactly 2 children that are Windows, a master and detail respectively
[ERROR] : Alloy compiler failed
index.xml
<Alloy>
<SplitWindow>
<!-- First window is the masterView -->
<NavigationWindow platform="ios">
<Window id="main" title="Main Window">
<Label class="space">I am the master view</Label>
</Window>
</NavigationWindow>
<!-- Second window is the detailView -->
<NavigationWindow platform='ios'>
<Window>
<Label>I am the detail view.</Label>
</Window>
</NavigationWindow>
</SplitWindow>
</Alloy>
PR (master): https://github.com/appcelerator/alloy/pull/240 commit (1_2_X): https://github.com/appcelerator/alloy/commit/c57e5ad31a4651b6f4e9b7c444023c5d79ea44b9 test apps:
https://github.com/appcelerator/alloy/tree/master/test/apps/ui/splitwindow
https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-818
functional testing (iPad only):ui/splitwindow
Run the app for ipad and ensure it functions as it always has. This is simply to ensure no regressions in the simplest cases
Change the in the index.xml to a
Attempt to run again and ensure that you get error that looks something like this:
Change the
Add a 3rd under the
Attempt to run again and ensure that you get an error that looks something like this:
testing/ALOY-818
Run the app on ipad
Ensure that it compiles and runs without error, showing both the master and detail windows (when in landscape orientation)