};
NewNetworkViewMode currentViewMode;
TextLabel titleLabel;
- TextLabel ssidLabel;
TextField ssidTextField;
View ssidUnderline;
- TextLabel securityTypeLabel;
TextLabel selectedSecurityTypeLabel;
TapGestureDetector securityTypeDetector;
TextLabel usernameLabel;
TextField usernameTextField;
View usernameUnderline;
- TextLabel passwordLabel;
PasswordEntry passwordEntry;
View passwordUnderline;
Button revealButton;
static Color largeTextColor => new Color(0.0f, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f);
static Color smallTextColor => new Color(0.0f, 0xC / 255.0f, 0x2B / 255.0f, 1.0f);
static Size labelSize => new Size(600, 19);
- static Size textControlSize => new Size(583, 27);
- static Size passwordControlSize => new Size(583, 25);
+ static Size textControlSize => new Size(680, 27);
+ static Size passwordControlSize => new Size(583, 27);
int labelFontSize = 14;
int textFontSize = 22;
- int passwordFontSize = 20;
+ int passwordFontSize = 22;
public AddNewNetworkPupup()
{
return textField;
}
- View CreateUnderline(Position2D position = null)
+ View CreateUnderline(Position2D position = null, Size2D size = null)
{
position ??= new Position2D();
+ size ??= new Size2D(728, 1);
return new View()
{
Position = position,
- Size = new Size(600, 1),
+ Size = size,
BackgroundColor = new Color(0xC3 / 255.0f, 0xCA / 255.0f, 0xD2 / 255.0f, 1.0f)
};
}
FontFamily = "BreezeSans",
FontStyle = new PropertyMap().AddRegularFontStyle(),
TextColor = largeTextColor,
- TranslatablePlaceholderText = "WIFI_SECURITY_KEY",
+ TranslatablePlaceholderText = "WIFI_PASSWORD",
HorizontalAlignment = HorizontalAlignment.Begin,
VerticalAlignment = VerticalAlignment.Center,
Revealed = false
};
this.Add(titleLabel);
- ssidLabel = CreateTextLabel("WIFI_SSID", new Position2D(104, 80));
- this.Add(ssidLabel);
-
- ssidTextField = CreateTextField("WIFI_SSID", new Position2D(121, 97));
+ ssidTextField = CreateTextField("WIFI_SSID", new Position2D(40, 91));
this.Add(ssidTextField);
- ssidUnderline = CreateUnderline(new Position2D(104, 123));
+ ssidUnderline = CreateUnderline(new Position2D(40, 117));
this.Add(ssidUnderline);
- securityTypeLabel = CreateTextLabel("WIFI_SECURITY_TYPE", new Position2D(104, 144));
- this.Add(securityTypeLabel);\r
-
this.Add(CreateSecurityTypeButton());
cancelButton = new Button(ButtonStyles.Cancel)
{\r
var view = new View()\r
{\r
- Size = new Size(583, 30),\r
- Position2D = new Position2D(121, 161),\r
+ Size = new Size(728, 72),\r
+ Position2D = new Position2D(40, 148),\r
Layout = new AbsoluteLayout(),\r
};\r
selectedSecurityTypeLabel = new TextLabel()\r
{\r
Size = new Size(200, 28),\r
+ Position = new Position2D(0, 23),
PixelSize = 22,\r
TranslatableText = currentSecurityType.GetUIName(),\r
FontStyle = new PropertyMap().AddRegularFontStyle(),\r
view.Add(new View()\r
{\r
BackgroundImage = arrowImagePath,\r
- Position = new Position(568, 2),\r
+ Position = new Position(696, 31),\r
});\r
securityTypeDetector = new TapGestureDetector();\r
securityTypeDetector.Attach(view);\r
void ResetViewToNoPassword()
{
- Size = new Size(808, 322);
+ Size = new Size(808, 343);
Position = new Position2D(236, 118);
addButton.Position = new Position2D(488, ((int)Size.Height) - 96);
usernameUnderline = null;
}
- if (!(passwordLabel is null))
- {
- passwordLabel.Unparent();
- passwordLabel.Dispose();
- passwordLabel = null;
- }
-
if (!(passwordEntry is null))
{
passwordEntry.Unparent();
void ResetViewToPasswordOnly()
{
- Size = new Size2D(808, 382);
+ Size = new Size2D(808, 412);
Position = new Position2D(236, 59);
addButton.Position = new Position2D(488, ((int)Size.Height) - 96);
usernameUnderline = null;
}
- if (passwordLabel is null)
- {
- passwordLabel = CreateTextLabel("WIFI_SECURITY_KEY");
- this.Add(passwordLabel);
- }
-
if (passwordEntry is null)
{
passwordEntry = CreatePasswordEntry();
if (passwordUnderline is null)
{
- passwordUnderline = CreateUnderline();
+ passwordUnderline = CreateUnderline(null, new Size2D(680, 1));
this.Add(passwordUnderline);
}
this.Add(revealButton);
}
- passwordLabel.Position = new Position2D(104, 208);
- passwordEntry.Position = new Position2D(121, 225);
- passwordUnderline.Position = new Position2D(104, 251);
- revealButton.Position = new Position2D(704, 214);
+ passwordEntry.Position = new Position2D(40, 232);
+ passwordUnderline.Position = new Position2D(40, 258);
+ revealButton.Position = new Position2D(728, 232);
currentViewMode = NewNetworkViewMode.PasswordOnly;
}
this.Add(usernameUnderline);
}
- if (passwordLabel is null)
- {
- passwordLabel = CreateTextLabel("WIFI_SECURITY_KEY");
- this.Add(passwordLabel);
- }
-
if (passwordEntry is null)
{
passwordEntry = CreatePasswordEntry();
usernameLabel.Position2D = new Position2D(104, 208);
usernameTextField.Position2D = new Position2D(121, 225);
usernameUnderline.Position2D = new Position2D(104, 251);
- passwordLabel.Position2D = new Position2D(104, 272);
- passwordEntry.Position2D = new Position2D(121, 289);
- passwordUnderline.Position2D = new Position2D(104, 315);
- revealButton.Position = new Position2D(704, 278);
+ passwordEntry.Position2D = new Position2D(40, 232);
+ passwordUnderline.Position2D = new Position2D(40, 258);
+ revealButton.Position = new Position2D(728, 232);
currentViewMode = NewNetworkViewMode.UserPassword;
}
this.Add(new View() //underline
{
- Size = new Size(584, 1),
- Position = new Position(103, 160),
+ Size = new Size(672, 1),
+ Position = new Position(40, 117),
BackgroundColor = new Color(0xC3 / 255.0f, 0xCA / 255.0f, 0xD2 / 255.0f, 1.0f),
});
- passwordEntry = new PasswordEntry()
- {
- Size = new Size(584, 27),
- Position = new Position(112, 133),
- MaxLength = maxPasswordLength,
- PixelSize = 22,
- TextColor = new Color(0, 0x0C / 255.0f, 0x2B / 255.0f, 1.0f),
- FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddRegularFontStyle(),
- Revealed = false,
- };
- passwordEntry.TextChanged += (s, e) => UpdateOKButton();
-
- this.Add(passwordEntry);
-
var titleLabel = new TextLabel
{
- Size = new Size(808, 35),
- Position = new Position(0, 19),
- TranslatableText = "WIFI_ENTER_PASSWORD",
- PixelSize = 28,
+ Size = new Size(728, 33),
+ Position = new Position(40, 24),
+ //no translatableText because of dynamic content
+ Text = string.Format(Translations.WIFI_ENTER_PASSWORD_TO_JOIN, wifiAp.NetworkInformation.Essid),
+ PixelSize = 26,
TextColor = new Color(0, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
FontFamily = "BreezeSans",
- FontStyle = new PropertyMap().AddLightFontStyle(),
+ FontStyle = new PropertyMap().AddRegularFontStyle(),
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
};
this.Add(titleLabel);
- var subtitleLabel = new TextLabel
+ passwordEntry = new PasswordEntry()
{
- Size = new Size(808, 26),
- Position = new Position(0, 68),
- //no translatableText because of dynamic content
- Text = string.Format(Translations.WIFI_ENTER_PASSWORD_TO_JOIN, wifiAp.NetworkInformation.Essid),
- PixelSize = 20,
- TextColor = new Color(0, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
+ Size = new Size(624, 27),
+ Position = new Position(40, 91),
+ MaxLength = maxPasswordLength,
+ PixelSize = 22,
+ TextColor = new Color(0, 0x0C / 255.0f, 0x2B / 255.0f, 1.0f),
FontFamily = "BreezeSans",
FontStyle = new PropertyMap().AddRegularFontStyle(),
- HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center,
+ Revealed = false,
+ TranslatablePlaceholderText = "WIFI_PASSWORD",
};
- this.Add(subtitleLabel);
+ passwordEntry.TextChanged += (s, e) => UpdateOKButton();
+
+ this.Add(passwordEntry);
connectionFailure = new TextLabel
{
- Size = new Size(120, 16),
- Position = new Position(116, 166),
+ Size = new Size(624, 22),
+ Position = new Position(40, 117),
TranslatableText = "WIFI_INVALID_PASSWORD",
PixelSize = 12,
TextColor = new Color(0xAA / 255.0f, 0x18 / 255.0f, 0x18 / 255.0f, 1.0f),
revealButton = new Button(ButtonStyles.Reveal)
{
Size = new Size(48, 48),
- Position = new Position(696, 120),
+ Position = new Position(720, 79),
};
revealButton.ClickEvent += (s, e) => TogglePasswordVisibility();
this.Add(revealButton);
cancelButton = new Button(ButtonStyles.Cancel)
{
Size = new Size(240, 72),
- Position = new Position(80, 200)
+ Position = new Position(80, 175)
};
cancelButton.ClickEvent += (s, e) =>
{
okButton = new Button(ButtonStyles.OK)
{
Size = new Size(240, 72),
- Position = new Position(488, 200),
+ Position = new Position(488, 175),
IsEnabled = false
};
okButton.ClickEvent += async (s, e) =>