Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15472] Android: Animating a view's width changes its height

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-12-12T16:06:23.000+0000
Affected Version/sRelease 3.1.3
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, animation, triage, width
ReporterMeenakshi Pathak
AssigneeSunila
Created2013-10-14T06:51:02.000+0000
Updated2017-03-21T22:20:16.000+0000

Description

While animating a view's width, its height also changes. *Steps To Reproduce* 1.Here is the sample test case:

var win = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});

var view=Ti.UI.createView({
	left: 0,
	top: 0,
	width: '44dp',
	height:'150dp',
	backgroundColor:"#999999"
});

var label1 = Titanium.UI.createLabel({
	color:'white',
	text:'Tap',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'auto'
});

var expanded = false;
label1.addEventListener('singletap', function (e) {
	var newWidth,
		animation;

	if (expanded) {
		newWidth = '44dp';
	} else {
		newWidth = '250dp';
	}

	expanded = !expanded;
	
	animation = Ti.UI.createAnimation({
		width: newWidth,
		duration: 250,
		
	});
	
	view.animate(animation);
});

view.add(label1);
win.add(view);
win.open();
2. Launch the application and click on the label 'Tap'. 3. Height also changes with the animation of view's width.

Comments

  1. Sunila 2013-12-12

    Tried with latest master and is working fine
  2. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced and due to the above comments.

JSON Source