I am using a ViewFlipper where there are 3 states :
- IDLE (Where I handle permissions and meanwhile the view is empty)
- SEARCHING (There is a layout with a lottie animation)
- FAILURE (If search failed, I show a layout very similar to SEARCHING layout)
I don't really need IDLE state but I don't want to show anything to user until permissions are granted. and to accomplish what I want, I have put a "Space" object in the XML file which is literally an empty object.
So there is 1 "Space" object and 2 "Include" objects inside the ViewFlipper.
I wonder if it is better to use invisible/gone attribute with the first child object instead of using Space. SEARCHING and FAILURE contain an animation with multiple styles and Space is really a light weight because it is basically nothing.
TL;DR -> In terms of performance, is using an empty light weight view object (Space with 0 attributes) better than using invisible/gone with a layout that contains an animation and multiple styles ?