-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtransitions_a.js
35 lines (25 loc) · 1000 Bytes
/
transitions_a.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var log = require('log');
function closeWindow() {
$.win.close();
}
function openWindowB() {
// For each setting
['activityEnterTransition', 'activityReturnTransition', 'activitySharedElementEnterTransition', 'activitySharedElementReturnTransition'].forEach(function(prop) {
var constant = $[prop].getSelectedRow(0).title;
if (constant.indexOf('TRANSITION_') === -1) {
log.args('Ti.UI.Window.' + prop, constant);
// We set a global that will be used for the creation-only property in transitions_a.tss
Alloy.Globals[prop] = undefined;
} else {
log.args('Ti.UI.Window.' + prop, 'Ti.UI.Android.' + constant);
Alloy.Globals[prop] = Ti.UI.Android[constant];
}
});
// Get Window B
var win = Alloy.createController('transitions_b').getView();
// Link shared elements using the transitionName also set in both XML files
win.addSharedElement($.logo, 'logo');
win.addSharedElement($.text, 'text');
// Open the Window
win.open();
}