Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2373] Android: Height and width animations have side effects

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-11-14T20:22:42.000+0000
Affected Version/sRelease 3.0.0
Fix Version/s2013 Sprint 23, 2013 Sprint 23 API, Release 3.2.0
ComponentsAndroid
Labelscore, insight, module_animation, qe-closed-3.2.0, qe-testadded
ReporterKevin Whinnery
AssigneeHieu Pham
Created2011-04-15T03:18:07.000+0000
Updated2014-02-21T06:22:56.000+0000

Description

When attempting to animate height and width on a view in Android, there are some interesting side effects going on in the parent view. Here's an app.js to repro:
// Create application main window
var main = Ti.UI.createWindow({
    backgroundColor:'#000'
});

var container = Ti.UI.createView({
    height:300,
    width:300,
    backgroundColor:'#fff'
});
main.add(container);

var shifty = Ti.UI.createView({
    top:10,
    left:10,
    height:200,
    width:200,
    backgroundColor:'#ff0000'
});
container.add(shifty);

var btn = Ti.UI.createButton({
    title:'do it',
    height:50,
    width:100,
    bottom:10
});
btn.addEventListener('click', function() {
    shifty.animate({
        height:50,
        width:50,
        duration:1500
    });
});
main.add(btn);
 
main.open();

Attachments

FileDateSize
droid3.png2013-10-23T18:22:01.000+000015976
samsung_s3.png2013-10-23T18:22:01.000+000028682
samsung_s4.png2013-10-23T18:22:01.000+000038249

Comments

  1. Don Thorp 2011-04-15

    Still occurs in heavyweight windows too.

  2. Nikolai Derzhak 2011-04-15

    rollback wrong update
  3. Junaid Younus 2012-08-23

    Tested on a Samsung Galaxy S2 using TiSDK 2.2.0v20120821095711, issue still valid. Sometimes it animates the view perfectly fine, other times it actually has some weird effect on the parent view. If you keep trying for a few times, you should eventually be able to reproduce it.
  4. Allen Yeung 2013-08-01

    This is resolved in 3.2.0.
  5. Wilson Luu 2013-10-23

    Reopening ticket. Bug still occurs on Samsung Galaxy S4 (4.2.2) and Samsung Galaxy S3 (4.0.4) (see samsung_s4.png and samsung_s3.png). However, bug seems fixed on Droid3 (2.3.4) (see droid3.png) Tested on: Titanium Studio, build: 3.2.0.201310230548 OS: Mac OS X Mountain Lion (10.8.5) SDK build: 3.2.0.v20131022171645 Ti CLI: 3.2.0 (72f7426b4ee6c2d2883c666d5b7e03906a16012f) Devices: Droid3 (2.3.4), Samsung Galaxy S3 (4.0.4), Samsung Galaxy S4 (4.2.2) Note: If you are testing on a higher density android device like Samsung Galaxy S3, then add this to you tiapp.xml:
       <android xmlns:android="http://schemas.android.com/apk/res/android">
       	  <manifest>
       	        <supports-screens android:anyDensity="false"/>
       	   </manifest>
       	</android>
       
  6. Hieu Pham 2013-11-13

    master PR: https://github.com/appcelerator/titanium_mobile/pull/4957
  7. Ping Wang 2013-11-14

    The above PR fixes the issue on JellyBean devices. The issue on Galaxy S3 is filed as a different ticket TIMOB-15719. Resolved this ticket as Fixed.
  8. Samuel Dowse 2013-11-21

    +Verified fixed on:+ Max OSX 10.9 Mavericks Titanium Studio, build: 3.2.0.201311200322 Titanium SDK, build: 3.2.0.v20131120142443 CLI: 3.2.0-alpha Alloy: 1.3.0-alpha +Tested and fixed on the following devices:+ Sony Xperia U (2.3.7) Sony Xperia S (4.1.2) Samsung Galaxy Note II (4.1.2) Google Nexus 5 (4.4) Samsung Galaxy S4 (4.2.2 +Still occurs on:+ Samsung Galaxy SIII (4.0.4) Animation runs smoothly using the code in the example with both fixes provided in comments. Closing.

JSON Source