[TIMOB-17630] Animation based on opacity does not work properly for TabGroup
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2014-11-17T23:41:55.000+0000 |
Affected Version/s | Release 3.3.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | TCSupport, defect, ios, parity |
Reporter | David He |
Assignee | Ingo Muschenetz |
Created | 2014-08-22T01:31:00.000+0000 |
Updated | 2017-03-21T19:11:49.000+0000 |
Description
Opacity is an undocumented feature in tabgroup. However, setting it to either 1 or 0 when creating tabgroup does make difference - make tabgroup either visible or invisible. When trying to animate the closing and opening of tabgroup, only fade-out effect which sets opacity value from 1 to 0 within the specified duration time. Fade-in effect which works the other way around does not work at all. I think it is a parity issue?
See the code snippet below
var global = {};
var baseWin = Ti.UI.createWindow({
title : "Main Window",
backgroundColor : "green"
});
var button = Ti.UI.createButton({
title : "Open TabGroup"
});
button.addEventListener("click", function() {
global.tbg = buildTabGroup();
fadeOut(baseWin, 2000, function() {
showTbgWithoutAnimation(); // this works
// showTbgWithAnimation(); this does not work.
});
});
baseWin.add(button);
function showTbgWithoutAnimation() {
global.tbg.open();
}
function showTbgWithAnimation() {
fadeIn(global.tbg, 2000, function() {
global.tbg.open();
});
}
function buildTabGroup() {
var self = Ti.UI.createTabGroup({
backgroundColor : "green",
opacity : 1
});
var win1 = Ti.UI.createWindow(), win2 = Ti.UI.createWindow();
var btn1 = Ti.UI.createButton({
title : "close tbg"
});
btn1.addEventListener("click", function(e) {
fadeOut(global.tbg, 2000, function() {
global.tbg.close();
fadeIn(baseWin, 2000, function() {
});
});
});
var tab1 = Ti.UI.createTab({
title : L('home'),
icon : '/images/KS_nav_ui.png',
window : win1
});
win1.containingTab = tab1;
var tab2 = Ti.UI.createTab({
title : L('settings'),
icon : '/images/KS_nav_views.png',
window : win2
});
win1.add(btn1);
win2.containingTab = tab2;
self.addTab(tab1);
self.addTab(tab2);
return self;
}
function fadeIn(to, duration, finishCallback) {
to.animate({
opacity : 1,
duration : duration
}, finishCallback);
}
function fadeOut(to, duration, finishCallback) {
to.animate({
opacity : 0,
duration : duration
}, finishCallback);
}
baseWin.open();
The problem is animation will not work on window and tabgroup before they are opened. Not sure if this is a bug or not.
I reckon that behavior is correct. Please close this ticket Thanks
Closing as invalid based on commenter's feedback.
Closing ticket as invalid.