Language and Region view implementation
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Wed, 11 Mar 2020 11:41:39 +0000 (12:41 +0100)
committerLukasz Stanislawski/IoT & UI Sample (PLT) /SRPOL/Engineer/Samsung Electronics <l.stanislaws@samsung.com>
Tue, 17 Mar 2020 07:40:34 +0000 (08:40 +0100)
Current difference comparing to guideline:
1. The carousel selector is replaced with DropDown control
2. Translations are missing

26 files changed:
Oobe/Oobe/Oobe.csproj
Oobe/Oobe/tizen-manifest.xml
Oobe/OobeCommon/OobeCommon.csproj
Oobe/OobeCommon/Styles/ButtonStyles.cs [new file with mode: 0644]
Oobe/OobeCommon/Styles/DropDownStyles.cs [new file with mode: 0644]
Oobe/OobeCommon/Styles/FontStyles.cs [new file with mode: 0644]
Oobe/OobeCommon/Styles/ScrollBarStyles.cs [new file with mode: 0644]
Oobe/OobeCommon/res/02_CTA_empty_active.svg [new file with mode: 0644]
Oobe/OobeCommon/res/02_CTA_empty_selected.svg [new file with mode: 0644]
Oobe/OobeCommon/res/button/02_CTA_empty_active.svg [new file with mode: 0644]
Oobe/OobeCommon/res/button/02_CTA_empty_selected.svg [new file with mode: 0644]
Oobe/OobeCommon/res/drop-down/dropdown_bg.png [new file with mode: 0755]
Oobe/OobeCommon/res/drop-down/dropdown_checkbox_on.png [new file with mode: 0755]
Oobe/OobeCommon/res/drop-down/list_ic_dropdown.png [new file with mode: 0755]
Oobe/OobeLanguage/LanguageStep.cs
Oobe/OobeLanguage/Model/LanguageInfo.cs [new file with mode: 0644]
Oobe/OobeLanguage/Model/LanguageInfoList.cs [new file with mode: 0644]
Oobe/OobeLanguage/Model/LanguageManger.cs [new file with mode: 0644]
Oobe/OobeLanguage/OobeLanguage.csproj
Oobe/OobeLanguage/res/languages_OOBE.xml [new file with mode: 0644]
Oobe/OobeRegion/Model/RegionInfo.cs [new file with mode: 0644]
Oobe/OobeRegion/Model/RegionInfoList.cs [new file with mode: 0644]
Oobe/OobeRegion/Model/RegionManager.cs [new file with mode: 0644]
Oobe/OobeRegion/OobeRegion.csproj
Oobe/OobeRegion/RegionStep.cs
Oobe/OobeRegion/res/regions_OOBE.xml [new file with mode: 0644]

index bef0940..5617d4b 100644 (file)
@@ -26,6 +26,7 @@
   </ItemGroup>
 
   <ItemGroup>
+    <ProjectReference Include="..\OobeCommon\OobeCommon.csproj" />
     <ProjectReference Include="..\OobeLanguage\OobeLanguage.csproj" />
     <ProjectReference Include="..\OobeRegion\OobeRegion.csproj" />
     <ProjectReference Include="..\OobeTerms\OobeTerms.csproj" />
index ae02f9b..bb9f58c 100644 (file)
@@ -12,4 +12,7 @@
     <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>
index 32a8584..74f484d 100644 (file)
@@ -12,4 +12,8 @@
     </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
diff --git a/Oobe/OobeCommon/Styles/ButtonStyles.cs b/Oobe/OobeCommon/Styles/ButtonStyles.cs
new file mode 100644 (file)
index 0000000..afe319a
--- /dev/null
@@ -0,0 +1,40 @@
+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
diff --git a/Oobe/OobeCommon/Styles/DropDownStyles.cs b/Oobe/OobeCommon/Styles/DropDownStyles.cs
new file mode 100644 (file)
index 0000000..666ee96
--- /dev/null
@@ -0,0 +1,56 @@
+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
diff --git a/Oobe/OobeCommon/Styles/FontStyles.cs b/Oobe/OobeCommon/Styles/FontStyles.cs
new file mode 100644 (file)
index 0000000..9cfdf1c
--- /dev/null
@@ -0,0 +1,19 @@
+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
diff --git a/Oobe/OobeCommon/Styles/ScrollBarStyles.cs b/Oobe/OobeCommon/Styles/ScrollBarStyles.cs
new file mode 100644 (file)
index 0000000..709b335
--- /dev/null
@@ -0,0 +1,23 @@
+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
diff --git a/Oobe/OobeCommon/res/02_CTA_empty_active.svg b/Oobe/OobeCommon/res/02_CTA_empty_active.svg
new file mode 100644 (file)
index 0000000..79eb1ae
--- /dev/null
@@ -0,0 +1,3 @@
+<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
diff --git a/Oobe/OobeCommon/res/02_CTA_empty_selected.svg b/Oobe/OobeCommon/res/02_CTA_empty_selected.svg
new file mode 100644 (file)
index 0000000..b9464a5
--- /dev/null
@@ -0,0 +1,3 @@
+<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
diff --git a/Oobe/OobeCommon/res/button/02_CTA_empty_active.svg b/Oobe/OobeCommon/res/button/02_CTA_empty_active.svg
new file mode 100644 (file)
index 0000000..79eb1ae
--- /dev/null
@@ -0,0 +1,3 @@
+<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
diff --git a/Oobe/OobeCommon/res/button/02_CTA_empty_selected.svg b/Oobe/OobeCommon/res/button/02_CTA_empty_selected.svg
new file mode 100644 (file)
index 0000000..b9464a5
--- /dev/null
@@ -0,0 +1,3 @@
+<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
diff --git a/Oobe/OobeCommon/res/drop-down/dropdown_bg.png b/Oobe/OobeCommon/res/drop-down/dropdown_bg.png
new file mode 100755 (executable)
index 0000000..3b2255b
Binary files /dev/null and b/Oobe/OobeCommon/res/drop-down/dropdown_bg.png differ
diff --git a/Oobe/OobeCommon/res/drop-down/dropdown_checkbox_on.png b/Oobe/OobeCommon/res/drop-down/dropdown_checkbox_on.png
new file mode 100755 (executable)
index 0000000..5955c9f
Binary files /dev/null and b/Oobe/OobeCommon/res/drop-down/dropdown_checkbox_on.png differ
diff --git a/Oobe/OobeCommon/res/drop-down/list_ic_dropdown.png b/Oobe/OobeCommon/res/drop-down/list_ic_dropdown.png
new file mode 100755 (executable)
index 0000000..e87c800
Binary files /dev/null and b/Oobe/OobeCommon/res/drop-down/list_ic_dropdown.png differ
index ddbff3c..8cb50ea 100644 (file)
@@ -1,27 +1,69 @@
-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
diff --git a/Oobe/OobeLanguage/Model/LanguageInfo.cs b/Oobe/OobeLanguage/Model/LanguageInfo.cs
new file mode 100644 (file)
index 0000000..4b18eb3
--- /dev/null
@@ -0,0 +1,16 @@
+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
diff --git a/Oobe/OobeLanguage/Model/LanguageInfoList.cs b/Oobe/OobeLanguage/Model/LanguageInfoList.cs
new file mode 100644 (file)
index 0000000..2f59bf9
--- /dev/null
@@ -0,0 +1,12 @@
+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
diff --git a/Oobe/OobeLanguage/Model/LanguageManger.cs b/Oobe/OobeLanguage/Model/LanguageManger.cs
new file mode 100644 (file)
index 0000000..7d3a59c
--- /dev/null
@@ -0,0 +1,41 @@
+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
index 053b48d..0c3e8bc 100644 (file)
@@ -16,4 +16,8 @@
   <ItemGroup>\r
     <ProjectReference Include="..\OobeCommon\OobeCommon.csproj" />\r
   </ItemGroup>\r
+\r
+  <ItemGroup>\r
+    <Folder Include="res\" />\r
+  </ItemGroup>\r
 </Project>\r
diff --git a/Oobe/OobeLanguage/res/languages_OOBE.xml b/Oobe/OobeLanguage/res/languages_OOBE.xml
new file mode 100644 (file)
index 0000000..1c8602a
--- /dev/null
@@ -0,0 +1,6 @@
+<?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>
diff --git a/Oobe/OobeRegion/Model/RegionInfo.cs b/Oobe/OobeRegion/Model/RegionInfo.cs
new file mode 100644 (file)
index 0000000..5eb44e3
--- /dev/null
@@ -0,0 +1,17 @@
+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
diff --git a/Oobe/OobeRegion/Model/RegionInfoList.cs b/Oobe/OobeRegion/Model/RegionInfoList.cs
new file mode 100644 (file)
index 0000000..e697d60
--- /dev/null
@@ -0,0 +1,12 @@
+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
diff --git a/Oobe/OobeRegion/Model/RegionManager.cs b/Oobe/OobeRegion/Model/RegionManager.cs
new file mode 100644 (file)
index 0000000..b097f9a
--- /dev/null
@@ -0,0 +1,53 @@
+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
index 03ed5fe..0d580fe 100644 (file)
@@ -15,4 +15,8 @@
   <ItemGroup>\r
     <ProjectReference Include="..\OobeCommon\OobeCommon.csproj" />\r
   </ItemGroup>\r
+\r
+  <ItemGroup>\r
+    <Folder Include="res\" />\r
+  </ItemGroup>\r
 </Project>\r
index a940245..d183083 100644 (file)
@@ -1,27 +1,76 @@
-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
diff --git a/Oobe/OobeRegion/res/regions_OOBE.xml b/Oobe/OobeRegion/res/regions_OOBE.xml
new file mode 100644 (file)
index 0000000..b49c6ca
--- /dev/null
@@ -0,0 +1,6 @@
+<?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>