Titanium JIRA Archive
Appcelerator Community (AC)

[AC-180] Animation doesnt work when I dont explicitly pass '*dp'

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2015-11-10T06:02:32.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy, Titanium SDK & CLI
Labelsios, qe-testadded
ReporterCreative
AssigneeMostafizur Rahman
Created2015-06-25T08:26:56.000+0000
Updated2015-11-10T06:02:32.000+0000

Description

Animating an object from left to right:
var viewObject = Ti.UI.createButton({
  left: 10 // or '10dp' wouldnt make a difference (depending on tiapp.xml setting)
});

viewObject.animate({
   right: 20
});
You would expect the above to work when you have *dip* defined in your tiapp.xml. However, animation doesnt play (tested on iOS, not sure for Android) unless you define *right: '20dp'*.

Comments

  1. Jebun Naher 2015-11-09

    Hello We tested this issue but couldn't reproduce this as a bug in our environment. *Testing Environment:* Appcelerator Studio, build: 4.3.3.201510212245 Appcelerator Command-Line Interface, version 5.0.4 Mac Osx: 10.9.5 iOS simulator: iPhone5s (8.1) Node.js Version = 0.12.7 Jdk: 1.7.0_65 Ti Sdk : 5.0.2 *Test Case:*
       var win2 = Ti.UI.createWindow({
       	backgroundColor : 'white'
       });
       win2.open();
        
       var view = Ti.UI.createButton({
       	backgroundColor : 'blue',
       	top : 200,
       	height : 100,
       	width : 100,
       	left : 10
       });
       win2.add(view);
        
       var b1 = Ti.UI.createButton({
       	title : 'Animate',
       	top : 120,
       	left : 120
       });
       b1.addEventListener("click", function() {
       	view.left = 10;
       	view.animate({
       		left : 100,
       		duration : 1000
       	}, function() {
       		Ti.API.info('right movement complete');
       	});
       });
       win2.add(b1); 
       
    *Steps to test:* 1. Create a classic project 2. Open ti.xml file and replace dip 2. Replace app.js with below code 3. Run the project Click on animate button and observe that the animation is working properly. Thanks.

JSON Source