Change View visibility programmatically or through XML?
According to View source code setting visibility through xml (line 3450) is cheaper than through setVisibility method (line 5511).

So it is better to change visibility programmatically fewer times.