</ItemGroup>
<ItemGroup>
+ <ProjectReference Include="..\OobeCommon\OobeCommon.csproj" />
<ProjectReference Include="..\OobeLanguage\OobeLanguage.csproj" />
<ProjectReference Include="..\OobeRegion\OobeRegion.csproj" />
<ProjectReference Include="..\OobeTerms\OobeTerms.csproj" />
<icon>Oobe.png</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
</ui-application>
+ <privileges>
+ <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
+ </privileges>
</manifest>
</PackageReference>\r
<PackageReference Include="Tizen.NET.Sdk" Version="1.0.9" />\r
</ItemGroup>\r
+\r
+ <ItemGroup>\r
+ <Folder Include="res\" />\r
+ </ItemGroup>\r
</Project>\r
--- /dev/null
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI;
+
+namespace Oobe.Common.Styles
+{
+ public class ButtonStyles
+ {
+ public static ButtonStyle Next = new ButtonStyle{
+ BackgroundImage = new Selector<string>{
+ Normal = NUIApplication.Current.DirectoryInfo.Resource + "button/02_CTA_empty_active.svg",
+ Pressed = NUIApplication.Current.DirectoryInfo.Resource + "button/02_CTA_empty_selected.svg",
+ },
+ Text = new TextLabelStyle{
+ PointSize = new Selector<float?>{
+ Normal = 22.0f,
+ Pressed = 24.0f
+ },
+ TextColor = Color.White,
+ Text = "CONTINUE",
+ },
+ Size2D = new Size2D(240, 72),
+ };
+ public static ButtonStyle Previous = new ButtonStyle{
+ Text = new TextLabelStyle{
+ PointSize = new Selector<float?>{
+ Normal = 22.0f,
+ Pressed = 24.0f
+ },
+ EnableMarkup = true,
+ Text = "PREVIOUS",
+ TextColor = new Selector<Color>{
+ Normal = new Color(0.0f, 20.0f/255.0f, 71/255.0f, 1.0f),
+ Pressed = new Color(41.0f/255.0f, 91.0f/255.0f, 178/255.0f, 1.0f),
+ }
+ },
+ Size2D = new Size2D(240, 72),
+ };
+ }
+}
\ No newline at end of file
--- /dev/null
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI;
+
+namespace Oobe.Common.Styles
+{
+ public class DropDownStyles
+ {
+ public static DropDownStyle Default = new DropDownStyle{
+ Button = new ButtonStyle {
+ Text = new TextLabelStyle{
+ TextColor = new Color(0,0,0,1),
+ PointSize = 20,
+ FontFamily = "BreezeSans",
+ Position = new Position(28, 0),
+ Size2D = new Size2D(360, 30),
+ },
+ Icon = new ImageViewStyle{
+ ResourceUrl = NUIApplication.Current.DirectoryInfo.Resource + "drop-down/list_ic_dropdown.png",
+ Size = new Size(48, 48),
+ },
+ IconRelativeOrientation = Button.IconOrientation.Right,
+ PositionX = 56,
+ },
+ ListBackgroundImage = new ImageViewStyle{
+ ResourceUrl = NUIApplication.Current.DirectoryInfo.Resource + "drop-down/dropdown_bg.png",
+ Border = new Rectangle(51, 51, 51, 51),
+ Size = new Size(360, 500),
+ },
+ ListMargin = new Extents{
+ Start = 20,
+ Top = 20,
+ },
+ ListPadding = new Extents(4,4,4,4),
+ Size2D = new Size2D(360, 108),
+ Position2D = new Position2D(412, 242),
+ SpaceBetweenButtonTextAndIcon = 8,
+ };
+ public static DropDownItemStyle ItemDefault = new DropDownItemStyle{
+ Text = new TextLabelStyle{
+ PointSize = 20,
+ FontFamily = "BreezeSans",
+ },
+ CheckImage = new ImageViewStyle{
+ Size = new Size(40, 40),
+ ResourceUrl = NUIApplication.Current.DirectoryInfo.Resource + "drop-down/dropdown_checkbox_on.png",
+ },
+ CheckImageGapToBoundary = 16,
+ BackgroundColor = new Selector<Color>{
+ Pressed = new Color(0, 0, 0, 0.4f),
+ Other = new Color(1, 1, 1, 0),
+ },
+ Size = new Size(360, 96),
+ };
+ }
+}
\ No newline at end of file
--- /dev/null
+using Tizen.NUI;
+
+namespace Oobe.Common.Styles
+{
+ public static class FontsStyles
+ {
+ private static PropertyMap light;
+
+ public static PropertyMap Light()
+ {
+ if (light == null)
+ {
+ light = new PropertyMap();
+ light.Add("weight", new PropertyValue("light"));
+ }
+ return light;
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+
+namespace Oobe.Common.Styles
+{
+ public class ScrollBarStyles
+ {
+ public static ScrollBarStyle Default = new ScrollBarStyle{
+
+ Direction = ScrollBar.DirectionType.Vertical,
+ Position2D = new Position2D(394, 2),
+ Size2D = new Size2D(4, 446),
+ Track = new ImageViewStyle{
+ BackgroundColor = Color.Green,
+ },
+ Thumb = new ImageViewStyle{
+ Size = new Size(4, 30),
+ BackgroundColor = Color.Yellow,
+ }
+ };
+ }
+}
\ No newline at end of file
--- /dev/null
+<svg id="_02_CTA_empty_selected" data-name="02_CTA_empty_selected" xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72">\r
+ <rect id="Rectangle_346" data-name="Rectangle 346" width="240" height="72" rx="28" fill="#0a0e4a"/>\r
+</svg>\r
--- /dev/null
+<svg id="_02_CTA_empty_selected" data-name="02_CTA_empty_selected" xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72">\r
+ <rect id="Rectangle_346" data-name="Rectangle 346" width="240" height="72" rx="28" fill="#2b5fb9"/>\r
+</svg>\r
--- /dev/null
+<svg id="_02_CTA_empty_selected" data-name="02_CTA_empty_selected" xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72">\r
+ <rect id="Rectangle_346" data-name="Rectangle 346" width="240" height="72" rx="28" fill="#0a0e4a"/>\r
+</svg>\r
--- /dev/null
+<svg id="_02_CTA_empty_selected" data-name="02_CTA_empty_selected" xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72">\r
+ <rect id="Rectangle_346" data-name="Rectangle 346" width="240" height="72" rx="28" fill="#2b5fb9"/>\r
+</svg>\r
-using System;\r
-using Oobe.Common.Interfaces;\r
+using Oobe.Common.Interfaces;\r
+using Oobe.Common.Styles;\r
using Tizen.NUI;\r
+using Tizen.NUI.Components;\r
using Tizen.NUI.BaseComponents;\r
+using Oobe.Language.Model;\r
\r
namespace Oobe.Language\r
{\r
public class LanguageStep : ProcessStep\r
{\r
+ private LanguageManger manager;\r
+\r
public LanguageStep() : base()\r
{\r
+ }\r
\r
+ public override void OnInitialized()\r
+ {\r
+ manager = new LanguageManger();\r
}\r
\r
public override View CreateView(IProcessNavigation nav)\r
{\r
- TextLabel text2 = new TextLabel("Choose Language");\r
- text2.HorizontalAlignment = HorizontalAlignment.Center;\r
- text2.VerticalAlignment = VerticalAlignment.Center;\r
- text2.TextColor = Color.Black;\r
- text2.PointSize = 12.0f;\r
- text2.HeightResizePolicy = ResizePolicyType.FillToParent;\r
- text2.WidthResizePolicy = ResizePolicyType.FillToParent;\r
- return text2;\r
+ View container = new View();\r
+\r
+ TextLabel title = new TextLabel("Choose language");\r
+ title.Position2D = new Position2D(410, 160);\r
+ title.Size2D = new Size2D(364, 58);\r
+ title.TextColor = new Color(0, 20.0f/255.0f, 71.0f/255.0f, 1.0f);\r
+ title.HorizontalAlignment = HorizontalAlignment.Center;\r
+ title.Ellipsis = false;\r
+ title.PixelSize = 48.0f;\r
+ title.FontFamily = "BreezeSans";\r
+ title.FontStyle = FontsStyles.Light();\r
+\r
+ var dropDown = new DropDown(DropDownStyles.Default);\r
+\r
+ foreach (LanguageInfo info in manager.Languages)\r
+ {\r
+ DropDown.DropDownDataItem item = new DropDown.DropDownDataItem(DropDownStyles.ItemDefault);\r
+ item.Text = info.LocalName;\r
+ item.TextPosition = new Position(28, 0);\r
+ dropDown.AddItem(item);\r
+ }\r
+ var scrollBar = new ScrollBar(ScrollBarStyles.Default);\r
+ dropDown.AttachScrollBar(scrollBar);\r
+\r
+ Button btn = new Button(ButtonStyles.Next);\r
+ btn.Position2D = new Position2D(888, 512);\r
+ btn.ClickEvent += (obj, args) => {\r
+ if (dropDown.SelectedItemIndex >= 0 && dropDown.SelectedItemIndex < manager.Languages.Count)\r
+ {\r
+ var lang = manager.Languages[dropDown.SelectedItemIndex];\r
+ manager.CurrentLanguage = lang;\r
+ }\r
+ nav.Next();\r
+ };\r
+\r
+ container.Add(title);\r
+ container.Add(btn);\r
+ container.Add(dropDown);\r
+\r
+ dropDown.SelectedItemIndex = 1;\r
+\r
+ return container;\r
}\r
}\r
}\r
--- /dev/null
+using System.Xml.Serialization;
+
+namespace Oobe.Language.Model
+{
+ public class LanguageInfo
+ {
+ [XmlAttribute("code")]
+ public string Code { get; set; }
+ [XmlAttribute("name_en")]
+ public string EnglishName { get; set; }
+ [XmlAttribute("name_local")]
+ public string LocalName { get; set; }
+ [XmlAttribute("message")]
+ public string Message { get; set; }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace Oobe.Language.Model
+{
+ [XmlRoot("languages")]
+ public class LanguageInfoList
+ {
+ [XmlElement("language")]
+ public List<LanguageInfo> Languages { get; set; }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System.Collections.Generic;
+using Tizen.System;
+using System.Linq;
+using System.IO;
+using System.Xml.Serialization;
+
+namespace Oobe.Language.Model
+{
+ public class LanguageManger
+ {
+ public LanguageManger()
+ {
+ var filename = Tizen.Applications.CoreApplication.Current.DirectoryInfo.Resource + "languages_OOBE.xml";
+
+ using (FileStream xml = File.Open(filename, FileMode.Open, FileAccess.Read))
+ {
+ var xs = new XmlSerializer(typeof(LanguageInfoList));
+ var languageList = (LanguageInfoList)xs.Deserialize(xml);
+ Languages = languageList.Languages;
+ }
+ }
+
+ public List<LanguageInfo> Languages { get; private set; }
+
+ public LanguageInfo CurrentLanguage
+ {
+ get
+ {
+ return Languages.Single(s => s.Code == SystemSettings.LocaleLanguage);
+ }
+ set
+ {
+ if (value != null)
+ {
+ SystemSettings.LocaleCountry = value.Code;
+ SystemSettings.LocaleLanguage = value.Code;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
<ItemGroup>\r
<ProjectReference Include="..\OobeCommon\OobeCommon.csproj" />\r
</ItemGroup>\r
+\r
+ <ItemGroup>\r
+ <Folder Include="res\" />\r
+ </ItemGroup>\r
</Project>\r
--- /dev/null
+<?xml version="1.0"?>
+<languages>
+ <language code="ko_KR" name_en="Korean" name_local="한국어" message="언어 선택" />
+ <language code="en_US" name_en="English (US)" name_local="English" message="Select your language" />
+ <language code="pl_PL" name_en="Polish" name_local="Polski" message="Wybierz swój język" />
+</languages>
--- /dev/null
+using System.Xml.Serialization;
+
+namespace Oobe.Region.Model
+{
+ public class RegionInfo
+ {
+ [XmlAttribute("code")]
+ public string CountryCode { get; set; }
+ [XmlAttribute("name")]
+ public string Name { get; set; }
+ [XmlAttribute("timezone")]
+ public string Timezone{ get; set; }
+ [XmlAttribute("cityname")]
+ public string CityName { get; set; }
+
+ }
+}
\ No newline at end of file
--- /dev/null
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace Oobe.Region.Model
+{
+ [XmlRoot("regions")]
+ public class RegionInfoList
+ {
+ [XmlElement("region")]
+ public List<RegionInfo> Regions { get; set; }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Xml.Serialization;
+using Tizen.System;
+using Oobe.Common.Services;
+using System;
+
+namespace Oobe.Region.Model
+{
+ public class RegionManager
+ {
+ private const string CountryCodeVconfKey = "db/setting/country_code";
+ private const string CityNameIdVconfKey = "db/setting/cityname_id";
+
+ public RegionManager()
+ {
+ var filename = Tizen.Applications.CoreApplication.Current.DirectoryInfo.Resource + "regions_OOBE.xml";
+
+ using (FileStream xml = File.Open(filename, FileMode.Open, FileAccess.Read))
+ {
+ var xs = new XmlSerializer(typeof(RegionInfoList));
+ var regionsList = (RegionInfoList)xs.Deserialize(xml);
+ Regions = regionsList.Regions;
+ }
+ }
+
+ public List<RegionInfo> Regions { get; private set; }
+
+ public RegionInfo CurrentRegion
+ {
+ get
+ {
+ return Regions.Single(s => s.Timezone == Vconf.GetString(CountryCodeVconfKey));
+ }
+ set
+ {
+ if (value != null)
+ {
+ SystemSettings.LocaleTimeZone = value.Timezone;
+ try {
+ Vconf.SetString(CountryCodeVconfKey, value.CountryCode);
+ Vconf.SetString(CityNameIdVconfKey, value.CityName);
+ }
+ catch (Exception e)
+ {
+ Tizen.Log.Debug("oobe", $"setting vconf keys failed: {e.Message}");
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
<ItemGroup>\r
<ProjectReference Include="..\OobeCommon\OobeCommon.csproj" />\r
</ItemGroup>\r
+\r
+ <ItemGroup>\r
+ <Folder Include="res\" />\r
+ </ItemGroup>\r
</Project>\r
-using System;\r
+using Oobe.Common.Styles;\r
using Tizen.NUI;\r
using Tizen.NUI.BaseComponents;\r
using Oobe.Common.Interfaces;\r
+using Tizen.NUI.Components;\r
+using Oobe.Region.Model;\r
\r
namespace Oobe.Region\r
{\r
public class RegionStep : ProcessStep\r
{\r
+ private RegionManager manager;\r
+\r
public RegionStep() : base()\r
{\r
+ }\r
\r
+ public override void OnInitialized()\r
+ {\r
+ manager = new RegionManager();\r
}\r
\r
public override View CreateView(IProcessNavigation nav)\r
{\r
- TextLabel text2 = new TextLabel("Choose Country");\r
- text2.HorizontalAlignment = HorizontalAlignment.Center;\r
- text2.VerticalAlignment = VerticalAlignment.Center;\r
- text2.TextColor = Color.Black;\r
- text2.PointSize = 12.0f;\r
- text2.HeightResizePolicy = ResizePolicyType.FillToParent;\r
- text2.WidthResizePolicy = ResizePolicyType.FillToParent;\r
- return text2;\r
+ View container = new View();\r
+\r
+ TextLabel title = new TextLabel("Choose Region");\r
+ title.Position2D = new Position2D(410, 160);\r
+ title.Size2D = new Size2D(364, 58);\r
+ title.TextColor = new Color(0, 20.0f/255.0f, 71.0f/255.0f, 1.0f);\r
+ title.HorizontalAlignment = HorizontalAlignment.Center;\r
+ title.Ellipsis = false;\r
+ title.PixelSize = 48.0f;\r
+ title.FontFamily = "BreezeSans";\r
+ title.FontStyle = FontsStyles.Light();\r
+\r
+ var dropDown = new DropDown(DropDownStyles.Default);\r
+\r
+ foreach (RegionInfo info in manager.Regions)\r
+ {\r
+ DropDown.DropDownDataItem item = new DropDown.DropDownDataItem(DropDownStyles.ItemDefault);\r
+ item.Text = info.Name;\r
+ item.TextPosition = new Position(28, 0);\r
+ dropDown.AddItem(item);\r
+ }\r
+ var scrollBar = new ScrollBar(ScrollBarStyles.Default);\r
+ dropDown.AttachScrollBar(scrollBar);\r
+\r
+ Button next = new Button(ButtonStyles.Next);\r
+ next.Position2D = new Position2D(888, 512);\r
+ next.ClickEvent += (obj, args) => {\r
+ if (dropDown.SelectedItemIndex >= 0 && dropDown.SelectedItemIndex < manager.Regions.Count)\r
+ {\r
+ var region = manager.Regions[dropDown.SelectedItemIndex];\r
+ manager.CurrentRegion = region;\r
+ }\r
+ nav.Next();\r
+ };\r
+\r
+ Button prev = new Button(ButtonStyles.Previous);\r
+ prev.Position2D = new Position2D(56, 512);\r
+ prev.ClickEvent += (obj, args) => {\r
+ nav.Previous();\r
+ };\r
+\r
+ container.Add(dropDown);\r
+ container.Add(title);\r
+ container.Add(prev);\r
+ container.Add(next);\r
+\r
+ dropDown.SelectedItemIndex = 1;\r
+\r
+ return container;\r
}\r
}\r
}\r
--- /dev/null
+<?xml version="1.0"?>
+<regions>
+ <region code="GB" name="United Kingdom" timezone="Europe/London" cityname="IDS_WCL_BODY_CITYNAME_LONDON" />
+ <region code="DE" name="Germany" timezone="Europe/Berlin" cityname="IDS_WCL_BODY_CITYNAME_BERLIN" />
+ <region code="PL" name="Poland" timezone="Europe/Warsaw" cityname="IDS_WCL_BODY_CITYNAME_WARSAW" />
+</regions>