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
simon_hain
Posts: 15,937
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany
Accepted Solution

Can I supress visibility animations?

I have a container with a lot of items which are all not visible, only a title label is displayed.

On touch on the label the elements of the container are all made visible.

 

On my Z10 (and DevAlphaB) this creates a very laggy animation (it works good on the DevAlphaC/Q10).

Is there a possibility to disable the animation for the visibility change?

 

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
Benecore
Posts: 453
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: T-Mobile

Re: Can I supress visibility animations?

Are you tried use opacity instead of visible property? In my apps (for harmattan and symbian) I use opacity instead of visible because in many case lags.

Jus suggestion :smileywink:


If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Please use plain text.
Developer
simon_hain
Posts: 15,937
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Can I supress visibility animations?

[ Edited ]

but wouldn't the item still occupy the full space with opacity 0?

 

I have added ImplicitAnimationControllers with all possible properties and set them to enabled=false.
This makes it a bit faster, but still too slow. For a container with 100 items it takes about 6 minutes to complete.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
Benecore
Posts: 453
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: T-Mobile

Re: Can I supress visibility animations?

Wow 6 minutes, nice time :smileyvery-happy:

Yes, will occupy full space I think. I don't know how it works on Cascades. Maybe if you try set opacity to 0 and also maxHeight to 0, but... not tested


If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Please use plain text.
Developer
slashkyle
Posts: 814
Registered: ‎10-16-2012
My Device: Red Z10, Dev Alpha C
My Carrier: Telus

Re: Can I supress visibility animations?

I belive using Implicit or Explicit Animations controllers gives you the ability to control the default animation

Please use plain text.
Developer
simon_hain
Posts: 15,937
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Can I supress visibility animations?


slashkyle wrote:

I belive using Implicit or Explicit Animations controllers gives you the ability to control the default animation


I have placed ImplicitAnimationController for all possible properties as attached objects AND set implicitLayoutAnimationsEnabled: false, to no avail.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
simon_hain
Posts: 15,937
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Can I supress visibility animations?

I am fishing in the dark, i have no idea what causes this.

The containers that were made visible had several LayoutHandlers which were called repeatedly, but removing them has changed nothing. I also tried to cache the value given in the LayoutHandler in a property, but the property was not set on the next call, which means the calls to the LayoutHandler were all coming in at once.

 

Here is a screenshot of a container with 100 sub-containers made visible (the same happens with 20, only a bit less slow) :

 

IMG_00000058.png

 

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
simon_hain
Posts: 15,937
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Can I supress visibility animations?

It seems that the issue is in my code after all. I re-built an old version and the issue does not come up there.

Back to the starting point. My new theory is that maybe the event thread is blocked by something, thus slowing down the animation. No clue how i can check that, though.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
simon_hain
Posts: 15,937
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Can I supress visibility animations?

found it. In the main page there was a LayoutHandler that was only added on devices without keyboard, it changed the height to avoid the virtual keyboard overlapping a textfield.

i removed it and added a container with minHeight 340 in the scrollview, this way the virtual keyboard cannot overlap.
as there is no signal for the keyboard being shown this seems like the best workaround, and it takes care of the stuttering animation.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.