tag:blogger.com,1999:blog-6843566830671277353.post238830106507325136..comments2023-12-11T22:56:18.291-08:00Comments on Codedependent: DevBytes: Layout TransitionsChet Haasehttp://www.blogger.com/profile/03250991041464602854noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-6843566830671277353.post-58945653159611112842014-01-13T07:25:05.080-08:002014-01-13T07:25:05.080-08:00Hi Chet,
I'm currently working on a screen wh...Hi Chet,<br /><br />I'm currently working on a screen which would do these kinds of animations frequently. Since I have to support even 2.2 I started doing it manually using OnPredrawListeners, but this ends up with large amount of lines. Do you think it is possible to backport the LayoutTransition class using the nineoldandroids library? <br /><br />ThanksAnonymoushttps://www.blogger.com/profile/11201379920584872021noreply@blogger.comtag:blogger.com,1999:blog-6843566830671277353.post-45793954605654902162013-10-28T15:59:54.421-07:002013-10-28T15:59:54.421-07:00Could you help me understand why the z-order of th...Could you help me understand why the z-order of the children seems become inverted on removal of an item? <br /><br />To clarify the question (using your sample code) assume that you have three elements (A, B & C) and that the the middle element, B, has been expanded. If you then remove the B the DISAPPEARING fade-out animation starts on B whilst the CHANGE_DISAPPEARING translation animation starts on C. The B is however drawn with a higher z-order than C causing C to appear to slide beneath the fading out B. This behaviour/ordering is irrespective of the actual view z-ordering. <br /><br />Any thoughts or comments would be appreciated.Deannoreply@blogger.comtag:blogger.com,1999:blog-6843566830671277353.post-35171259964051126382013-08-20T03:22:28.707-07:002013-08-20T03:22:28.707-07:00i want to reuse the view which is already created ...i want to reuse the view which is already created and run the LayoutTransition on it. And i am getting child already has a parent error.Can you please help me in thisArun Guptahttps://www.blogger.com/profile/07928074817983333387noreply@blogger.comtag:blogger.com,1999:blog-6843566830671277353.post-70851283931802508662013-04-20T18:43:42.573-07:002013-04-20T18:43:42.573-07:00why does LayoutTransition not work with ListView? ...why does LayoutTransition not work with ListView? Is there an easy way to animate ListView additions?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6843566830671277353.post-55310095962063512722013-03-23T08:55:27.456-07:002013-03-23T08:55:27.456-07:00@hazam: No, it doesn't run layout on every fra...@hazam: No, it doesn't run layout on every frame. In fact, that's generally a Bad Thing to do in an animation; layout can be very expensive, in terms of both performance and garbage creation, and it contributes to stuttery and generally bad animations.<br /><br />What LayoutTransition does instead is to figure out where things are before the change, where things are after the change, and to then run animations (fading as well as moving/resizing) on all affected views between those values. For the layout-related changes, it animates the left/top/right/bottom properties of the views (using those property setters added in 3.0, at the same time as LayoutTransition was added to the API). Check out the source for LayoutTransition if you want to know more details on that.<br /><br />And no, it's not related to LayoutAnimationController; that's a much older facility based on the pre-3.0 animations that simply staggers animations as objects are added/removed from a layout. Chet Haasehttps://www.blogger.com/profile/03250991041464602854noreply@blogger.comtag:blogger.com,1999:blog-6843566830671277353.post-19491824563600981222013-03-23T06:15:08.330-07:002013-03-23T06:15:08.330-07:00And how does LayoutTransition relate to LayoutAnim...And how does LayoutTransition relate to LayoutAnimationController? <br />Is the latter going to be deprecated or they serve different purposes?hazamhttps://www.blogger.com/profile/00140417692824590663noreply@blogger.comtag:blogger.com,1999:blog-6843566830671277353.post-22314140537150004052013-03-23T06:10:31.466-07:002013-03-23T06:10:31.466-07:00Hi Chet,
how does this work internally? Does it t...Hi Chet,<br /><br />how does this work internally? Does it trigger repeatedly onLayout()? I remember back in 2.x animating these stuff would require requestLayout() every frame.<br />Thankshazamhttps://www.blogger.com/profile/00140417692824590663noreply@blogger.com