Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9954] Android: Animate incorrectly positions when ti.ui.defaultunit is set to a non-platform default (Tiapp.xml)

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-08-09T05:12:27.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sSprint 2012-14 Core, Release 2.1.1, Release 3.0.0
ComponentsAndroid
Labelscommunity, core, module_animation, qe-review, qe-testadded
ReporterSam Cleaver
AssigneeBill Dawson
Created2012-07-08T11:47:47.000+0000
Updated2012-08-09T05:12:27.000+0000

Description

To alleviate differences in platform units, the following can be inserted into Tiapp.xml (in this case to force everything to dip): dip This however breaks the animate function when using positioning on Android. For example if I have a view (bear in mind, units are not given so defaults to dip): {quote} var view = Ti.UI.createView(\{ backgroundColor:'#252525', top:80, left:0, width:100, height:100 \}); {quote} Which I then choose to animate: {quote} var a2 = Titanium.UI.createAnimation(); a2.top = 80; a2.left = 50; a2.duration = 800; view.animate(a2); {quote} It seems that while the animation is occuring, it reads the top/left animate values in pixels (rather than dip) which really ruins the animation. At the end of the animation it switches back to dip so ultimately the view does get put in the correct place but obviously in very buggy way.

Comments

  1. Varun Joshi 2012-07-11

    Hi Sam, What version of the Ti SDK are you using? Regards, Varun
  2. Sam Cleaver 2012-07-12

    Hi Varun, Got this from the "Run Diagnostic Test" part of Titanium Studio; I'm reasonably new to this environment so let me know if there's a better way. {quote} Titanium Mobile SDK Version: 2.1.0 Mobile SDK Modules API Version:2 Mobile SDK Timestamp: 06/28/12 12:16 Mobile SDK Build Number: 6e3cab6 {quote} Thanks, Sam
  3. Varun Joshi 2012-07-12

    Hi Sam, Thanks for this info. You can also just look at the tiapp.xml file for the sdk you are using. Thanks, Varun
  4. Sam Cleaver 2012-07-12

    Hi Varun, Just checked, its definitely using 2.1.0. I tried with 2.0.2 and the issue is also present. If it helps, I made a really simple sample app (based off the single window starter) to demonstrate the issue. Just load (I can only test on Android) and click the grey box, it should smoothly move to the right but instead dips down two-thirds of the screen during the transition! Exported from Ti Studio: http://beaver6813/dev/Titanium/JiraTestcase.zip Cheers, Sam
  5. Bill Dawson 2012-07-12

    Test case for TIMOB-9827 will cover this, since (in the testing notes) I'll specifically tell the tester to use that tiapp.xml setting.
  6. Bill Dawson 2012-07-12

    I ended up fixing this while working on TIMOB-9827. Pull request for that item coming soon (today).
  7. Sam Cleaver 2012-07-13

    Good work Bill, I guess this can be marked as resolved now then. Any idea when 2.2.0 is being cut/released? At the moment I've had to work around by manually running any DIP values through a function to convert to the platform/system values! (and removing the defaultunit)
  8. Neeraj Gupta 2012-07-13

    @Sam - Release 2.2.0 is scheduled to be out at the end of September but we have put this fix in 2.1.1 release that should be out by the end of this month. You can also use CI build now to test the fix with your application and provide feedback.
  9. Anshu Mittal 2012-07-16

    Verified with SDK:2.2.0.v20120713210112 Verified with STUDIO:2.1.1.201207161421 Device: Samsung Galaxy Nexus(4.0.2) Animates the positions correctly when ti.ui.defaultunit is set to non platform dafault(Tiapp.xml)
  10. Shyam Bhadauria 2012-08-09

    Re-opening to edit label

JSON Source