Skip to content Skip to sidebar Skip to footer

How Do I Set My View Layoutparams Width Smaller?

Hi I am borrowing Seth's method found here to animate my viewGroups. It works great but in the wrong direction - This is my first time using/extending the Animation class and I can

Solution 1:

I think you've mixed up the usage of that third parameter (the boolean). You call it "opened", and pass it true, because you want to shrink it. However, this is the opposite of the usage in my original code! In my code, the boolean was true if the view was closed but I wanted it to grow.

"and d = a boolean which specifies the direction (true = expanding, false = collapsing)."

If you swap the condition in the animation class to if(!opened){}, it should work. Or pass it false instead of true. Or pass it true, but change the variable to "closed" instead of "opened".

-Seth

Post a Comment for "How Do I Set My View Layoutparams Width Smaller?"