Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4482] Android: Tabgroup.animate not working on Android 2.2 with Ti sdk 1.7.0

GitHub Issuen/a
TypeBug
PriorityMedium
StatusReopened
ResolutionUnresolved
Affected Version/sRelease 1.7.0, Release 3.3.0
Fix Version/sSprint 2011-43, Release 1.7.4, Release 1.8.0
ComponentsAndroid
LabelsRTN, engTriage, module_tabgroup, qe-testadded, reprod
ReporterAnirudh Nagesh
AssigneeUnknown
Created2011-06-22T13:42:11.000+0000
Updated2020-01-09T23:20:34.000+0000

Description

Copy the following code in app.js
/*
var tabGroup = Ti.UI.createTabGroup({bottom:-50});
tabGroup.addTab(Ti.UI.createTab({
    title: 'Tab 1',
    window: Ti.UI.createWindow({ backgroundColor: 'red', url: 'sub.js' })
}));
tabGroup.addTab(Ti.UI.createTab({
    title: 'Tab 2',
    window: Ti.UI.createWindow({ backgroundColor: 'blue', url: 'sub.js' })
}));
tabGroup.open();
*/

// this sets the background color of the master 
//UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
 
// create tab group
var tabGroup = Titanium.UI.createTabGroup({bottom:-50});
 
//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'Tab 1',
    window:win1
});
 
var toggleBtn = Titanium.UI.createButton({
    top:40,
    height:35,
    width:150,
    title:'toggle tab bar'
});
 
win1.add(toggleBtn);
toggleBtn.addEventListener('click', function(e){
 
    if (tabGroup.tabBarVisible == true) {
        tabGroup.animate({bottom:-50,duration:500});
        tabGroup.tabBarVisible = false;
    } else {
        tabGroup.animate({bottom:0,duration:500});
        tabGroup.tabBarVisible = true;
    }
});
 
//
// create controls tab and root window
//
var win2 = Titanium.UI.createWindow({  
    title:'Tab 2',
    backgroundColor:'#fff'
});
var tab2 = Titanium.UI.createTab({  
    icon:'KS_nav_ui.png',
    title:'Tab 2',
    window:win2
});
 
var label2 = Titanium.UI.createLabel({
    color:'#999',
    text:'I am Window 2',
    font:{fontSize:20,fontFamily:'Helvetica Neue'},
    textAlign:'center',
    width:'auto'
});
 
win2.add(label2);
 
 
 
//
//  add tabs
//
tabGroup.addTab(tab1);  
tabGroup.addTab(tab2);  
 
 
// open tab group
tabGroup.open();
The application works fine on 1.6.2

Associated Helpdesk Ticket

http://appc.me/c/APP-757696

Comments

  1. Bill Dawson 2011-10-12

    Pull request ready https://github.com/appcelerator/titanium_mobile/pull/553
  2. Bill Dawson 2011-10-25

    test case: When you tap the button the TabGroup should animate up/down (except for the very first time you tap the button, which doesn't do anything because of the way the test is written.)
  3. Michael Pettiford 2011-10-25

    Tested with 1.7.4.v20111025151415 with TiStudio 1.0.6.201110202348 on OSX Lion 10.7.2 G slate with OS version 3.1, Nexus S with OS version 2.3.6, and HTC Hero with OS version 2.1 Android Emulator with OS version 2.2 tabGroup.animate is called and behavior of toggling between animating up/down works as expected. Keeping open to confirm with 1.8 before closing.
  4. Natalie Huynh 2011-12-06

    Tested with 1.8.0.1.v20111205164258 v8/rhino on Galaxy 10.1 (3.1) Droid 1 (2.2.2) Nexus S (2.3.6)
  5. Priya Agarwal 2014-06-24

    Reopening the issue as Tab group. animate not working properly on android. For iOS it is working fine. Different Sdks has different behavior. Test Environment: Appcelerator-Studio:3.3.0.201406231625 Sdk:3.3.0.v20140623161712 acs:1.0.14 alloy:1.4.0-rc2 npm:1.3.2 titanium:3.3.0-rc2 titanium-code-processor:1.1.1 xcode:5.1.1 OS:Maverick(10.9.3) Device:Nexus5(v4.4.3),Nexus4(v4.1.1),GalaxyNote(v2.3.6) Clicking on "toggle tab bar" button observations are. For Nexus5(v4.4.3) device With 3.3.0.v20140623161712: has no effect. With 3.2.3.GA: window animates down continuously with every clicks. For Nexus4(v4.1.1) device With 3.3.0.v20140623161712: has no effect. With 3.2.3.GA: window animates down continuously with every clicks. For GalaxyNote(v2.3.6) device With 3.3.0.v20140623161712: window animates up and down on first click and then on second click the button itself animates up and down. With 3.2.3.GA: tab group animates down and flickers back to its original position on first click.On second click tab group animates up and flickers back to its original position.
  6. Lee Morris 2017-07-18

    I am able to reproduce this issue with the following environment; Pixel (7.1) Studio 4.9.0.201705302345 Ti SDK 6.1.1 GA Appc NPM 4.2.9 Appc CLI 6.2.2 Ti CLI 5.0.14 Alloy 1.9.11 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source