view.HorizontalAlignment = Style.CenterText?.HorizontalAlignment ?? HorizontalAlignment.Center;\r
view.VerticalAlignment = Style.CenterText?.VerticalAlignment ?? VerticalAlignment.Center;\r
view.Opacity = Style.CenterText?.Opacity?.All ?? 1.0f;\r
- view.FontStyle = new PropertyMap().AddRegularFontStyle();// SetFontStyle(Tizen.NUI.Text.FontStyle.);\r
+ view.FontStyle = new PropertyMap().AddRegularFontStyle();\r
view.FontSizeScale = FontSizeScale.UseSystemSetting;\r
\r
- Tizen.Log.Debug("oobe", $"Carousel item: Size:{view.Size2D.Width} {view.Size2D.Height}, PizelSize: {view.PixelSize}, Margin top: {view.Margin.Top} Margin bottom: {view.Margin.Bottom}");\r
// TODO other properties?\r
return view;\r
}\r
{
CenterText = new TextLabelStyle
{
- Size2D = SpUtils.ToPixels(new Size2D(-1, 97)),
+ Size2D = SpUtils.ToPixels(new Size2D(-1, 98)),
PixelSize = SpUtils.ToPixels(32.0f),
HorizontalAlignment = HorizontalAlignment.Center,
TextColor = new Color(0, 20.0f / 255.0f, 71.0f / 255.0f, 1.0f),
// limitations under the License.
using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.System;
namespace Oobe.Common.Utils
{
{
get => Window.Instance.Size.Height > Window.Instance.Size.Width;
}
+
+ public static float GetFootnoteFontSizeScaleMaxLarge()
+ {
+ switch (SystemSettings.FontSize)
+ {
+ case SystemSettingsFontSize.Giant:
+ case SystemSettingsFontSize.Huge:
+ return TextUtils.GetFontSizeScale(SystemSettingsFontSize.Large);
+ default:
+ return TextUtils.GetFontSizeScale(SystemSettings.FontSize);
+ }
+ }
+
+ public static float GetFootnoteFontSizeScaleMaxHuge()
+ {
+ switch (SystemSettings.FontSize)
+ {
+ case SystemSettingsFontSize.Giant:
+ return TextUtils.GetFontSizeScale(SystemSettingsFontSize.Huge);
+ default:
+ return TextUtils.GetFontSizeScale(SystemSettings.FontSize);
+ }
+ }
}
}
\ No newline at end of file
TextLabel guide = new TextLabel(TextLabelStyles.GuideTextLabelStyle);
guide.TranslatableText = "YOU_MUST_SCROLL_DOWN_AND_READ_THE_WHOLE_TEXT_ABOVE";
- guide.FontSizeScale = GetFootnoteFontSizeScale();
+ guide.FontSizeScale = ScreenSizeUtils.GetFootnoteFontSizeScaleMaxLarge();
agreeCheckBox = new CheckBox(Oobe.Terms.Styles.ButtonStyles.IHaveReadAndAgreeSwitchStyle);
agreeCheckBox.Size2D = SpUtils.ToPixels(new Size2D((int)(TextUtils.GetFontSizeScale(SystemSettings.FontSize) * 24), (int)(TextUtils.GetFontSizeScale(SystemSettings.FontSize) * 24)));
agreeLabel = new TextLabel(TextLabelStyles.IHaveReadAndAgreeTextStyleDisabled);
agreeLabel.State = States.Disabled;
agreeLabel.TranslatableText = "I_HAVE_READ_AND_AGREE_TO_TERMS_AND_CONDITIONS";
- agreeLabel.FontSizeScale = GetFootnoteFontSizeScale();
+ agreeLabel.FontSizeScale = ScreenSizeUtils.GetFootnoteFontSizeScaleMaxLarge();
var footnote = new View
{
timer.Start();
}
- private static float GetFootnoteFontSizeScale()
- {
- switch (SystemSettings.FontSize)
- {
- case SystemSettingsFontSize.Giant:
- case SystemSettingsFontSize.Huge:
- return TextUtils.GetFontSizeScale(SystemSettingsFontSize.Large);
- default:
- return FontSizeScale.UseSystemSetting;
- }
- }
-
private bool NextEnabled
{
get
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
using System.Threading.Tasks;
using Oobe.Common.Styles;
using Oobe.Common.Utils;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
-
+using Tizen.System;\r
+\r
namespace Oobe.Wifi.Controls.Wifi
{
public class AddNewNetworkPupup : View
private int labelFontSize = SpUtils.ToPixels(14);
private int textFontSize = SpUtils.ToPixels(22);
- private int passwordFontSize = SpUtils.ToPixels(22);
+ private int passwordFontSize = SpUtils.ToPixels(22);\r
public AddNewNetworkPupup()
{
- Tizen.Log.Debug("oobe", "Started creating Add New Network Popup");
InitializeStaticElements();
-
ResetViewTo(WifiUISecurityType.None);
- Tizen.Log.Debug("oobe", "Finished creating Add New Network Popup");
UpdateAddButton();
+ Relayout += ChangeSecurityTypePopup_Relayout;
}\r
\r
public event Action OnDismiss;
private static Size LabelSize => SpUtils.ToPixels(new Size(600, 19));
- private static Size TextControlSize => SpUtils.ToPixels(new Size(680, 27));
+ private static Size TextControlSize => SpUtils.ToPixels(new Size(1028, userScale * 27));
- private static Size PasswordControlSize => SpUtils.ToPixels(new Size(583, 27));
+ private static Size PasswordControlSize => SpUtils.ToPixels(new Size(1104, 27));
+
+ private static float userScale = TextUtils.GetFontSizeScale(SystemSettings.FontSize);
private TextLabel CreateTextLabel(string translatableText, Position2D position = null)
{
var textField = new TextField
{
Position = SpUtils.ToPixels(position),
- Size = TextControlSize,
+ SizeWidth = SpUtils.ToPixels(ScreenSizeUtils.IsPortrait ? 860 : 1028),
PixelSize = textFontSize,
FontFamily = "BreezeSans",
FontStyle = new PropertyMap().AddRegularFontStyle(),
TextColor = LargeTextColor,
TranslatablePlaceholderText = placeholderTranslatableText,
HorizontalAlignment = HorizontalAlignment.Begin,
- VerticalAlignment = VerticalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Bottom,
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+ FontSizeScale = FontSizeScale.UseSystemSetting,
};
return textField;
}
private View CreateUnderline(Position2D position = null, Size2D size = null)
{
position ??= new Position2D();
- size ??= new Size2D(728, 1);
+ size ??= new Size2D(ScreenSizeUtils.IsPortrait ? 860 : 1028, 1);
return new View()
{
Position = SpUtils.ToPixels(position),
var passwordEntry = new PasswordEntry
{
Position = SpUtils.ToPixels(position),
- Size = PasswordControlSize,
+ Size = SpUtils.ToPixels(new Size(ScreenSizeUtils.IsPortrait ? 860 : 1028, 27 * userScale)),
PixelSize = passwordFontSize,
FontFamily = "BreezeSans",
FontStyle = new PropertyMap().AddRegularFontStyle(),
TextColor = LargeTextColor,
TranslatablePlaceholderText = "WIFI_PASSWORD",
HorizontalAlignment = HorizontalAlignment.Begin,
- VerticalAlignment = VerticalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Bottom,
Revealed = false,
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+ FontSizeScale = FontSizeScale.UseSystemSetting,
};
return passwordEntry;
}
private Button CreateRevealButton(Position2D position = null)
{
position ??= new Position2D();
+ var userScale = ScreenSizeUtils.GetFootnoteFontSizeScaleMaxLarge();
var button = new Button(ButtonStyles.Reveal)
{
- Size = SpUtils.ToPixels(new Size(32, 32)),
+ Size = SpUtils.ToPixels(new Size(userScale * 48, userScale * 48)),
Position = SpUtils.ToPixels(position),
IsSelectable = true,
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.BottomRight,
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
};
button.Clicked += (s, e) =>
{
this.BackgroundImage = backgroundImagePath;
titleLabel = new TextLabel
{
- Position = SpUtils.ToPixels(new Position2D(104, 24)),
- Size = SpUtils.ToPixels(new Size(600, 34)),
- PixelSize = SpUtils.ToPixels(26),
+ PositionY = SpUtils.ToPixels(61),
+ PixelSize = SpUtils.ToPixels(40),
TranslatableText = "WIFI_ADD_NETWORK",
FontFamily = "BreezeSans",
FontStyle = new PropertyMap().AddLightFontStyle(),
TextColor = LargeTextColor,
HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Top,
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.Center,
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopCenter,
+ FontSizeScale = FontSizeScale.UseSystemSetting,
};
this.Add(titleLabel);
- ssidTextField = CreateTextField("WIFI_SSID", new Position2D(40, 91));
+ ssidTextField = CreateTextField("WIFI_SSID", new Position2D(78, 200));
this.Add(ssidTextField);\r
ssidTextField.TextChanged += (s, e) => UpdateAddButton();\r
- ssidUnderline = CreateUnderline(new Position2D(40, 117));
+ ssidUnderline = CreateUnderline(new Position2D(78, 197));
this.Add(ssidUnderline);
this.Add(CreateSecurityTypeButton());
cancelButton = new Button(ButtonStyles.Cancel)
{
- Size = SpUtils.ToPixels(new Size(240, 72)),
+ Size = SpUtils.ToPixels(new Size(336, 96)),
};
+ cancelButton.TextLabel.FontSizeScale = FontSizeScale.UseSystemSetting;
cancelButton.Clicked += (s, e) => OnDismiss?.Invoke();
this.Add(cancelButton);
addButton = new Button(ButtonStyles.OK)
{
- Size = SpUtils.ToPixels(new Size(240, 72)),
+ Size = SpUtils.ToPixels(new Size(336, 96)),
TranslatableText = "WIFI_ADD",
};
+ addButton.TextLabel.FontSizeScale = FontSizeScale.UseSystemSetting;
addButton.Clicked += async (s, e) =>
{
Tizen.Log.Debug("oobe", $"Scanning for SSID = {ssidTextField.Text}");
failureLabel = new TextLabel
{
Size = new Size2D(),
+ Position = SpUtils.ToPixels(new Position(78, 200)),
PixelSize = SpUtils.ToPixels(12),
FontFamily = "BreezeSans",
FontStyle = new PropertyMap().AddRegularFontStyle(),
TextColor = new Color(0xAA / 255.0f, 0x18 / 255.0f, 0x18 / 255.0f, 1.0f),
HorizontalAlignment = HorizontalAlignment.Begin,
VerticalAlignment = VerticalAlignment.Center,
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+ FontSizeScale = FontSizeScale.UseSystemSetting,\r
};
failureLabel.Hide();
this.Add(failureLabel);
{\r
var view = new View()\r
{\r
- Size = SpUtils.ToPixels(new Size(728, 72)),\r
- Position2D = SpUtils.ToPixels(new Position2D(40, 148)),\r
+ SizeWidth = SpUtils.ToPixels(ScreenSizeUtils.IsPortrait ? 860 : 1028),\r
+ Position2D = SpUtils.ToPixels(new Position2D(78, 232)),\r
Layout = new AbsoluteLayout(),\r
};\r
selectedSecurityTypeLabel = new TextLabel()\r
{\r
- Size = SpUtils.ToPixels(new Size(200, 28)),\r
- Position = SpUtils.ToPixels(new Position2D(0, 23)),
PixelSize = SpUtils.ToPixels(22),\r
TranslatableText = currentSecurityType.GetUIName(),\r
FontStyle = new PropertyMap().AddRegularFontStyle(),\r
TextColor = LargeTextColor,\r
HorizontalAlignment = HorizontalAlignment.Begin,
VerticalAlignment = VerticalAlignment.Center,\r
+ FontSizeScale = FontSizeScale.UseSystemSetting,\r
};\r
view.Add(selectedSecurityTypeLabel);\r
view.Add(new View()\r
{\r
BackgroundImage = arrowImagePath,\r
- Position = SpUtils.ToPixels(new Position(696, 31)),\r
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.CenterRight,
+ ParentOrigin = Tizen.NUI.ParentOrigin.CenterRight,
});\r
securityTypeDetector = new TapGestureDetector();\r
securityTypeDetector.Attach(view);\r
private void OpenSecurityTypePopup()
{
var view = new ChangeSecurityTypePopup(currentSecurityType);
- var popup = new Oobe.Common.Utils.Popup(view, backgroundOpacity: 0f, centered: true);
+ var popup = new Oobe.Common.Utils.Popup(view, backgroundOpacity: 0f, centered: true);\r
+ view.PositionY = SpUtils.ToPixels(ScreenSizeUtils.IsPortrait ? -28 : 0);
view.OnDismiss += () =>
{
ResetViewTo(view.WifiUISecurityType);
private void ResetViewToNoPassword()
{
- Size = new Size(808, 343);
+ Size = SpUtils.ToPixels(new Size2D(ScreenSizeUtils.IsPortrait ? 1016 : 1184, ScreenSizeUtils.IsPortrait ? 459 : 456));
- addButton.Position = SpUtils.ToPixels(new Position2D(488, 343 - 96));
- cancelButton.Position = SpUtils.ToPixels(new Position2D(80, 343 - 96));
+ addButton.Position = SpUtils.ToPixels(new Position2D(ScreenSizeUtils.IsPortrait ? 600 : 768, ScreenSizeUtils.IsPortrait ? 319 : 316));
+ cancelButton.Position = SpUtils.ToPixels(new Position2D(80, ScreenSizeUtils.IsPortrait ? 319 : 316));
if (!(usernameLabel is null))
{
private void ResetViewToPasswordOnly()
{
- Size = SpUtils.ToPixels(new Size2D(808, 412));
+ Size = SpUtils.ToPixels(new Size2D(ScreenSizeUtils.IsPortrait ? 1016 : 1184, 547));
- addButton.Position = SpUtils.ToPixels(new Position2D(488, 412 - 96));
- cancelButton.Position = SpUtils.ToPixels(new Position2D(80, 412 - 96));
+ addButton.Position = SpUtils.ToPixels(new Position2D(ScreenSizeUtils.IsPortrait ? 600 : 768, 407));
+ cancelButton.Position = SpUtils.ToPixels(new Position2D(80, 407));
if (!(usernameLabel is null))
{
usernameUnderline = null;
}
- if (passwordEntry is null)
- {
- passwordEntry = CreatePasswordEntry();
- this.Add(passwordEntry);
- }
-
- if (passwordUnderline is null)
- {
- passwordUnderline = CreateUnderline(null, new Size2D(680, 1));
- this.Add(passwordUnderline);
- }
-
- if (revealButton is null)
- {
- revealButton = CreateRevealButton();
- this.Add(revealButton);
- }
-
- passwordEntry.Position = SpUtils.ToPixels(new Position2D(40, 232));
- passwordUnderline.Position = SpUtils.ToPixels(new Position2D(40, 258));
- revealButton.Position = SpUtils.ToPixels(new Position2D(728, 232));
-
- currentViewMode = NewNetworkViewMode.PasswordOnly;
- }
-
- private void ResetViewToUserPassword()
- {
- Size = SpUtils.ToPixels(new Size2D(808, 440));
-
- addButton.Position = SpUtils.ToPixels(new Position2D(488, 440 - 96));
- cancelButton.Position = SpUtils.ToPixels(new Position2D(80, 440 - 96));
-
- if (usernameLabel is null)
- {
- usernameLabel = CreateTextLabel("WIFI_USERNAME");
- this.Add(usernameLabel);
- }
-
- if (usernameTextField is null)
+ if (!(revealButton is null))
{
- usernameTextField = CreateTextField("WIFI_USERNAME");
- this.Add(usernameTextField);
+ revealButton.Unparent();
+ revealButton.Dispose();
+ revealButton = null;
}
- if (usernameUnderline is null)
+ if (!(passwordEntry is null))
{
- usernameUnderline = CreateUnderline();
- this.Add(usernameUnderline);
+ passwordEntry.Unparent();
+ passwordEntry.Dispose();
+ passwordEntry = null;
}
if (passwordEntry is null)
{
- passwordEntry = CreatePasswordEntry();
+ passwordEntry = CreatePasswordEntry(new Position2D(78, 366));
this.Add(passwordEntry);
}
if (passwordUnderline is null)
{
- passwordUnderline = CreateUnderline();
+ passwordUnderline = CreateUnderline(new Position2D(78, 363));
this.Add(passwordUnderline);
}
if (revealButton is null)
{
- revealButton = CreateRevealButton();
+ revealButton = CreateRevealButton(new Position2D(ScreenSizeUtils.IsPortrait ? 936 : 1104, 375));
this.Add(revealButton);
}
- usernameLabel.Position2D = SpUtils.ToPixels(new Position2D(104, 208));
- usernameTextField.Position2D = SpUtils.ToPixels(new Position2D(121, 225));
- usernameUnderline.Position2D = SpUtils.ToPixels(new Position2D(104, 251));
- passwordEntry.Position2D = SpUtils.ToPixels(new Position2D(40, 232));
- passwordUnderline.Position2D = SpUtils.ToPixels(new Position2D(40, 258));
- revealButton.Position = SpUtils.ToPixels(new Position2D(728, 232));
-
- currentViewMode = NewNetworkViewMode.UserPassword;
+ currentViewMode = NewNetworkViewMode.PasswordOnly;
}
private void ResetViewTo(WifiUISecurityType securityType)
{
failureLabel.Show();
failureLabel.TranslatableText = "WIFI_SSID_FAILURE";
- failureLabel.Position2D = ssidTextField.Position2D + new Position2D(0, (int)ssidTextField.Size.Height);
}
private void ShowFailurePasswordLabel()
{\r
addButton.IsEnabled = ssidTextField.Text.Length > 0;\r
}\r
+ }\r
+\r
+ private void ChangeSecurityTypePopup_Relayout(object sender, EventArgs e)
+ {
+ Relayout -= ChangeSecurityTypePopup_Relayout;
+ addButton.IsEnabled = !addButton.IsEnabled;
+ addButton.IsEnabled = !addButton.IsEnabled;
}
+
}
}
using Tizen.Network.WiFi;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
+using Tizen.System;
namespace Oobe.Wifi.Controls.Wifi
{
{
if (range == null)
{
+ var userScale1 = ScreenSizeUtils.GetFootnoteFontSizeScaleMaxLarge();
range = new View()
{
- Position = SpUtils.ToPixels(new Position(39, 21)),
+ Position = SpUtils.ToPixels(new Position(48, 21)),
+ Size = SpUtils.ToPixels(new Size(userScale1 * 32, userScale1 * 24)),
BackgroundImage = GetRangeImage(wifiAp),
};
this.Add(range);
+ var userScale2 = TextUtils.GetFontSizeScale(SystemSettings.FontSize);
+ float positionX = 110 * Math.Max(1.0f, userScale1);
+ float positionY = (float)((-11.3 * userScale2) + 28.3);
this.Add(new TextLabel(wifiAp.NetworkInformation.Essid)
{
- Position = SpUtils.ToPixels(new Position(78, 17)),
+ Position = SpUtils.ToPixels(new Position(positionX, positionY)),
PixelSize = SpUtils.ToPixels(20f),
TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
FontFamily = "BreezeSans",
FontStyle = new PropertyMap().AddLightFontStyle(),
+ FontSizeScale = FontSizeScale.UseSystemSetting,
});
detail = new TextLabel(GetDetailInfo(wifiAp))
{
WidthSpecification = LayoutParamPolicies.WrapContent,
- Position = SpUtils.ToPixels(new Position(79, 45)),
+ Position = SpUtils.ToPixels(new Position(positionX, 45)),
PixelSize = SpUtils.ToPixels(14f),
TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
FontFamily = "BreezeSans",
FontStyle = new PropertyMap().AddRegularFontStyle(),
+ FontSizeScale = FontSizeScale.UseSystemSetting,
};
this.Add(detail);
using System.Collections.Generic;
using System.Linq;
using System.Text;
-using System.Threading.Tasks;
+using Oobe.Common.Utils;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
public static ButtonStyle AddNetwork { get => GetAddNetworkButtonStyle(); }
+ private static float userScale = ScreenSizeUtils.GetFootnoteFontSizeScaleMaxLarge();
+
private static ButtonStyle GetCancelButtonStyle() => new ButtonStyle
{
BackgroundImage = new Selector<string>
Pressed = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_scan_pressed.png",
Disabled = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_scan_disabled.png",
},
- Size2D = SpUtils.ToPixels(new Size2D(72, 32)),
+ Size2D = SpUtils.ToPixels(new Size2D((int)(userScale * 72), (int)(userScale * 32))),
};
private static ButtonStyle GetTurnOnOffButtonStyle() => new ButtonStyle
Selected = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifion.png",
DisabledSelected = NUIApplication.Current.DirectoryInfo.Resource + "12_icon_wifion_disabled.png",
},
- Size2D = SpUtils.ToPixels(new Size2D(72, 32)),
+ Size2D = SpUtils.ToPixels(new Size2D((int)(userScale * 72), (int)(userScale * 32))),
};
private static ButtonStyle GetAddNetworkButtonStyle() => new ButtonStyle
private ListView listView;
private ObservableCollection<View> choiceViews = new ObservableCollection<View>();
private RadioButtonGroup radioButtonGroup = new RadioButtonGroup();
+ private Button addButton;
public ChangeSecurityTypePopup(WifiUISecurityType wifUISecurityType)
{
this.originalWifUISecurityType = wifUISecurityType;
this.WifiUISecurityType = wifUISecurityType;
- this.Size = SpUtils.ToPixels(new Size(808, 440));
+ this.Size = SpUtils.ToPixels(new Size(ScreenSizeUtils.IsPortrait ? 1016 : 1184, 632));
this.BackgroundImage = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "08_popup_body.png");
{
var titleLabel = new TextLabel()
{
- Position = SpUtils.ToPixels(new Position2D(80, 24)),
- Size = SpUtils.ToPixels(new Size(648, 34)),
- PixelSize = SpUtils.ToPixels(26),
+ PositionY = SpUtils.ToPixels(64),
+ Size = SpUtils.ToPixels(new Size(1024, 130)),
+ PixelSize = SpUtils.ToPixels(40),
TranslatableText = "WIFI_CHOOSE_SECURITY_TYPE",
FontFamily = "BreezeSans",
FontStyle = new PropertyMap().AddLightFontStyle(),
TextColor = new Color(0.0f, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.Center,
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopCenter,
+ FontSizeScale = FontSizeScale.UseSystemSetting,
};
this.Add(titleLabel);
var cancelButton = new Button(ButtonStyles.Cancel)
{
- Position = SpUtils.ToPixels(new Position(80, 344)),
- Size = SpUtils.ToPixels(new Size(240, 72)),
+ Position = SpUtils.ToPixels(new Position(80, 492)),
+ Size = SpUtils.ToPixels(new Size(336, 96)),
};
+ cancelButton.TextLabel.FontSizeScale = FontSizeScale.UseSystemSetting;
cancelButton.Clicked += (s, e) =>
{
WifiUISecurityType = originalWifUISecurityType;
};
this.Add(cancelButton);
- var addButton = new Button(ButtonStyles.OK)
+ addButton = new Button(ButtonStyles.OK)
{
- Position = SpUtils.ToPixels(new Position(488, 344)),
- Size = SpUtils.ToPixels(new Size(240, 72)),
+ Position = SpUtils.ToPixels(new Position(ScreenSizeUtils.IsPortrait ? 600 : 768, 492)),
+ Size = SpUtils.ToPixels(new Size(336, 96)),
TranslatableText = "WIFI_OK",
};
+ addButton.TextLabel.FontSizeScale = FontSizeScale.UseSystemSetting;
addButton.Clicked += (s, e) =>
{
OnDismiss?.Invoke();
};
this.Add(addButton);
+ Relayout += ChangeSecurityTypePopup_Relayout;
+ }
+
+ private void ChangeSecurityTypePopup_Relayout(object sender, EventArgs e)
+ {
+ Relayout -= ChangeSecurityTypePopup_Relayout;
+ addButton.IsEnabled = !addButton.IsEnabled;
+ addButton.IsEnabled = !addButton.IsEnabled;
}
private void InitializeRadioButtons()
choiceViews.Add(view);
}
- listView = new ListView(768, 238)
+ listView = new ListView(ScreenSizeUtils.IsPortrait ? 856 : 1024, 324)
{
Items = choiceViews,
};
- listView.View.Position = SpUtils.ToPixels(new Position(0, 82));
+ listView.View.Position = SpUtils.ToPixels(new Position(80, 128));
(radioButtonGroup.GetItem(0) as SecurityTypeView.SecurityRadioButton)?.SetSelectionProgramatically(true);
public SecurityTypeView(WifiUISecurityType wifiUISecurityType)
{
- Size = SpUtils.ToPixels(new Size(768, 64));
+ Size = SpUtils.ToPixels(new Size(1024, 108));
Layout = new AbsoluteLayout();
this.WifiUISecurityType = wifiUISecurityType;
Button = new SecurityRadioButton
{
IsSelected = false,
- Position = SpUtils.ToPixels(new Position(40, 20)),
- Size = SpUtils.ToPixels(new Size(24, 24)),
+ PositionX = SpUtils.ToPixels(36),
CellHorizontalAlignment = HorizontalAlignmentType.Center,
CellVerticalAlignment = VerticalAlignmentType.Center,
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.CenterLeft,
+ ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
};
this.Add(Button);
descriptionTextLabel = new TextLabel
{
- Position = SpUtils.ToPixels(new Position(92, 19)),
- Size = SpUtils.ToPixels(new Size(648, 26)),
+ PositionX = SpUtils.ToPixels(108),
PixelSize = SpUtils.ToPixels(20),
TranslatableText = WifiUISecurityType.GetUIName(),
FontFamily = "BreezeSans",
TextColor = new Color(0.0f, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
HorizontalAlignment = HorizontalAlignment.Begin,
VerticalAlignment = VerticalAlignment.Center,
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.CenterLeft,
+ ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
+ FontSizeScale = FontSizeScale.UseSystemSetting,
};
this.Add(descriptionTextLabel);
public WifiPasswordPopup(WiFiAP wifiAp)
{
BackgroundImage = backgroundImagePath;
- Size = SpUtils.ToPixels(new Size(808, 271));
+ Size = SpUtils.ToPixels(new Size(ScreenSizeUtils.IsPortrait ? 1016 : 1184, ScreenSizeUtils.IsPortrait ? 404 : 401));
this.wifiAp = wifiAp;
this.Add(new View() // underline
{
- Size = SpUtils.ToPixels(new Size(672, 1)),
- Position2D = SpUtils.ToPixels(new Position2D(40, 116)),
+ Size = SpUtils.ToPixels(new Size(ScreenSizeUtils.IsPortrait ? 856 : 1024, 1)),
+ Position2D = SpUtils.ToPixels(new Position2D(80, 197)),
BackgroundColor = new Color(0xC3 / 255.0f, 0xCA / 255.0f, 0xD2 / 255.0f, 1.0f),
});
var titleLabel = new TextLabel
{
- Size = SpUtils.ToPixels(new Size(728, 33)),
- Position2D = SpUtils.ToPixels(new Position2D(40, 24)),
-
+ PositionY = SpUtils.ToPixels(61),
// no translatableText because of dynamic content
Text = string.Format(Translations.WIFI_ENTER_PASSWORD_TO_JOIN, wifiAp.NetworkInformation.Essid),
- PixelSize = SpUtils.ToPixels(26),
+ PixelSize = SpUtils.ToPixels(40),
TextColor = new Color(0, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
FontFamily = "BreezeSans",
FontStyle = new PropertyMap().AddRegularFontStyle(),
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.Center,
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopCenter,
+ FontSizeScale = FontSizeScale.UseSystemSetting,
};
this.Add(titleLabel);
passwordEntry = new PasswordEntry()
{
- Size = SpUtils.ToPixels(new Size(624, 27)),
- Position = SpUtils.ToPixels(new Position(40, 90)),
+ Position = SpUtils.ToPixels(new Position(80, 200)),
MaxLength = MaxPasswordLength,
PixelSize = SpUtils.ToPixels(22),
TextColor = new Color(0, 0x0C / 255.0f, 0x2B / 255.0f, 1.0f),
FontStyle = new PropertyMap().AddRegularFontStyle(),
Revealed = false,
TranslatablePlaceholderText = "WIFI_PASSWORD",
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ VerticalAlignment = VerticalAlignment.Bottom,
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+ FontSizeScale = FontSizeScale.UseSystemSetting,
};
passwordEntry.TextChanged += (s, e) => UpdateOKButton();
connectionFailure = new TextLabel
{
- Size = SpUtils.ToPixels(new Size(624, 22)),
- Position = SpUtils.ToPixels(new Position(40, 117)),
+ Position = SpUtils.ToPixels(new Position(80, 201)),
TranslatableText = "WIFI_INVALID_PASSWORD",
PixelSize = SpUtils.ToPixels(18),
TextColor = new Color(0xAA / 255.0f, 0x18 / 255.0f, 0x18 / 255.0f, 1.0f),
FontStyle = new PropertyMap().AddRegularFontStyle(),
HorizontalAlignment = HorizontalAlignment.Begin,
VerticalAlignment = VerticalAlignment.Center,
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+ FontSizeScale = FontSizeScale.UseSystemSetting,
};
connectionFailure.Hide();
this.Add(connectionFailure);
+ var userScale = ScreenSizeUtils.GetFootnoteFontSizeScaleMaxLarge();
revealButton = new Button(ButtonStyles.Reveal)
{
- Size = SpUtils.ToPixels(new Size(48, 48)),
- Position = SpUtils.ToPixels(new Position(720, 79)),
+ Size = SpUtils.ToPixels(new Size(userScale * 48, userScale * 48)),
+ Position = SpUtils.ToPixels(new Position(ScreenSizeUtils.IsPortrait ? 944 : 1112, 205)),
IsSelectable = true,
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.BottomRight,
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
};
revealButton.Clicked += (s, e) => TogglePasswordVisibility();
this.Add(revealButton);
cancelButton = new Button(ButtonStyles.Cancel)
{
- Size = SpUtils.ToPixels(new Size(240, 72)),
- Position = SpUtils.ToPixels(new Position(80, 175)),
+ Size = SpUtils.ToPixels(new Size(336, 96)),
+ Position = SpUtils.ToPixels(new Position(80, 261)),
};
+ cancelButton.TextLabel.FontSizeScale = FontSizeScale.UseSystemSetting;
cancelButton.Clicked += (s, e) =>
{
OnDismiss.Invoke();
okButton = new Button(ButtonStyles.OK)
{
- Size = SpUtils.ToPixels(new Size(240, 72)),
- Position = SpUtils.ToPixels(new Position(488, 175)),
+ Size = SpUtils.ToPixels(new Size(336, 96)),
+ Position = SpUtils.ToPixels(new Position(ScreenSizeUtils.IsPortrait ? 600 : 768, 261)),
IsEnabled = false,
};
+ okButton.TextLabel.FontSizeScale = FontSizeScale.UseSystemSetting;
okButton.Clicked += async (s, e) =>
{
isConnecting = true;
{
public class WifiView : IDisposable
{
- public const int ListItemWidth = 460;
- public const int ListItemHeight = 79;
+ public const int ListItemWidth = 1060;
+ public const int ListItemHeight = 80;
private View view = null;
LinearOrientation = LinearLayout.Orientation.Vertical,
},
BackgroundImage = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "Rectangle_918.png"),
- Size = SpUtils.ToPixels(new Size(480, 416)),
};
- view.Add(CreateHeader(480, 91));
+ view.Add(CreateHeader(ScreenSizeUtils.IsPortrait ? 824 : 1080, 80));
view.Add(CreateSeparator());
{
LinearOrientation = LinearLayout.Orientation.Horizontal,
},
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.CenterLeft,
+ ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
+ PositionX = SpUtils.ToPixels(40),
};
+ float userScale = ScreenSizeUtils.GetFootnoteFontSizeScaleMaxLarge();
var progress = new View()
{
- Size = SpUtils.ToPixels(new Size(22, 23)),
- Margin = SpUtils.ToPixels(new Extents(0, 0, 1, 0)),
+ Size = SpUtils.ToPixels(new Size(userScale * 25, userScale * 26)),
+ Margin = SpUtils.ToPixels(new Extents((ushort)(userScale * 13), 0, 0, 0)),
BackgroundImage = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "12_icon_scanning.png"),
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.Center,
+ ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
};
view.Add(progress);
view.Add(new TextLabel()
{
- Size = SpUtils.ToPixels(new Size(190, 25)),
TranslatableText = "WIFI_SCANNING",
Margin = SpUtils.ToPixels(new Extents(17, 0, 0, 0)),
- VerticalAlignment = VerticalAlignment.Center,
- HorizontalAlignment = HorizontalAlignment.Begin,
PixelSize = SpUtils.ToPixels(20f),
TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
FontFamily = "BreezeSans",
FontStyle = new PropertyMap().AddRegularFontStyle(),
+ FontSizeScale = FontSizeScale.UseSystemSetting,
});
return view;
}
{
return new View()
{
- Size2D = SpUtils.ToPixels(new Size(400, 1)),
+ Size2D = SpUtils.ToPixels(new Size(ScreenSizeUtils.IsPortrait ? 744 : 1000, 1)),
BackgroundColor = new Color(0xC3 / 255f, 0xCA / 255f, 0xD2 / 255f, 1.0f),
Margin = SpUtils.ToPixels(new Extents(40, 0, 0, 0)),
};
var addNewButton = new Button(ButtonStyles.AddNetwork)
{
- Position = SpUtils.ToPixels(new Position(29, 20)),
+ Position = SpUtils.ToPixels(new Position(44, 0)),
Size = SpUtils.ToPixels(new Size(42, 42)),
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.CenterLeft,
+ ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
};
addNewButton.Clicked += (s, e) => ShowAddNetworkPopup();
manualWifi.Add(new TextLabel()
{
TranslatableText = "WIFI_ADD_NEW_NETWORK",
- Position = SpUtils.ToPixels(new Position(87, 29)),
+ Position = SpUtils.ToPixels(new Position(110, 0)),
PixelSize = SpUtils.ToPixels(20f),
TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
FontFamily = "BreezeSans",
FontStyle = new PropertyMap().AddRegularFontStyle(),
+ FontSizeScale = FontSizeScale.UseSystemSetting,
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.CenterLeft,
+ ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
});
return manualWifi;
}
{
var view = new AddNewNetworkPupup();
var popup = new Common.Utils.Popup(view, centered: true);
+ view.PositionY = SpUtils.ToPixels(-130);
view.OnDismiss += popup.Dismiss;
popup.Show();
}
var scan = new Button(ButtonStyles.Scan)
{
- Size = SpUtils.ToPixels(new Size(72, 32)),
- Position = SpUtils.ToPixels(new Position(276, 39)),
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.CenterRight,
+ ParentOrigin = Tizen.NUI.ParentOrigin.CenterRight,
};
+ scan.PositionX = SpUtils.ToPixels(-61) - scan.SizeWidth;
scan.Clicked += async (s, e) =>
{
scan.IsEnabled = false;
{
var button = new Button(ButtonStyles.TurnOnOff)
{
- Size = SpUtils.ToPixels(new Size(72, 32)),
- Position = SpUtils.ToPixels(new Position(369, 39)),
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.CenterRight,
+ ParentOrigin = Tizen.NUI.ParentOrigin.CenterRight,
+ PositionX = SpUtils.ToPixels(-40),
};
button.IsSelectable = true;
button.IsSelected = State.IsTurnedOn;
private View CreateListViewPlaceHolder()
{
var view = new View();
- var listView = new ListView(480, 319)
+ var listView = new ListView(1080, 490)
{
Footer = CreateManualWifiView(),
Items = ApManager.Views,
{
var view = new View()
{
- Position = SpUtils.ToPixels(new Position(40, 43)),
+ Size = SpUtils.ToPixels(new Size(1080, 80)),
};
var wifi = new TextLabel("Wi-Fi")
TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
FontFamily = "BreezeSans",
FontStyle = new PropertyMap().AddRegularFontStyle(),
+ FontSizeScale = FontSizeScale.UseSystemSetting,
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.CenterLeft,
+ ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
+ PositionX = SpUtils.ToPixels(40),
};
view.Add(wifi);
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
+using Tizen.System;
namespace Oobe.Wifi
{
var view = new TwoButtonsPage();
- view.Title.ParentOrigin = new Position(0.5f, 0.064f);
+ view.Title.ParentOrigin = new Position(0.5f, ScreenSizeUtils.IsPortrait ? 0.183f : 0.035f);
view.Title.TranslatableText = "CHOOSE_WIFI_NETWORK";
+ view.Title.FontSizeScale = ScreenSizeUtils.GetFootnoteFontSizeScaleMaxHuge();
+
wifiView = new WifiView();
- wifiView.View.Size = SpUtils.ToPixels(new Size(480, 416));
+ wifiView.View.Size = SpUtils.ToPixels(ScreenSizeUtils.IsPortrait ? new Size2D(824, 800) : new Size2D(1080, 568));
+ wifiView.View.Position = new Position(0, SpUtils.ToPixels((ScreenSizeUtils.IsPortrait ? 408 : 55) + (48 * TextUtils.GetFontSizeScale(SystemSettings.FontSize))));
view.Content = wifiView.View;
+ view.Content.PivotPoint = Position.PivotPointTopCenter;
+ view.Content.ParentOrigin = Position.ParentOriginTopCenter;
view.PreviousButton.Clicked += (s, e) => nav.Previous();
view.NextButton.Clicked += (s, e) => nav.Next();