Skip to content
Snippets Groups Projects
Commit 39f728db authored by Matyáš Latner's avatar Matyáš Latner
Browse files

Merge branch 'feature-profile' into 'devel'

Feature profile



See merge request !322
parents 8e122886 79ef177a
Branches
Tags
No related merge requests found
......@@ -11,4 +11,5 @@ validation_signature=Podepiš se pomocí pera
validation_age=Zadej svůj věk
validation_stamp=Orazítkuj dokument
validation_username_exists=Krycí jméno detektiva již existuje\! Zadejte jiné krycí jméno.
user_uuid_description=Číslo průkazu
\ No newline at end of file
user_uuid_description=Číslo průkazu
user_uuid_error=Pro získání čísla průkazu je nutné se připojit k internetu.
......@@ -11,4 +11,5 @@ validation_signature=Unterschreibe dies mit dem Stift
validation_age=Gib dein Alter ein
validation_stamp=Stemple das Dokument ab
validation_username_exists=Detective Decknamen existiert bereits\! Geben Sie einen anderen Decknamen.
user_uuid_description=Ausweisnummer
\ No newline at end of file
user_uuid_description=Ausweisnummer
user_uuid_error=Um Zugriff auf die Ausweisnummer zu haben, ist eine Internetverbindung erforderlich.
......@@ -11,4 +11,5 @@ validation_signature=Podpíš sa pomocou pera
validation_age=Zadaj svoj ​​vek
validation_stamp=Opečiatkuj dokument
validation_username_exists=Krycie meno detektíva už existuje\! Zadajte iné krycie meno.
user_uuid_description=Číslo preukazu
\ No newline at end of file
user_uuid_description=Číslo preukazu
user_uuid_error=Pre získanie čísla preukazu je potrebné pripojiť sa k internetu.
external @ d8cb4a89
Subproject commit eb3e01925a5a6d323d41f9271636ad5c24072e25
Subproject commit d8cb4a89e64ceec83718fc478f76a5eb31d8fb3e
......@@ -19,11 +19,13 @@ import cz.nic.tablexia.util.ui.button.CloseTablexiaButton;
import cz.nic.tablexia.util.ui.button.TablexiaButton;
public class ProfileScreen extends FormScreen {
private static final String USER_UUID_ERROR = "user_uuid_error";
private static final String USER_UUID_DESCRIPTION_TEXT = "user_uuid_description";
private static final String USER_UUID_DESCRIPTIOM_TEXT = "user_uuid_description";
private static final float BADGE_POSITON_Y_SCALE = 0.35f;
private static final float USER_UUID_DESCRIPTION_POSITION_Y_SCALE = 0.135f;
private static final float USER_UUID_POSITION_Y_SCALE = 0.1f;
private static final float USER_UUID_PADDING = 0.055f; //Percent from page width
private static final int CLOSE_BUTTON_PADDING = 20;
private TablexiaButton closeButton;
......@@ -59,11 +61,13 @@ public class ProfileScreen extends FormScreen {
closeButton = createCloseButton();
getStage().addActor(closeButton);
positionCloseButton();
if (getSelectedUser().getUuid() != null && !getSelectedUser().getUuid().isEmpty()) {
badge.setY(getViewportHeight() * BADGE_POSITON_Y_SCALE);
getStage().addActor(createUserUuidDescription());
badge.setY(getViewportHeight() * BADGE_POSITON_Y_SCALE);
getStage().addActor(createUserUuidDescription());
TablexiaLabel userUuidLabel = createUserUuidLabel();
if(userUuidLabel != null)
getStage().addActor(createUserUuidLabel());
}
}
@Override
......@@ -99,21 +103,33 @@ public class ProfileScreen extends FormScreen {
}
private TablexiaLabel createUserUuidDescription() {
TablexiaLabel label = new TablexiaLabel(getText(USER_UUID_DESCRIPTIOM_TEXT), new TablexiaLabel.TablexiaLabelStyle(ApplicationFontManager.FontType_NEW.BOLD_16, Color.BLACK));
label.setPosition(
book.getX(),
TablexiaLabel resultLabel;
String resultLabelText = getSelectedUser().getUuid() == null || getSelectedUser().getUuid().isEmpty() ? getText(USER_UUID_ERROR) : getText(USER_UUID_DESCRIPTION_TEXT);
resultLabel = new TablexiaLabel(
resultLabelText,
new TablexiaLabel.TablexiaLabelStyle(ApplicationFontManager.FontType_NEW.BOLD_16, Color.BLACK)
);
resultLabel.setPosition(
book.getX() + book.getWidth() / 2 * USER_UUID_PADDING,
getStage().getWidth() * USER_UUID_DESCRIPTION_POSITION_Y_SCALE
);
label.setWidth(book.getWidth() / 2f);
label.setAlignment(Align.center);
return label;
resultLabel.setWidth(book.getWidth() / 2f - 2 * (book.getWidth() / 2) * USER_UUID_PADDING);
resultLabel.setAlignment(Align.center);
resultLabel.setWrap(true);
return resultLabel;
}
private TablexiaLabel createUserUuidLabel() {
if(getSelectedUser().getUuid() == null || getSelectedUser().getUuid().isEmpty())
return null;
TablexiaLabel label = new TablexiaLabel(getSelectedUser().getUuid(), new TablexiaLabel.TablexiaLabelStyle(ApplicationFontManager.FontType_NEW.BOLD_16, Color.BLACK));
label.setPosition(
book.getX(),
getStage().getWidth() * USER_UUID_POSITION_Y_SCALE
getStage().getWidth() * USER_UUID_POSITION_Y_SCALE
);
label.setWidth(book.getWidth() / 2f);
label.setAlignment(Align.center);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment