}
}
- public static float GetFootnoteFontSizeScaleMaxHuge()
+ public static float GetExtraSizeHeight(TextLabel textLabel)
{
- switch (SystemSettings.FontSize)
+ if (textLabel.LineCount <= 1)
{
- case SystemSettingsFontSize.Giant:
- return TextUtils.GetFontSizeScale(SystemSettingsFontSize.Huge);
- default:
- return TextUtils.GetFontSizeScale(SystemSettings.FontSize);
+ return 0;
+ }
+ else
+ {
+ return (textLabel.LineCount - 1) * textLabel.SizeHeight / textLabel.LineCount;
}
}
+
+
}
}
\ No newline at end of file
HorizontalAlignment = HorizontalAlignment.Begin,
FontFamily = "BreezeSans",
Ellipsis = false,
+ MultiLine = true,
+ LineWrapMode = LineWrapMode.Word,
+ WidthResizePolicy = ResizePolicyType.FillToParent,
};
private static TextLabelStyle guideTextLabelStyle = new TextLabelStyle
{
PixelSize = SpUtils.ToPixels(18.0f),
Ellipsis = false,
+ MultiLine = true,
+ LineWrapMode = LineWrapMode.Word,
+ WidthResizePolicy = ResizePolicyType.FillToParent,
TextColor = new Selector<Color>
{
Normal = new Color(112.0f / 255.0f, 112.0f / 255.0f, 112.0f / 255.0f, 1.0f),
private TextLabel agreeLabel;
private CheckBox agreeCheckBox;
private TapGestureDetector tapGestureDetector;
+ private View bounding;
private ScrollableBase scroller;
private TextLabel termsContent;
private bool agreementCheckable;
private bool nextEnabled;
+ private View ihaveread;
+ private TextLabel guide;
public TermsView(IProcessNavigation nav, TermsProvider terms)
{
float h2 = (48 * TextUtils.GetFontSizeScale(SystemSettings.FontSize)) + (ScreenSizeUtils.IsPortrait ? 72 : 63);
float h1 = (48 * TextUtils.GetFontSizeScale(SystemSettings.FontSize)) + 55;
int bounding_height = (int)((ScreenSizeUtils.IsPortrait ? 1616 : 776) - h2 - h1);
- View bounding = new View
+ bounding = new View
{
BackgroundColor = Color.White,
CornerRadius = 25.0f,
nav.Previous();
};
- TextLabel guide = new TextLabel(TextLabelStyles.GuideTextLabelStyle);
+ guide = new TextLabel(TextLabelStyles.GuideTextLabelStyle);
guide.TranslatableText = "YOU_MUST_SCROLL_DOWN_AND_READ_THE_WHOLE_TEXT_ABOVE";
- guide.FontSizeScale = ScreenSizeUtils.GetFootnoteFontSizeScaleMaxLarge();
+ guide.FontSizeScale = FontSizeScale.UseSystemSetting;
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 = ScreenSizeUtils.GetFootnoteFontSizeScaleMaxLarge();
+ agreeLabel.FontSizeScale = FontSizeScale.UseSystemSetting;
var footnote = new View
{
},
};
- var ihaveread = new View
+ ihaveread = new View
{
+ SizeWidth = SpUtils.ToPixels(ScreenSizeUtils.IsPortrait ? 680 : 1520),
Layout = new LinearLayout
{
LinearOrientation = LinearLayout.Orientation.Vertical,
return false;
};
timer.Start();
+ ihaveread.Relayout += Ihaveread_Relayout;
+ }
+
+ private void Ihaveread_Relayout(object sender, System.EventArgs e)
+ {
+ float agreeLabelExtraSizeHeight = ScreenSizeUtils.GetExtraSizeHeight(agreeLabel);
+ var boundingSizeCorrection = ScreenSizeUtils.GetExtraSizeHeight(guide) + agreeLabelExtraSizeHeight;
+ bounding.SizeHeight -= SpUtils.ToPixels(boundingSizeCorrection);
+ agreeCheckBox.PositionY -= agreeLabelExtraSizeHeight;
}
private bool NextEnabled
{\r
public class WelcomeStep : ProcessStep\r
{\r
+ private OneButtonPage container;\r
+\r
public override BasePage CreateView(IProcessNavigation nav)\r
{\r
- var container = new OneButtonPage();\r
+ container = new OneButtonPage();\r
\r
container.Title.PivotPoint = Position.PivotPointBottomCenter;\r
container.Title.ParentOrigin = Position.ParentOriginBottomCenter;\r
-(550 + (387 * TextUtils.GetFontSizeScale(SystemSettings.FontSize))) :\r
-(327 + (174 * TextUtils.GetFontSizeScale(SystemSettings.FontSize)))));\r
container.Title.TranslatableText = "WELCOME_TITLE";\r
+ container.Title.MultiLine = true;\r
+ container.Title.LineWrapMode = LineWrapMode.Word;\r
\r
TextLabel content = new TextLabel();\r
content.SizeWidth = SpUtils.ToPixels(ScreenSizeUtils.IsPortrait ? 872 : 1356);\r
-(656 + (108 * TextUtils.GetFontSizeScale(SystemSettings.FontSize))) :\r
-(327 + (55 * TextUtils.GetFontSizeScale(SystemSettings.FontSize)))));\r
\r
+ container.Title.Relayout += Title_Relayout;\r
return container;\r
}\r
+\r
+ private void Title_Relayout(object sender, System.EventArgs e)\r
+ {\r
+ float titleExtraSizeHeight = ScreenSizeUtils.GetExtraSizeHeight(container.Title);\r
+ container.Title.PositionY += titleExtraSizeHeight / 2;\r
+ container.Title.Relayout -= Title_Relayout;\r
+ }\r
}\r
}\r
private Button CreateRevealButton(Position2D position = null)
{
position ??= new Position2D();
- var userScale = ScreenSizeUtils.GetFootnoteFontSizeScaleMaxLarge();
+ var userScale = TextUtils.GetFontSizeScale(SystemSettings.FontSize);
var button = new Button(ButtonStyles.Reveal)
{
Size = SpUtils.ToPixels(new Size(userScale * 48, userScale * 48)),
Position = SpUtils.ToPixels(position),
IsSelectable = true,
PositionUsesPivotPoint = true,
- PivotPoint = Tizen.NUI.PivotPoint.BottomRight,
+ PivotPoint = new Position(1.0f, 0.77f),
ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
};
button.Clicked += (s, e) =>
if (revealButton is null)
{
- revealButton = CreateRevealButton(new Position2D(ScreenSizeUtils.IsPortrait ? 936 : 1104, 375));
+ revealButton = CreateRevealButton(new Position2D(ScreenSizeUtils.IsPortrait ? 936 : 1104, 363));
this.Add(revealButton);
}
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
+using Tizen.System;
namespace Oobe.Wifi.Controls.Wifi
{
private string backgroundImagePath = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "08_popup_body.png");
private WiFiAP wifiAp;
private bool isConnecting = false;
+ private TextLabel titleLabel;
public WifiPasswordPopup(WiFiAP wifiAp)
{
BackgroundImage = backgroundImagePath;
- Size = SpUtils.ToPixels(new Size(ScreenSizeUtils.IsPortrait ? 1016 : 1184, ScreenSizeUtils.IsPortrait ? 404 : 401));
+ var titleHeight = 48 * TextUtils.GetFontSizeScale(SystemSettings.FontSize);
+ Size = SpUtils.ToPixels(new Size(ScreenSizeUtils.IsPortrait ? 1016 : 1184, ScreenSizeUtils.IsPortrait ? 356 + titleHeight : 353 + titleHeight));
this.wifiAp = wifiAp;
- this.Add(new View() // underline
+ View underline = new View()
{
Size = SpUtils.ToPixels(new Size(ScreenSizeUtils.IsPortrait ? 856 : 1024, 1)),
- Position2D = SpUtils.ToPixels(new Position2D(80, 197)),
+ Position2D = SpUtils.ToPixels(new Position2D(80, -204)),
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
+ ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
BackgroundColor = new Color(0xC3 / 255.0f, 0xCA / 255.0f, 0xD2 / 255.0f, 1.0f),
- });
+ };
+ this.Add(underline);
- var titleLabel = new TextLabel
+ titleLabel = new TextLabel
{
- PositionY = SpUtils.ToPixels(61),
+ PositionY = SpUtils.ToPixels(37),
+ Padding = SpUtils.ToPixels(new Extents(80, 80, 0, 0)),
+
// no translatableText because of dynamic content
Text = string.Format(Translations.WIFI_ENTER_PASSWORD_TO_JOIN, wifiAp.NetworkInformation.Essid),
PixelSize = SpUtils.ToPixels(40),
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
PositionUsesPivotPoint = true,
- PivotPoint = Tizen.NUI.PivotPoint.Center,
+ PivotPoint = Tizen.NUI.PivotPoint.TopCenter,
ParentOrigin = Tizen.NUI.ParentOrigin.TopCenter,
FontSizeScale = FontSizeScale.UseSystemSetting,
+ MultiLine = true,
+ LineWrapMode = LineWrapMode.Word,
};
this.Add(titleLabel);
passwordEntry = new PasswordEntry()
{
- Position = SpUtils.ToPixels(new Position(80, 200)),
+ Position = SpUtils.ToPixels(new Position(80, -206)),
MaxLength = MaxPasswordLength,
PixelSize = SpUtils.ToPixels(22),
TextColor = new Color(0, 0x0C / 255.0f, 0x2B / 255.0f, 1.0f),
VerticalAlignment = VerticalAlignment.Bottom,
PositionUsesPivotPoint = true,
PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+ ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
FontSizeScale = FontSizeScale.UseSystemSetting,
};
passwordEntry.TextChanged += (s, e) => UpdateOKButton();
connectionFailure = new TextLabel
{
- Position = SpUtils.ToPixels(new Position(80, 201)),
+ Position = SpUtils.ToPixels(new Position(80, -204)),
TranslatableText = "WIFI_INVALID_PASSWORD",
PixelSize = SpUtils.ToPixels(18),
TextColor = new Color(0xAA / 255.0f, 0x18 / 255.0f, 0x18 / 255.0f, 1.0f),
VerticalAlignment = VerticalAlignment.Center,
PositionUsesPivotPoint = true,
PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+ ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
FontSizeScale = FontSizeScale.UseSystemSetting,
};
connectionFailure.Hide();
this.Add(connectionFailure);
- var userScale = ScreenSizeUtils.GetFootnoteFontSizeScaleMaxLarge();
+ var userScale = TextUtils.GetFontSizeScale(SystemSettings.FontSize);
revealButton = new Button(ButtonStyles.Reveal)
{
Size = SpUtils.ToPixels(new Size(userScale * 48, userScale * 48)),
- Position = SpUtils.ToPixels(new Position(ScreenSizeUtils.IsPortrait ? 944 : 1112, 205)),
+ Position = SpUtils.ToPixels(new Position(ScreenSizeUtils.IsPortrait ? 944 : 1112, -204)),
IsSelectable = true,
PositionUsesPivotPoint = true,
- PivotPoint = Tizen.NUI.PivotPoint.BottomRight,
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+ PivotPoint = new Position(1.0f, 0.77f),
+ ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
};
revealButton.Clicked += (s, e) => TogglePasswordVisibility();
this.Add(revealButton);
cancelButton = new Button(ButtonStyles.Cancel)
{
Size = SpUtils.ToPixels(new Size(336, 96)),
- Position = SpUtils.ToPixels(new Position(80, 261)),
+ Position = SpUtils.ToPixels(new Position(80, -44)),
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
+ ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
};
cancelButton.TextLabel.FontSizeScale = FontSizeScale.UseSystemSetting;
cancelButton.Clicked += (s, e) =>
okButton = new Button(ButtonStyles.OK)
{
Size = SpUtils.ToPixels(new Size(336, 96)),
- Position = SpUtils.ToPixels(new Position(ScreenSizeUtils.IsPortrait ? 600 : 768, 261)),
+ Position = SpUtils.ToPixels(new Position(ScreenSizeUtils.IsPortrait ? 600 : 768, -44)),
+ PositionUsesPivotPoint = true,
+ PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
+ ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
IsEnabled = false,
};
okButton.TextLabel.FontSizeScale = FontSizeScale.UseSystemSetting;
}
};
this.Add(okButton);
+ Relayout += WifiPasswordPopup_Relayout;
+ }
+
+ private void WifiPasswordPopup_Relayout(object sender, EventArgs e)
+ {
+ float popupTitleExtraSizeHeight = ScreenSizeUtils.GetExtraSizeHeight(titleLabel);
+ if (popupTitleExtraSizeHeight > 0)
+ {
+ Relayout -= WifiPasswordPopup_Relayout;
+ }
+
+ SizeHeight += popupTitleExtraSizeHeight;
}
public event Action OnDismiss;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
+using Tizen.System;
namespace Oobe.Wifi.Controls.Wifi
{
PositionX = SpUtils.ToPixels(40),
};
- float userScale = ScreenSizeUtils.GetFootnoteFontSizeScaleMaxLarge();
+ float userScale = TextUtils.GetFontSizeScale(SystemSettings.FontSize);
var progress = new View()
{
Size = SpUtils.ToPixels(new Size(userScale * 25, userScale * 26)),
private View CreateListViewPlaceHolder()
{
var view = new View();
- var listView = new ListView(1080, 490)
+ var listView = new ListView(ScreenSizeUtils.IsPortrait ? 824 : 1080, ScreenSizeUtils.IsPortrait ? 795 : 490)
{
Footer = CreateManualWifiView(),
Items = ApManager.Views,
{
private WifiView wifiView = null;
private EventHandler<ConnectionStateChangedEventArgs> connectionChanged;
+ private TwoButtonsPage view;
public override BasePage CreateView(IProcessNavigation nav)
{
DisposeView();
- var view = new TwoButtonsPage();
+ view = new TwoButtonsPage();
view.Title.ParentOrigin = new Position(0.5f, ScreenSizeUtils.IsPortrait ? 0.183f : 0.035f);
view.Title.TranslatableText = "CHOOSE_WIFI_NETWORK";
- view.Title.FontSizeScale = ScreenSizeUtils.GetFootnoteFontSizeScaleMaxHuge();
-
+ view.Title.FontSizeScale = FontSizeScale.UseSystemSetting;// ScreenSizeUtils.GetFootnoteFontSizeScaleMaxHuge();
+ view.Title.MultiLine = true;
+ view.Title.LineWrapMode = LineWrapMode.Word;
wifiView = new WifiView();
- wifiView.View.Size = SpUtils.ToPixels(ScreenSizeUtils.IsPortrait ? new Size2D(824, 800) : new Size2D(1080, 568));
+ wifiView.View.Size = SpUtils.ToPixels(ScreenSizeUtils.IsPortrait ? new Size2D(824, 880) : 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;
connectionChanged = (s, e) => ApplyStyle(e.State == WiFiConnectionState.Connected);
WiFiManager.ConnectionStateChanged += connectionChanged;
+ view.Title.Relayout += Title_Relayout;
return view;
}
+ private void Title_Relayout(object sender, EventArgs e)
+ {
+ float titleExtraSizeHeight = ScreenSizeUtils.GetExtraSizeHeight(view.Title);
+ view.Title.PositionY -= titleExtraSizeHeight;
+ view.Title.Relayout -= Title_Relayout;
+ }
+
public override void OnShutdown()
{
base.OnShutdown();