Skip to content
Snippets Groups Projects
Commit 040a6611 authored by Anton Danilov's avatar Anton Danilov Committed by Anton Danilov
Browse files

#181 Dialogs now hiding when screen size or graph type is changed

parent 5ad6f1b9
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,6 @@ import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.NinePatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Group;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
......@@ -102,6 +101,7 @@ public class StatisticsScreen extends AbstractTablexiaScreen<Void> {
private GraphPane graphPane;
private Map<GameDifficulty, TablexiaButton> difficultyButtons;
private BitmapFont defaultBoldFont, bookmarkBoldFont, difficultiesBoldFont;
private TablexiaComponentDialog dialog;
@Override
protected void screenPaused(Map<String, String> screenState) {
......@@ -453,11 +453,11 @@ public class StatisticsScreen extends AbstractTablexiaScreen<Void> {
components.add(new TextContentDialogComponent(score, DIALOG_BOLD_FONT, false));
components.add(new ResizableSpaceContentDialogComponent());
new TablexiaComponentDialog(
dialog = new TablexiaComponentDialog(
getStage(),
TablexiaComponentDialog.TablexiaDialogType.BUBBLE_SQUARE,
components.toArray(new TablexiaDialogComponentAdapter[]{})
).show(GRAPH_DIALOG_WIDTH, GRAPH_DIALOG_HEIGHT);
components.toArray(new TablexiaDialogComponentAdapter[]{}));
dialog.show(GRAPH_DIALOG_WIDTH, GRAPH_DIALOG_HEIGHT);
}
};
......@@ -534,6 +534,7 @@ public class StatisticsScreen extends AbstractTablexiaScreen<Void> {
private void datasetChanged() {
graphs.clear();
hideDialog();
if(selectedGameDefinition != null) {
graphPane = drawGraph(getGames(selectedGameDefinition));
......@@ -584,11 +585,16 @@ public class StatisticsScreen extends AbstractTablexiaScreen<Void> {
return GameDAO.getGamesForUserAndDefinition(getSelectedUser().getId(), definition);
}
private void hideDialog() {
if(dialog != null) dialog.hide();
}
@Override
public void screenResized(int width, int height) {
if(graphPane != null) graphPane.resetHeight();
ScaleUtil.setFullscreenBounds(content, getStage());
position();
hideDialog();
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment