Titanium JIRA Archive
Appcelerator Community (AC)

[AC-984] "New layout" warning using animation

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2015-09-29T03:59:16.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsanimation, ios, mobilesdk
ReporterAndrea Vitale
AssigneeShak Hossain
Created2015-03-10T13:11:02.000+0000
Updated2016-03-08T07:37:18.000+0000

Description

"New layout set while view [object Arrow] animating: Will relayout after animation." warning appears when I'll try to create a simple animation with opacity. Steps: 1. Create imageview, 2. Animate using this code $.Arrow.animate({ opacity: 0.2, duration: 800 });

Comments

  1. Shuo Liang 2015-03-11

    Hi, This should be a normal behave, it just tell you that your layout may change. It will not impact your application's running. Regards, Shuo
  2. Andrea Vitale 2015-03-11

    So.. There's a way to hide these WARN messages? I've a continuous animation and this is too annoying.
  3. Prashant Sheth 2015-03-23

    HI, The issue is not the warnings. (I am working on an app with similar issue to this, so adding my issue here as comment.) The issue is this: we have multiple Views in the app View 1: has an animation sequence: animation is started User switches to View 2..3... comes back to View 1: Now in View 1: the animation sequence is re-initiated and hence causes disruption the question is: 1. Is there a way i can stop (complete doesn't work) the animation and restart it when the views are switched? If so how would I approach this where do i stop/start the animation (what event) for this to happen? HOW (what command) do I use to stop/start the animation? Please let me know and I appreciate this in advance!! There's no limit as to how many times the user will comeback to the animation view.. they can go in and out, switch to different apps and relaunch the app, at all these points the animation is restarted in the view. THANKS Prashant
  4. Rakhi Mitro 2015-09-01

    Hello, I have tested this issue in updated environment. We could not reproduce it. *Test Environments:* CLI Version :4.0.1 Titanium SDK Version:4.1.0.GA Android: Google Galaxy Nexus:4.1.1 - API 16 - 720x1280 Appc Studio: Appcelerator Studio, build: 4.1.1.201507141126 Alloy: 1.7.3 Target Platform = simulator,iOS SDK: 8.1 *Test code:* *index.js*
       
       function doClick(e) {
       	
       	 var matrix = Ti.UI.create2DMatrix()
       	  matrix = matrix.rotate(180);
       	  matrix = matrix.scale(2, 2);
       	  var a = Ti.UI.createAnimation({
       	    transform : matrix,
       	    duration : 100,
       	    autoreverse : true,
       	    opacity: 0.2,
       	    repeat : 3
       	  });
       	
       	  $.loadingImgView.animate(a);
       	  var animationHandler = function() {
       		  a.removeEventListener('complete',animationHandler);
       		  Ti.API.info("Animation Completd");
       		  $.bg.backgroundColor = 'pink';
       		  $.bg.animate(a);
       		};
       		a.addEventListener('complete',animationHandler);
       		$.bg.animate(a);
          
       }
       
       $.index.open();
       
       
    index.xml
       <Alloy>
       
       <Window class="container">
       
       <Button id="label" onClick="doClick">Click</Button>
       
       <View id="bg" borderRadius="10" backgroundColor="red" width="500" height="500" >
       <ImageView id="loadingImgView" image="/loading/1.png" />
       
       </View>
       
       </Window>
       
       </Alloy>
       
       
    index.tss
       ".container": {
       	backgroundColor:"white",
       	layout:'vertical'
       }
       
       "Label": {
       	width: Ti.UI.SIZE,
       	height: Ti.UI.SIZE,
       	color: "#000",
       	top:'5'
       }
       
       "#buttonid": {
       	font: {
       		fontSize: 12
       	},
       	top:'20',
       	backgroundColor:"orange",
       	width:'200',
       	width:'30'
       }
       
       
       
       "#bg": {
       	backgroundColor:"orange",
       	top:'50'
       },
       
       "#loadingImgView" : {
             duration: 100,
           repeatCount: 0,
          
       }
       
          
       
       
    *Test Steps:* * Create an alloy project . * Copy above test code into your project. * Run the project *Ti logs:* [INFO] : Finished building the application in 2m 20s 341ms [INFO] : Launching iOS Simulator [INFO] : Project built successfully in 4m 21s 902ms -- Start simulator log ------------------------------------------------------- [INFO] : Application started [INFO] : testalloy123/1.0 (4.1.0.d57aa7d) [WARN] : New layout set while view [object loadingImgView] animating: Will relayout after animation. [WARN] : New layout set while view [object loadingImgView] animating: Will relayout after animation. [INFO] : Animation Completd [WARN] : New layout set while view [object loadingImgView] animating: Will relayout after animation. [WARN] : New layout set while view [object loadingImgView] animating: Will relayout after animation. [WARN] : New layout set while view [object loadingImgView] animating: Will relayout after animation. *Test Result:* Project builds successfully with warning in simulator. This warning be a normal behave, it just tell you that your layout may change. It will not impact application's running.Auto Complete event is working as expected. Thanks

JSON Source