From 100eb19bd1ad1c097357ef7c9d8f5ee70da95cc2 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Thu, 30 Sep 2021 12:15:31 +0800 Subject: [PATCH] [Mobile] Update LobbyScreen -switch places of variants and players combo boxes for landscape layout --- .../screens/constructed/LobbyScreen.java | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/forge-gui-mobile/src/forge/screens/constructed/LobbyScreen.java b/forge-gui-mobile/src/forge/screens/constructed/LobbyScreen.java index 5e4ae2c5aa4..82195fb2593 100644 --- a/forge-gui-mobile/src/forge/screens/constructed/LobbyScreen.java +++ b/forge-gui-mobile/src/forge/screens/constructed/LobbyScreen.java @@ -252,14 +252,23 @@ public abstract class LobbyScreen extends LaunchScreen implements ILobbyView { float x = PADDING; float y = startY + PADDING; float fieldHeight = cbPlayerCount.getHeight(); - 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); - + if (Forge.isLandscapeMode()) { + lblVariants.setBounds(x, y, lblVariants.getAutoSizeBounds().width + PADDING / 2, fieldHeight); + x += lblVariants.getWidth(); + cbVariants.setBounds(x, y, width - (x + lblPlayers.getAutoSizeBounds().width + PADDING/2 + Utils.AVG_FINGER_WIDTH + PADDING), fieldHeight); + x += cbVariants.getWidth(); + lblPlayers.setBounds(x, y, lblPlayers.getAutoSizeBounds().width + PADDING / 2, 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; playersScroll.setBounds(0, y, width, height - y); }