I'm writing a turn based game for Android. The main game has 3 sections. An introduction screen showing which player is to play next, the actual game screen where the player plays for points, and a board screen showing the rankings of the players.
In my implementation of this, I use 3 fragments (one for each section) and navigate between them using fragment transactions (FragmentTransaction.replace) as required.
This approach works fine, however I'd like to now add an extra feature, in that for large screen devices, the introduction screen, and the board screen would be displayed simultaneously. I understand how to do this in the xml, so when we first navigate to the introduction screen, we have both fragments displayed.
The problem I have relates the fragment transactions. When performing the transaction to pass out of the board screen, I need to determine whether to transition to a two fragment layout, or a one fragment layout? What is the best way to do this? Do I have to programmatically get the screen size before determining what transactions to perform, or is there a neater (XML?) way of doing this?
Thanks,
Will