getLayoutParams()
returns ViewGroup.LayoutParams
which it has an instance variable width
that is declared as public, and in Java you can access a public instance variable and set a new value to it without a setter method.
For example:
public class Point
{
public int x;
public int y;
}
Point p = new Point();
p.x = 10;
p.y = p.x + 1;