Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
dbigham
Posts: 552
Registered: ‎04-01-2009
My Device: Z10, PlayBook
Accepted Solution

Images animate into place when loading new QML file

I've noticed that when I load new QML files, the images animate into place.

 

For example, if the screen contains an image at position X,Y and it is of width W and height H, then the image becomes visible at coordinates 0,0 and has width 0 and height 0, and then animates into place by flying over to coordinates X,Y and growing to eventually be of width W and height H.

 

If I then click the "Back" button and go to that QML screen a second time, it doesn't animate.

 

Is this implicit animation intended?  While implicit animations are rather amazing and a great tool to have, it seems counter intuitive to have screens use implicit animations when they are first loaded. It creates a rather unpleasant business and visual distraction when the screen is loading.

 

I thought I could disable this by adding the following to the ImageView controls:

 

                attachedObjects: [
                    ImplicitAnimationController {
                        enabled: false
                    }
                ]

 

... but they are still animating.

 

Thanks,

Daniel

Developer
HuXu77
Posts: 196
Registered: ‎02-10-2011
My Device: Playbook 16GB and Z10

Re: Images animate into place when loading new QML file

[ Edited ]

I've noticed the same thing yet mine appears to be very suttle. I like it, I think it gives my app just a little more life to it.

 

That being said, I have no idea how to disabled it....

_________________________________________________
Apps
Go Music
Flashlight Fast Free/Pro
Fitbit for BlackBerry PlayBook
BlackBerry Development Advisor (Retired)
danielrr5
Posts: 32
Registered: ‎05-09-2012
My Device: BB10

Re: Images animate into place when loading new QML file

Try specifying the property you want to disable as such:

 

attachedObjects: [
                    ImplicitAnimationController {
                        propertyName: "translationX"
enabled: false } ]

Let me know if it works.

Developer
dbigham
Posts: 552
Registered: ‎04-01-2009
My Device: Z10, PlayBook

Re: Images animate into place when loading new QML file

No, that doesn't appear to work... I tried:

 

attachedObjects: [
    ImplicitAnimationController {
        propertyName: "translationX"
        enabled: false
    },
    ImplicitAnimationController {
        propertyName: "translationY"
        enabled: false
    },
    ImplicitAnimationController {
        propertyName: "scaleX"
        enabled: false
    },
    ImplicitAnimationController {
        propertyName: "scaleY"
        enabled: false
    }
]

 

I also tried adding those attached objects to both the ImageView as well as its parent container.

BlackBerry Development Advisor (Retired)
danielrr5
Posts: 32
Registered: ‎05-09-2012
My Device: BB10

Re: Images animate into place when loading new QML file

Can you share snippets of your code so I can try to reproduce the problem?

Thanks in advance,
Daniel
Developer
dbigham
Posts: 552
Registered: ‎04-01-2009
My Device: Z10, PlayBook

Re: Images animate into place when loading new QML file

Here's the code:

 

 

import bb.cascades 1.0

NavigationPane {
    Page {
        content: Container {
            layout: StackLayout {
            }
            Container {
                layout: DockLayout {
                }
                ImageView {
                    id: momImage
                    layoutProperties: DockLayoutProperties {
                        verticalAlignment: VerticalAlignment.Top
                        horizontalAlignment: HorizontalAlignment.Left
                    }
                    imageSource: "asset:///images/boys.png"
                    scalingMethod: ScalingMethod.AspectFill
                    bottomMargin: 0
                    topMargin: 0
					attachedObjects: [
					    ImplicitAnimationController {
					        propertyName: "translationX"
					        enabled: false
					    },
					    ImplicitAnimationController {
					        propertyName: "translationY"
					        enabled: false
					    },
					    ImplicitAnimationController {
					        propertyName: "scaleX"
					        enabled: false
					    },
					    ImplicitAnimationController {
					        propertyName: "scaleY"
					        enabled: false
					    }
					]
                }
            }
            Container {
                layout: DockLayout {
                }
                ImageView {
                    id: dadImage
                    layoutProperties: DockLayoutProperties {
                        verticalAlignment: VerticalAlignment.Top
                        horizontalAlignment: HorizontalAlignment.Left
                    }
                    imageSource: "asset:///images/girls.png"
                    scalingMethod: ScalingMethod.AspectFill
                    bottomMargin: 0
                    topMargin: 0
					attachedObjects: [
					    ImplicitAnimationController {
					        propertyName: "translationX"
					        enabled: false
					    },
					    ImplicitAnimationController {
					        propertyName: "translationY"
					        enabled: false
					    },
					    ImplicitAnimationController {
					        propertyName: "scaleX"
					        enabled: false
					    },
					    ImplicitAnimationController {
					        propertyName: "scaleY"
					        enabled: false
					    }
					]
                }
            }
        }
    }
}

And here are the images:

 

http://danielbigham.ca/boys.png

http://danielbigham.ca/girls.png

 

BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha

Re: Images animate into place when loading new QML file

Have you tried disabling implicit animations for your components using the ImplicitAnimationController?

https://developer.blackberry.com/cascades/documentation/ui/animations/implicit_animations.html

 

Martin

 

Developer
dbigham
Posts: 552
Registered: ‎04-01-2009
My Device: Z10, PlayBook

Re: Images animate into place when loading new QML file

Did you notice the sample code above? :smileyhappy:  (yes)

 

This appears to be fixed with the most recent SDK.

Developer
meego_man
Posts: 191
Registered: ‎11-25-2012
My Device: BlackBerry Dev Alpha B

Re: Images animate into place when loading new QML file

Beta 4 has the same issue again (?). Nothing helps to disable the ImageView animation when a new image is set :smileysad: For my app this implicit animation is extremely undesirable. Gosh, I wish we could have access to camera and invocation framework from Qt apps without using Cascades