diff --git a/core/assets/common/screen/statistics/gfx/arrow_down.png b/core/assets/common/screen/statistics/gfx/arrow_down.png index 84d9898de3f0af7ecd1dc5ca5863f5c9422ac4c4..cee92d4075302f2e218f4aca37a5e095c41a4e71 100644 Binary files a/core/assets/common/screen/statistics/gfx/arrow_down.png and b/core/assets/common/screen/statistics/gfx/arrow_down.png differ diff --git a/core/assets/common/screen/statistics/gfx/arrow_down_pressed.png b/core/assets/common/screen/statistics/gfx/arrow_down_pressed.png index 3a7fe9eac49c3c2e17fa79735dd5d44c09d9541d..d92016be7c116dd6868e786f0ba7f32081658f89 100644 Binary files a/core/assets/common/screen/statistics/gfx/arrow_down_pressed.png and b/core/assets/common/screen/statistics/gfx/arrow_down_pressed.png differ diff --git a/core/assets/common/screen/statistics/gfx/arrow_up.png b/core/assets/common/screen/statistics/gfx/arrow_up.png index 5e6eb51a9aee3b2b61d12547ef0ce8415882359e..bac7a550172921e261ec34e24dd16665bd642207 100644 Binary files a/core/assets/common/screen/statistics/gfx/arrow_up.png and b/core/assets/common/screen/statistics/gfx/arrow_up.png differ diff --git a/core/assets/common/screen/statistics/gfx/arrow_up_pressed.png b/core/assets/common/screen/statistics/gfx/arrow_up_pressed.png index 64e4c307c1f90c25bdc81138bb587cea28dd5521..b37943fa5e96728fe3eaf054b6a7e7ab852446bd 100644 Binary files a/core/assets/common/screen/statistics/gfx/arrow_up_pressed.png and b/core/assets/common/screen/statistics/gfx/arrow_up_pressed.png differ diff --git a/core/assets/common/screen/statistics/gfx/bookmark1_pressed.png b/core/assets/common/screen/statistics/gfx/bookmark1_pressed.png index de155565c07d3dbc6f9e789ec55ceb604f4a4906..5f818c0176ba2ae72a784932e42dbaec855c20ef 100644 Binary files a/core/assets/common/screen/statistics/gfx/bookmark1_pressed.png and b/core/assets/common/screen/statistics/gfx/bookmark1_pressed.png differ diff --git a/core/assets/common/screen/statistics/gfx/bookmark2_pressed.png b/core/assets/common/screen/statistics/gfx/bookmark2_pressed.png index 1ebed0b50811df770d7c2fed7392fccc3ebc6d46..1b21555e1d7982a0abb6922299ad771debcfb64e 100644 Binary files a/core/assets/common/screen/statistics/gfx/bookmark2_pressed.png and b/core/assets/common/screen/statistics/gfx/bookmark2_pressed.png differ diff --git a/core/assets/common/screen/statistics/gfx/bookmark3_pressed.png b/core/assets/common/screen/statistics/gfx/bookmark3_pressed.png index 8932cd2126f41b3920cfe1678da003f389a34221..a86ba583838fa3e9e7ef8ab38cf0a078b21b1733 100644 Binary files a/core/assets/common/screen/statistics/gfx/bookmark3_pressed.png and b/core/assets/common/screen/statistics/gfx/bookmark3_pressed.png differ diff --git a/core/src/cz/nic/tablexia/screen/statistics/StatisticsScreen.java b/core/src/cz/nic/tablexia/screen/statistics/StatisticsScreen.java index 36c6cd55fb8c2e07ad9a761f4e83af55d1b10af4..f900114c3321ffc80db8b67c18489e9fc1a748c4 100644 --- a/core/src/cz/nic/tablexia/screen/statistics/StatisticsScreen.java +++ b/core/src/cz/nic/tablexia/screen/statistics/StatisticsScreen.java @@ -89,10 +89,9 @@ public class StatisticsScreen extends AbstractTablexiaScreen<Void> { private static final float UP_BUTTON_POSITION_Y_SCALE = 0.75f; private static final float UP_DOWN_BUTTON_POSITION_X_SCALE = 0.2f; private static final float DOWN_BUTTON_POSITION_Y_SCALE = 0.05f; - private static final float SELECTED_GAME_WIDTH = 0.66f; public static final String GFX_PATH = "gfx/"; - public static final String STATISTICS_SPEECH = MFX_PATH + "statistics.mp3"; + private static final String STATISTICS_SPEECH = MFX_PATH + "statistics.mp3"; private static final String[] BOOKMARKS_TEXTURES = {"1", "2", "3", "2", "1", "3", "1", "2"}; private static final String SELECTED_SWITCH_KEY = "selected_switch", SELECTED_GAME_KEY = "selected_game", DIFFICULTY_EASY_KEY = "diff_easy", DIFFICULTY_MEDIUM_KEY = "diff_medium", DIFFICULTY_HARD_KEY = "diff_hard"; private static final String ARROW_UP_TEXT = "arrow_up"; @@ -100,9 +99,11 @@ public class StatisticsScreen extends AbstractTablexiaScreen<Void> { private static final String PRESSED_TEXT = "_pressed"; private static final String BOOKMARK_TEXT = "bookmark"; - private static final int BOOKMARK_OPEN_TEXT_LEFT_OFFSET = 50; + private static final int BOOKMARK_OPEN_TEXT_LEFT_OFFSET = 30; private static final int BOOKMARK_OPEN_ALIGN = Align.left; - private static final int BOOKMARK_CLOSE_ALIGN = Align.right; + private static final int BOOKMARK_CLOSE_ALIGN = Align.left; + private static final int BOOKMARK_OPEN_WIDTH = 380; + private static final int BOOKMARK_CLOSE_WIDTH = 250; private static final GameDefinition DEFAULT_GAME = GameDefinition.ROBBERY; private static final int DIFFICULTY_BUTTON_SIZE = 70; @@ -251,6 +252,8 @@ public class StatisticsScreen extends AbstractTablexiaScreen<Void> { super.setChecked(); getLabel().setAlignment(BOOKMARK_OPEN_ALIGN); setTouchable(Touchable.disabled); + setWidth(BOOKMARK_OPEN_WIDTH); + prepareButtonPosition(this); } @Override @@ -258,13 +261,16 @@ public class StatisticsScreen extends AbstractTablexiaScreen<Void> { super.setUnchecked(); getLabel().setAlignment(BOOKMARK_CLOSE_ALIGN); setTouchable(Touchable.enabled); + setWidth(BOOKMARK_CLOSE_WIDTH); + prepareButtonPosition(this); } }; + button.adaptiveSize(false); button.setTouchable(Touchable.enabled); button.getLabel().setAlignment(Align.right); + button.getLabel().setWrap(false); button.fontType(BOOKMARK_FONT_TYPE); button.setUserObject(gameMenuDefinition); - button.setWidth(getScreenTextureRegion(GFX_PATH + BOOKMARK_TEXT + BOOKMARKS_TEXTURES[i]).getRegionWidth() * SELECTED_GAME_WIDTH); button.setY((GameMenuDefinition.values().length - i) * BOOKMARKS_PADDING * getViewportHeight()); button.setInputListener(new ClickListener() { @Override @@ -705,8 +711,7 @@ public class StatisticsScreen extends AbstractTablexiaScreen<Void> { downButton.setPosition(getViewportWidth() * UP_DOWN_BUTTON_POSITION_X_SCALE, getViewportHeight() * DOWN_BUTTON_POSITION_Y_SCALE); bookmarksGroup.setY(getViewportHeight() * BOOKMARKS_GROUP_POSITION_Y_SCALE); for(Actor button : bookmarksGroup.getChildren()) { - button.setPosition(getViewportWidth() * BOOKMARK_POSITION_X_SCALE - button.getWidth(), - (GameMenuDefinition.values().length - bookmarksGroup.getChildren().indexOf(button, true)) * BOOKMARKS_PADDING * getViewportHeight()); + prepareButtonPosition(button); } scrollPane.setSize(graphs.getWidth(), graphs.getHeight()); @@ -714,6 +719,11 @@ public class StatisticsScreen extends AbstractTablexiaScreen<Void> { if (graphPane != null) graphPaneHolder.setSize(graphPane.getWidth(), graphPane.getHeight()); } + private void prepareButtonPosition(Actor button) { + button.setPosition(getViewportWidth() * BOOKMARK_POSITION_X_SCALE - button.getWidth(), + (GameMenuDefinition.values().length - bookmarksGroup.getChildren().indexOf(button, true)) * BOOKMARKS_PADDING * getViewportHeight()); + } + private List<Game> getGames(GameDefinition definition) { return GameDAO.getGamesForUserAndDefinition(getSelectedUser().getId(), definition); }