I have a main layout in which I'd like to sequentially display / hide various custom layouts according to timers and user input.
In my example, I'd like the following timeline:
show an initial layout, created by the class MainStart. The user will click on the button when they're ready to start.
after the user clicks, we'll run a countdown timer, displaying the countdown to the screen. This is done by MainCountdown.
once the countdown is complete, MainLast is displayed. It has a button allowing the user to click "Again?" when they want to start over.
if the user clicks "Again?" then go to step 1.
According to this question, I may have to use removeView() and addView() to achieve what I want.
I pushed to GitHub a trimmed down version of what I want to do: Hide and Show Layouts so you can see everything, but the problem seems to boil down to myView
still being visible after this:
myView = inflate(mContext, R.layout.main_start, _view_group);
myView.setVisibility(View.GONE);
Can I make a small change to my code/layouts to make the views hide/appear the way I want?
Am I completely Doing It Wrong?