Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-13671

Android: animate crashes the app if view has a border

    Details

      Description

      Description of the problem

      Animating a view which has a border (set either borderRadius, borderWidth or borderColor) fails and the app crashes.

      Steps to reproduce

      Use the following code: clicking on a view, the animation does not run properly, and in the end it crashes. Note that you can comment out any of the border properties (one by one even) to see the error. Removing all of them works fine.

      var win = Ti.UI.createWindow({
      	backgroundColor: 'black'
      });
       
      var view = Ti.UI.createView({
      	backgroundColor: 'red',
      	borderRadius: 20,
      	borderColor: 'white',
      	borderWidth: 10,
      	top: 10,
      	width: 100,
      	height: 100
      });
      view.addEventListener('click', function() {
      	view.animate({
      		top: 100,
      		duration: 3000
      	});
      });
      win.add(view);
       
      win.open();
      

      Log error

      E/TiApplication( 3620): java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to org.appcelerator.titanium.view.TiCompositeLayout$LayoutParams
      E/TiApplication( 3620): 	at org.appcelerator.titanium.util.TiAnimationBuilder$AnimationListener.onAnimationEnd(TiAnimationBuilder.java:618)
      E/TiApplication( 3620): 	at android.view.animation.Animation.fireAnimationEnd(Animation.java:920)
      E/TiApplication( 3620): 	at android.view.animation.Animation.getTransformation(Animation.java:878)
      E/TiApplication( 3620): 	at android.view.animation.Animation.getTransformation(Animation.java:940)
      E/TiApplication( 3620): 	at android.view.animation.AnimationSet.getTransformation(AnimationSet.java:384)
      E/TiApplication( 3620): 	at android.view.animation.Animation.getTransformation(Animation.java:940)
      E/TiApplication( 3620): 	at android.view.View.drawAnimation(View.java:13205)
      E/TiApplication( 3620): 	at android.view.View.draw(View.java:13344)
      E/TiApplication( 3620): 	at android.view.ViewGroup.drawChild(ViewGroup.java:2928)
      E/TiApplication( 3620): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2797)
      E/TiApplication( 3620): 	at android.view.View.draw(View.java:13715)
      E/TiApplication( 3620): 	at android.widget.FrameLayout.draw(FrameLayout.java:467)
      E/TiApplication( 3620): 	at android.view.View.draw(View.java:13596)
      E/TiApplication( 3620): 	at android.view.ViewGroup.drawChild(ViewGroup.java:2928)
      E/TiApplication( 3620): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2797)
      E/TiApplication( 3620): 	at org.appcelerator.titanium.view.TiCompositeLayout.dispatchDraw(TiCompositeLayout.java:688)
      E/TiApplication( 3620): 	at android.view.View.draw(View.java:13715)
      E/TiApplication( 3620): 	at android.view.View.draw(View.java:13596)
      E/TiApplication( 3620): 	at android.view.ViewGroup.drawChild(ViewGroup.java:2928)
      E/TiApplication( 3620): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2797)
      E/TiApplication( 3620): 	at org.appcelerator.titanium.view.TiCompositeLayout.dispatchDraw(TiCompositeLayout.java:688)
      E/TiApplication( 3620): 	at android.view.View.draw(View.java:13594)
      E/TiApplication( 3620): 	at android.view.ViewGroup.drawChild(ViewGroup.java:2928)
      E/TiApplication( 3620): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2797)
      E/TiApplication( 3620): 	at android.view.View.draw(View.java:13594)
      E/TiApplication( 3620): 	at android.view.ViewGroup.drawChild(ViewGroup.java:2928)
      E/TiApplication( 3620): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2797)
      E/TiApplication( 3620): 	at android.view.View.draw(View.java:13594)
      E/TiApplication( 3620): 	at android.view.ViewGroup.drawChild(ViewGroup.java:2928)
      E/TiApplication( 3620): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2797)
      E/TiApplication( 3620): 	at android.view.View.draw(View.java:13715)
      E/TiApplication( 3620): 	at android.widget.FrameLayout.draw(FrameLayout.java:467)
      E/TiApplication( 3620): 	at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2211)
      E/TiApplication( 3620): 	at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2281)
      E/TiApplication( 3620): 	at android.view.ViewRootImpl.draw(ViewRootImpl.java:2177)
      E/TiApplication( 3620): 	at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2045)
      E/TiApplication( 3620): 	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1854)
      E/TiApplication( 3620): 	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989)
      E/TiApplication( 3620): 	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)
      E/TiApplication( 3620): 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
      E/TiApplication( 3620): 	at android.view.Choreographer.doCallbacks(Choreographer.java:562)
      E/TiApplication( 3620): 	at android.view.Choreographer.doFrame(Choreographer.java:532)
      E/TiApplication( 3620): 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
      E/TiApplication( 3620): 	at android.os.Handler.handleCallback(Handler.java:725)
      E/TiApplication( 3620): 	at android.os.Handler.dispatchMessage(Handler.java:92)
      E/TiApplication( 3620): 	at android.os.Looper.loop(Looper.java:137)
      E/TiApplication( 3620): 	at android.app.ActivityThread.main(ActivityThread.java:5041)
      E/TiApplication( 3620): 	at java.lang.reflect.Method.invokeNative(Native Method)
      E/TiApplication( 3620): 	at java.lang.reflect.Method.invoke(Method.java:511)
      E/TiApplication( 3620): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
      E/TiApplication( 3620): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
      E/TiApplication( 3620): 	at dalvik.system.NativeStart.main(Native Method)
      E/AndroidRuntime( 3620): FATAL EXCEPTION: main
      E/AndroidRuntime( 3620): java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to org.appcelerator.titanium.view.TiCompositeLayout$LayoutParams
      E/AndroidRuntime( 3620): 	at org.appcelerator.titanium.util.TiAnimationBuilder$AnimationListener.onAnimationEnd(TiAnimationBuilder.java:618)
      E/AndroidRuntime( 3620): 	at android.view.animation.Animation.fireAnimationEnd(Animation.java:920)
      E/AndroidRuntime( 3620): 	at android.view.animation.Animation.getTransformation(Animation.java:878)
      E/AndroidRuntime( 3620): 	at android.view.animation.Animation.getTransformation(Animation.java:940)
      E/AndroidRuntime( 3620): 	at android.view.animation.AnimationSet.getTransformation(AnimationSet.java:384)
      E/AndroidRuntime( 3620): 	at android.view.animation.Animation.getTransformation(Animation.java:940)
      E/AndroidRuntime( 3620): 	at android.view.View.drawAnimation(View.java:13205)
      E/AndroidRuntime( 3620): 	at android.view.View.draw(View.java:13344)
      E/AndroidRuntime( 3620): 	at android.view.ViewGroup.drawChild(ViewGroup.java:2928)
      E/AndroidRuntime( 3620): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2797)
      E/AndroidRuntime( 3620): 	at android.view.View.draw(View.java:13715)
      E/AndroidRuntime( 3620): 	at android.widget.FrameLayout.draw(FrameLayout.java:467)
      E/AndroidRuntime( 3620): 	at android.view.View.draw(View.java:13596)
      E/AndroidRuntime( 3620): 	at android.view.ViewGroup.drawChild(ViewGroup.java:2928)
      E/AndroidRuntime( 3620): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2797)
      E/AndroidRuntime( 3620): 	at org.appcelerator.titanium.view.TiCompositeLayout.dispatchDraw(TiCompositeLayout.java:688)
      E/AndroidRuntime( 3620): 	at android.view.View.draw(View.java:13715)
      E/AndroidRuntime( 3620): 	at android.view.View.draw(View.java:13596)
      E/AndroidRuntime( 3620): 	at android.view.ViewGroup.drawChild(ViewGroup.java:2928)
      E/AndroidRuntime( 3620): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2797)
      E/AndroidRuntime( 3620): 	at org.appcelerator.titanium.view.TiCompositeLayout.dispatchDraw(TiCompositeLayout.java:688)
      E/AndroidRuntime( 3620): 	at android.view.View.draw(View.java:13594)
      E/AndroidRuntime( 3620): 	at android.view.ViewGroup.drawChild(ViewGroup.java:2928)
      E/AndroidRuntime( 3620): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2797)
      E/AndroidRuntime( 3620): 	at android.view.View.draw(View.java:13594)
      E/AndroidRuntime( 3620): 	at android.view.ViewGroup.drawChild(ViewGroup.java:2928)
      E/AndroidRuntime( 3620): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2797)
      E/AndroidRuntime( 3620): 	at android.view.View.draw(View.java:13594)
      E/AndroidRuntime( 3620): 	at android.view.ViewGroup.drawChild(ViewGroup.java:2928)
      E/AndroidRuntime( 3620): 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2797)
      E/AndroidRuntime( 3620): 	at android.view.View.draw(View.java:13715)
      E/AndroidRuntime( 3620): 	at android.widget.FrameLayout.draw(FrameLayout.java:467)
      E/AndroidRuntime( 3620): 	at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2211)
      E/AndroidRuntime( 3620): 	at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2281)
      E/AndroidRuntime( 3620): 	at android.view.ViewRootImpl.draw(ViewRootImpl.java:2177)
      E/AndroidRuntime( 3620): 	at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2045)
      E/AndroidRuntime( 3620): 	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1854)
      E/AndroidRuntime( 3620): 	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989)
      E/AndroidRuntime( 3620): 	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)
      E/AndroidRuntime( 3620): 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
      E/AndroidRuntime( 3620): 	at android.view.Choreographer.doCallbacks(Choreographer.java:562)
      E/AndroidRuntime( 3620): 	at android.view.Choreographer.doFrame(Choreographer.java:532)
      E/AndroidRuntime( 3620): 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
      E/AndroidRuntime( 3620): 	at android.os.Handler.handleCallback(Handler.java:725)
      E/AndroidRuntime( 3620): 	at android.os.Handler.dispatchMessage(Handler.java:92)
      E/AndroidRuntime( 3620): 	at android.os.Looper.loop(Looper.java:137)
      E/AndroidRuntime( 3620): 	at android.app.ActivityThread.main(ActivityThread.java:5041)
      E/AndroidRuntime( 3620): 	at java.lang.reflect.Method.invokeNative(Native Method)
      E/AndroidRuntime( 3620): 	at java.lang.reflect.Method.invoke(Method.java:511)
      E/AndroidRuntime( 3620): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
      E/AndroidRuntime( 3620): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
      E/AndroidRuntime( 3620): 	at dalvik.system.NativeStart.main(Native Method)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bijuexalture Biju pm
                Reporter:
                dcassenti Davide Cassenti
                Reviewer:
                Allen Yeung
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-16340
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration