[Mobile] Update LobbyScreen

-switch places of variants and players combo boxes for landscape layout
This commit is contained in:
Anthony Calosa
2021-09-30 12:15:31 +08:00
parent 0ed61fcee7
commit 100eb19bd1

View File

@@ -252,14 +252,23 @@ public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
float x = PADDING; float x = PADDING;
float y = startY + PADDING; float y = startY + PADDING;
float fieldHeight = cbPlayerCount.getHeight(); float fieldHeight = cbPlayerCount.getHeight();
lblPlayers.setBounds(x, y, lblPlayers.getAutoSizeBounds().width + PADDING / 2, fieldHeight); if (Forge.isLandscapeMode()) {
x += lblPlayers.getWidth(); lblVariants.setBounds(x, y, lblVariants.getAutoSizeBounds().width + PADDING / 2, fieldHeight);
cbPlayerCount.setBounds(x, y, Utils.AVG_FINGER_WIDTH, fieldHeight); x += lblVariants.getWidth();
x += cbPlayerCount.getWidth() + PADDING; cbVariants.setBounds(x, y, width - (x + lblPlayers.getAutoSizeBounds().width + PADDING/2 + Utils.AVG_FINGER_WIDTH + PADDING), fieldHeight);
lblVariants.setBounds(x, y, lblVariants.getAutoSizeBounds().width + PADDING / 2, fieldHeight); x += cbVariants.getWidth();
x += lblVariants.getWidth(); lblPlayers.setBounds(x, y, lblPlayers.getAutoSizeBounds().width + PADDING / 2, fieldHeight);
cbVariants.setBounds(x, y, width - x - PADDING, fieldHeight); x += lblPlayers.getWidth();
cbPlayerCount.setBounds(x, y, Utils.AVG_FINGER_WIDTH, fieldHeight);
} else {
lblPlayers.setBounds(x, y, lblPlayers.getAutoSizeBounds().width + PADDING / 2, fieldHeight);
x += lblPlayers.getWidth();
cbPlayerCount.setBounds(x, y, Utils.AVG_FINGER_WIDTH, fieldHeight);
x += cbPlayerCount.getWidth() + PADDING;
lblVariants.setBounds(x, y, lblVariants.getAutoSizeBounds().width + PADDING / 2, fieldHeight);
x += lblVariants.getWidth();
cbVariants.setBounds(x, y, width - x - PADDING, fieldHeight);
}
y += cbPlayerCount.getHeight() + PADDING; y += cbPlayerCount.getHeight() + PADDING;
playersScroll.setBounds(0, y, width, height - y); playersScroll.setBounds(0, y, width, height - y);
} }