Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change animateLayoutChanges property using java code

I'm working on a android application which is use layout change animations. what i want to know is, is there any one know how to change the "andorid:animateLayoutChanges" proberty using java code.

my current value is

android:animateLayoutChanges="false"

I want to change it to "true" in activity onResume() method.

like image 749
Dehan Wjiesekara Avatar asked Dec 23 '13 10:12

Dehan Wjiesekara


1 Answers

Use setLayoutTransition() method in your code:

LayoutTransition layoutTransition = new LayoutTransition(); //or, if previously enabled in xml, use getLayoutTransition()  //enable animation setLayoutTransition(layoutTransition);  //disable animation setLayoutTransition(null); 

source: Animating Layout Changes

like image 78
Andrii Chernenko Avatar answered Sep 30 '22 06:09

Andrii Chernenko