Whenever a new view is added or removed, everything is adjusted. I can see how in majority of use-cases this is a very good thing, but unfortunately for me, it's something I need to avoid. I'm assuming that onMeasure() is called whenever a view is removed or added, resulting in it changing the X and Y coordinates I gave it, however I want to "disable" this.
My app utilizes dynamically moving and resizing views, determined by the user at runtime, hence if whenever the user removes a view or adds a new one, it shifts everything around, it'd be extremely annoying. Also I'd think that (although not sure) that preventing this could only help performance right? Not measuring each view, in fact, I do not want it to measure it at all because, once again, the user decides the view size and location, not the linear layout.
I was thinking of creating my own ViewGroup, but I've never done this before. I know you can extend a pre-existing one, like LinearLayout or RelativeLayout, but I need help determining which one I should use, and whether or not I should just create a full on ViewGroup.
As I said, it doesn't need to measure the views at all, and in fact, if it were possible, a container that does nothing would be optimal, and I'd think would yield more performance. Can anyone help me with this problem?
Summary:
Need a way to either prevent a pre-existing ViewGroup, I.E FrameLayout, RelativeLayout and LinearLayout, that do not adjust the position nor size of the view, or create a new ViewGroup which doesn't do any measuring at all because the user defines the location and size at runtime and should not be altered by the container.
If this is a bad question or another question exists that answers this, please let me know.