Skip to content
Snippets Groups Projects
Commit 4d24dda9 authored by Vitaliy Vashchenko's avatar Vitaliy Vashchenko
Browse files

#59 Changes in content padding.

parent 3c6b42bb
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,9 @@ public class AboutScreen extends AbstractTablexiaScreen<Void> {
private static final int DEFAULT_FONT_PAD = 5;
private static final int BIG_FONT_PAD = 10;
private static final String SCREEN_STATE_SCROLL_POSITION_Y = "scrollPositionY";
private final LabelStyle LABEL_STYLE_18 = new LabelStyle(getFont(ApplicationFontManager.FontType.ROBOTO_REGULAR_18), DEFAULT_FONT_COLOR);
private final LabelStyle BOLD_LABEL_STYLE_18 = new LabelStyle(getFont(ApplicationFontManager.FontType.ROBOTO_BOLD_18), DEFAULT_FONT_COLOR);
private final LabelStyle BOLD_LABEL_STYLE_20 = new LabelStyle(getFont(ApplicationFontManager.FontType.ROBOTO_BOLD_20), DEFAULT_FONT_COLOR);
......@@ -65,6 +68,11 @@ public class AboutScreen extends AbstractTablexiaScreen<Void> {
return new ExtendViewport(TablexiaSettings.getWorldSize(), TablexiaSettings.getMinWorldHeight());
}
@Override
protected void screenPaused(Map<String, String> screenState) {
screenState.put(SCREEN_STATE_SCROLL_POSITION_Y, String.valueOf(contentScrollPane.getScrollPercentY()));
}
@Override
protected void screenLoaded(Map<String, String> screenState) {
TextureRegionDrawable backgroundTexture = new TextureRegionDrawable(getColorTextureRegion(DEFAULT_BACKGROUND_COLOR));
......@@ -74,6 +82,12 @@ public class AboutScreen extends AbstractTablexiaScreen<Void> {
backgroundTable.setFillParent(true);
prepareScreenLayout();
if (screenState.containsKey(SCREEN_STATE_SCROLL_POSITION_Y)) {
contentScrollPane.layout();
contentScrollPane.setScrollPercentY(Float.valueOf(screenState.get(SCREEN_STATE_SCROLL_POSITION_Y)));
contentScrollPane.updateVisualScroll();
}
}
......@@ -210,7 +224,6 @@ public class AboutScreen extends AbstractTablexiaScreen<Void> {
}
/**
*
* @param textID
* @param style
* @param bigFont
......
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