There is a layout, it has a view.
visualizerLayout.setGravity(Gravity.CENTER_VERTICAL);
This layout is drawn on the whole screen, how to make it so that it is drawn only up to the size of the inscribed view.
And how to make the view inscribed in it centered on the center of the screen (directly or indirectly, it doesn't matter)
Generally speaking, for some reason, my layout occupies the entire screen, and view occupies the entire layout and thus also fills the entire screen, but I want the layout to be as large as the view inside it, and drawn in a specific place, the layout is generated by java code (not from xml).