Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17274] Android: Animation suddenly stops

GitHub Issuen/a
TypeBug
PriorityHigh
StatusReopened
ResolutionUnresolved
Affected Version/sRelease 3.2.3, Release 3.3.0
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterFix Please
AssigneeUnknown
Created2014-05-29T10:51:10.000+0000
Updated2018-02-28T20:04:23.000+0000

Description

Problem Description

The animation in the code will suddenly stop if running with 3.2.3.GA/3.3.0.RC. If you are using 3.2.2.GA, will continue without any issue. See the video attached. Note, that I has not managed to recreate the issue on the GT-S7562 device. At the same time the issue can be easily recreated on the AVD.
<Alloy>
	<Window class="container">
	  <View borderWidth="1" borderColor="black" width="30" height="Titanium.UI.FILL"></View>
    <View borderWidth="1" borderColor="black" width="Titanium.UI.FILL" height="30"></View>
    <View borderWidth="1" borderColor="black" width="60" height="Titanium.UI.FILL"></View>
    <View borderWidth="1" borderColor="black" width="Titanium.UI.FILL" height="60"></View>
    <View borderWidth="1" borderColor="black" width="90" height="Titanium.UI.FILL"></View>
    <View borderWidth="1" borderColor="black" width="Titanium.UI.FILL" height="90"></View>
	</Window>
</Alloy>
var view = Ti.UI.createView({
  backgroundColor: 'green',
  opacity: 1,
  width: 30,
  height: 30,
});
  
var baseX, baseY;
var onPostLayout = function() {
  baseX = view.rect.x;
  baseY = view.rect.y;

  Ti.API.info('postlayout: ' + baseX + ", " + baseY);

  startAnimation();
  
  view.removeEventListener('postlayout', onPostLayout);
};

view.addEventListener('postlayout', onPostLayout);

var animation = Ti.UI.createAnimation();
  
animation.addEventListener('complete', function() {
  Ti.API.info('Animation complete');
  startAnimation();
});
  
var shiftX = 15;
var shiftY = 15;
  
function startAnimation() {
  shiftX = -shiftX;
  shiftY = -shiftY;
       
  animation.left = baseX + shiftX;
  animation.top = baseY + shiftY;
  animation.duration = 2000;
  
  Ti.API.info('Start Animation: ' + JSON.stringify(animation));
  view.animate(animation);
};

$.index.add(view);
$.index.open();

Attachments

FileDateSize
animation1.avi2014-05-29T10:52:11.000+00003185126

Comments

  1. Ritu Agrawal 2014-06-09

    I tried to reproduce the issue with Titanium SDK 3.2.3 GA on Samsung Galaxy device and was not able to reproduce it. I don't see any difference in the animation with Titanium SDK 3.2.2 GA and 3.2.3 GA. Can you please try it on some other devices as this will help us narrow down the issue?
  2. Mauro Parra-Miranda 2014-06-09

    Hello! I tested this on Mobile SDK 3.2.3.GA on a Motorola X with Android 4.4.2 and it's working just fine. Can you please provide more info? When the animation stops working in your testing? Best, Mauro
  3. Fix Please 2014-06-11

    Hi Mauro, have you seen the video attached? Seems, the easiest way to recreate the issue is to use x86 AVD and the code provided. I've just recreated it on Nexus_10_by_Google, Android 4.4.2/19, Intel Atom (x86) AVD
  4. jithinpv 2014-08-22

    Cannot reproduce Titanium SDK version 3.4.0 master, 3.3.0.GA, 3.2.3.GA, 3.2.2.GA Titanium Studio, build: 3.3.0.201407100905 Titanium Command-Line Interface CLI version 3.3.0, Android emulator , Android version : 2.3.3
  5. Ingo Muschenetz 2014-08-22

    [~jithinv@exalture.com] can you please try the EXACT AVD as specified in the line above: Nexus_10_by_Google, Android 4.4.2/19, Intel Atom (x86) AVD
  6. jithinpv 2014-08-29

    Sorry, we are unable to test with the specified AVD.
  7. Fix Please 2014-10-03

    I've just made some more tests... Seems the issue only occurs with "Use host GPU" turned 'on'. This time I used the 2.3.3 Android version and was able to recreate the issue.

JSON Source