Remember when we used tabs, then pressing on one tab would turn that tab ON and all other tabs OFF.
Now, imagine 4 buttons in the middle of an Activity
which represent tabs. Clicking on each buttons will turn that button to ON state, and all others to OFF state, and will accordingly load a fragment below these 4 buttons.
Right now, I have coded these buttons' states via foreach
loop where I set the button states.
Is there a better way to do it? Something like RadioGroup
and RadioButton
where setting states is done automatically.