I'm modifying the height of a LinearLayout
of WRAP_CONTENT
for 0
(zero) and vice versa by listening for the event onClick
of a Button
.
I would like this change to occur gradually over a few milliseconds, such as 700ms
, for example. How do I do this using the least amount of code possible?
Code snippet:
LinearLayout ll = (LinearLayout) findViewById(R.id.teste);
ll.setOnClickListener(new View.onClickListener() {
@Override
public void onClick (View v){
ViewGroup.LayoutParams params = v.getLayoutParams();
params.height = 0;
v.setLayoutParams(params);
}
});
This changes the height to zero, but without transition.
EDIT : The effect looks like this