--- /dev/null
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.Applications;
+using Tizen;
+
+namespace WidgetApplicationSample
+{
+ class MyWidget : Widget
+ {
+ private TextLabel _textLabel;
+ private Animation _animation;
+ private float _pointSize = 5.0f;
+ private Bundle _content;
+
+ protected override void OnCreate(string contentInfo, Window window)
+ {
+ Tizen.Log.Fatal("NUIWidget", "Widget Instance is OnCreate! " + contentInfo);
+ _content = Bundle.Decode(contentInfo);
+ string imageIdx = Convert.ToString(_content.GetItem("ImageIdx"));
+ Tizen.Log.Fatal("NUIWidget", "Widget Instance content info is " + imageIdx);
+
+
+ if (window.Size.Width > 1000)
+ {
+ _pointSize = 20.0f;
+ }
+
+ window.BackgroundColor = Color.White;
+ _textLabel = new TextLabel("Hello Widget");
+ _textLabel.TextColor = Color.Black;
+ _textLabel.Size2D = new Size2D(270, 60);
+ _textLabel.ParentOrigin = ParentOrigin.Center;
+ _textLabel.PivotPoint = PivotPoint.Center;
+ _textLabel.PositionUsesPivotPoint = true;
+ _textLabel.PointSize = _pointSize;
+ window.Add(_textLabel);
+ Tizen.Log.Fatal("NUIWidget", "text width: " + _textLabel.NaturalSize2D.Width + ", height: " + _textLabel.NaturalSize2D.Height);
+
+ _animation = new Animation(2000);
+ _animation.AnimateTo(_textLabel, "Orientation", new Rotation(new Radian(new Degree(180.0f)), PositionAxis.Y), 0, 500);
+ _animation.AnimateTo(_textLabel, "Orientation", new Rotation(new Radian(new Degree(0.0f)), PositionAxis.Y), 500, 1000);
+ _animation.Looping = true;
+ _animation.EndAction = Animation.EndActions.Discard;
+ Log.Debug("TCT", "[TestCase][OnCreate][Widget] Pass");
+ base.OnCreate(contentInfo, window);
+ }
+
+ private bool IsEmulator()
+ {
+ string value;
+ var result = Tizen.System.Information.TryGetValue("tizen.org/system/model_name", out value);
+ if (result && value.Equals("Emulator"))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ protected override void OnPause()
+ {
+ Tizen.Log.Fatal("NUIWidget", "Widget Instance OnPause!");
+ _animation.Stop();
+ Log.Debug("TCT", "[TestCase][OnPause][Widget] Pass");
+ base.OnPause();
+ }
+
+ protected override void OnResume()
+ {
+ OnUpdate(_content.Encode(), 1);
+ Tizen.Log.Fatal("NUIWidget", "Widget Instance OnResume!");
+ Log.Debug("TCT", "[TestCase][OnResume][Widget] Pass");
+ base.OnResume();
+ }
+
+ protected override void OnResize(Window window)
+ {
+ Tizen.Log.Fatal("NUIWidget", "Widget Instance OnResize!");
+ Log.Debug("TCT", "[TestCase][OnResize][Widget] Pass");
+ base.OnResize(window);
+ }
+
+ protected override void OnTerminate(string contentInfo, TerminationType type)
+ {
+ Tizen.Log.Fatal("NUIWidget", "Widget Instance OnTerminate!");
+ Log.Debug("TCT", "[TestCase][OnTerminate][Widget] Pass");
+ base.OnTerminate(contentInfo, type);
+ }
+
+ protected override void OnUpdate(string contentInfo, int force)
+ {
+ Tizen.Log.Fatal("NUIWidget", "Widget Instance OnUpdate! " + contentInfo);
+ Bundle content = Bundle.Decode(contentInfo);
+ string imageIdx = Convert.ToString(content.GetItem("ImageIdx"));
+
+ Tizen.Log.Fatal("NUIWidget", "Widget Instance content info is " + imageIdx);
+ Log.Debug("TCT", "[TestCase][OnUpdate][Widget] Pass");
+ base.OnUpdate(contentInfo, force);
+ }
+ }
+
+ class Program : NUIWidgetApplication
+ {
+ public Program(System.Type type) : base(type)
+ {
+ }
+
+ protected override void OnCreate()
+ {
+ base.OnCreate();
+ Log.Debug("TCT", "[TestCase][OnCreate][NUIWidgetApplication] Pass");
+ }
+
+ protected override void OnLocaleChanged(LocaleChangedEventArgs e)
+ {
+ Log.Debug("TCT", "NUIWidgetApplication::OnLocaleChanged()");
+ if (e.Locale != null)
+ {
+ Log.Debug("TCT", "[Test_Properties] Locale properties is not null");
+ Log.Debug("TCT", "[Test_Properties] Current value of Locale : " + e.Locale);
+ Log.Debug("TCT", "[Test_Properties] Locale type: " + e.Locale.GetType());
+ }
+
+ Log.Debug("TCT", "[TestCase][OnLocaleChanged][NUIWidgetApplication] Pass");
+ base.OnLocaleChanged(e);
+ }
+
+ protected override void OnLowBattery(LowBatteryEventArgs e)
+ {
+ Log.Debug("TCT", "NUIWidgetApplication::OnLowBattery()");
+ if (e.LowBatteryStatus != LowBatteryStatus.None)
+ {
+ Log.Debug("TCT", "[Test_Properties] LowBatteryStatus properties is not null");
+ Log.Debug("TCT", "[Test_Properties] Current value of LowBatteryStatus : " + e.LowBatteryStatus.ToString());
+ Log.Debug("TCT", "[Test_Properties] LowBatteryStatus type: " + e.LowBatteryStatus.GetType());
+ }
+
+ Log.Debug("TCT", "[TestCase][OnLowBattery][NUIWidgetApplication] Pass");
+
+ base.OnLowBattery(e);
+ }
+
+ protected override void OnLowMemory(LowMemoryEventArgs e)
+ {
+ Log.Debug("TCT", "NUIWidgetApplication::OnLowMemory()");
+ if (e.LowMemoryStatus != LowMemoryStatus.None)
+ {
+ Log.Debug("TCT", "[Test_Properties] LowMemoryStatus properties is not null");
+ Log.Debug("TCT", "[Test_Properties] Current value of LowMemoryStatus : " + e.LowMemoryStatus.ToString());
+ Log.Debug("TCT", "[Test_Properties] LowMemoryStatus type: " + e.LowMemoryStatus.GetType());
+ }
+ //logBuilder.AppendLine("TCT [TestCase][OnLowMemory] Pass");
+ Log.Debug("TCT", "[TestCase][OnLowMemory][NUIWidgetApplication] Pass");
+
+ base.OnLowMemory(e);
+ }
+
+ protected override void OnPreCreate()
+ {
+ Log.Debug("TCT", "[TestCase][OnPreCreate][NUIWidgetApplication] Pass");
+ base.OnPreCreate();
+ }
+
+ protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
+ {
+ Log.Debug("TCT", "NUIWidgetApplication::OnRegionFormatChanged()");
+ if (e != null)
+ {
+ Log.Debug("TCT", "[Test_Properties] Region properties is not null");
+ Log.Debug("TCT", "[Test_Properties] Current value of Region : " + e.Region);
+ Log.Debug("TCT", "[Test_Properties] Region type: " + e.Region.GetType());
+ }
+
+ Log.Debug("TCT", "[TestCase][OnRegionFormatChanged][NUIWidgetApplication] Pass");
+ base.OnRegionFormatChanged(e);
+ }
+
+ protected override void OnTerminate()
+ {
+ Log.Debug("TCT", "NUIWidgetApplication::OnTerminate()");
+ Log.Debug("TCT", "[TestCase][OnTerminate][NUIWidgetApplication] Pass");
+ base.OnTerminate();
+ }
+
+ public override void Run(string[] args)
+ {
+ //Created += Created_Event_Test;
+ //AppControlReceived += AppControlReceived_Event_Test;
+ //LocaleChanged += LocaleChanged_Event_Test;
+ //LowMemory += LowMemory_Event_Test;
+ //LowBattery += LowBattery_Event_Test;
+ //Terminated += Terminated_Event_Test;
+ //Paused += EventHandlerPaused;
+ //Resumed += EventHandlerResumed;
+ //DeviceOrientationChanged += DeviceOrientationCHanged_Event_Test;
+ //RegionFormatChanged += RegionFormatChanged_Event_Test;
+
+ Log.Debug("TCT", "[TestCase][Run][NUIWidgetApplication] Pass");
+ base.Run(args);
+ }
+
+ public override void Exit()
+ {
+ Log.Debug("TCT", "[TestCase][Exit][NUIWidgetApplication] Pass");
+ base.Exit();
+ }
+
+ public void OnKeyEvent(object sender, Window.KeyEventArgs e)
+ {
+ if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "Escape"))
+ {
+ Exit();
+ }
+ }
+
+ static void Main(string[] args)
+ {
+ var app = new Program(typeof(MyWidget));
+ app.Run(args);
+ app.Exit();
+ }
+ }
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">\r
+\r
+ <PropertyGroup>\r
+ <OutputType>Exe</OutputType>\r
+ <TargetFramework>netcoreapp2.0</TargetFramework>\r
+ </PropertyGroup>\r
+\r
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+ <DebugType>portable</DebugType>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
+ <DebugType>None</DebugType>\r
+ </PropertyGroup>\r
+\r
+ <ItemGroup>\r
+ <Folder Include="lib\" />\r
+ <Folder Include="res\" />\r
+ </ItemGroup>\r
+\r
+ <ItemGroup>\r
+ <PackageReference Include="Tizen.NET" Version="5.0.0.14517" />\r
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.0.0" />\r
+ </ItemGroup>\r
+\r
+</Project>\r
+\r
--- /dev/null
+Microsoft Visual Studio Solution File, Format Version 12.00\r
+# Visual Studio 15\r
+VisualStudioVersion = 15.0.26730.10\r
+MinimumVisualStudioVersion = 10.0.40219.1\r
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WidgetApplicationSample", "WidgetApplicationSample.csproj", "{532BF9C6-251A-4118-8A7F-D16283C86EF5}"\r
+EndProject\r
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WidgetViewSample", "..\WidgetViewSample\WidgetViewSample.csproj", "{A8C5D586-35B4-4CED-9073-49A0C66C6617}"\r
+EndProject\r
+Global\r
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+ Debug|Any CPU = Debug|Any CPU\r
+ Release|Any CPU = Release|Any CPU\r
+ EndGlobalSection\r
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+ {532BF9C6-251A-4118-8A7F-D16283C86EF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {532BF9C6-251A-4118-8A7F-D16283C86EF5}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {532BF9C6-251A-4118-8A7F-D16283C86EF5}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {532BF9C6-251A-4118-8A7F-D16283C86EF5}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ {A8C5D586-35B4-4CED-9073-49A0C66C6617}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {A8C5D586-35B4-4CED-9073-49A0C66C6617}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {A8C5D586-35B4-4CED-9073-49A0C66C6617}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {A8C5D586-35B4-4CED-9073-49A0C66C6617}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ EndGlobalSection\r
+ GlobalSection(SolutionProperties) = preSolution\r
+ HideSolutionNode = FALSE\r
+ EndGlobalSection\r
+ GlobalSection(ExtensibilityGlobals) = postSolution\r
+ SolutionGuid = {1121C38F-65D0-4F7B-8097-9A363A641DF2}\r
+ EndGlobalSection\r
+EndGlobal\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="4.0" package="org.tizen.example.WidgetApplicationSample" version="1.0.0">
+ <profile name="common" />
+ <widget-application appid="org.tizen.example.WidgetApplicationSample"
+ exec="WidgetApplicationSample.dll"
+ type="dotnet"
+ main="true"
+ update-period="0">
+ <icon>WidgetApplicationSample.png</icon>
+ <label>WidgetApplicationSample</label>
+ </widget-application>
+</manifest>
--- /dev/null
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.Applications;
+using Tizen;
+
+namespace WidgetApplicationSample
+{
+ class MyWidget : Widget
+ {
+ private TextLabel _textLabel;
+ private Animation _animation;
+ private float _pointSize = 5.0f;
+ private Bundle _content;
+
+ protected override void OnCreate(string contentInfo, Window window)
+ {
+ Tizen.Log.Fatal("NUIWidget", "Widget Instance is OnCreate! " + contentInfo);
+ _content = Bundle.Decode(contentInfo);
+ string imageIdx = Convert.ToString(_content.GetItem("ImageIdx"));
+ Tizen.Log.Fatal("NUIWidget", "Widget Instance content info is " + imageIdx);
+
+ window.BackgroundColor = Color.White;
+ _textLabel = new TextLabel("Hello Widget");
+ _textLabel.TextColor = Color.Black;
+ _textLabel.Size2D = new Size2D(360, 130);
+ _textLabel.ParentOrigin = ParentOrigin.TopLeft;
+ _textLabel.PivotPoint = PivotPoint.TopLeft;
+ _textLabel.HorizontalAlignment = HorizontalAlignment.Center;
+ _textLabel.VerticalAlignment = VerticalAlignment.Center;
+ _textLabel.PositionUsesPivotPoint = true;
+ _textLabel.PointSize = _pointSize;
+ _textLabel.Position2D = new Position2D(0, 0);
+ window.Add(_textLabel);
+ Tizen.Log.Fatal("NUIWidget", "text width: " + _textLabel.NaturalSize2D.Width + ", height: " + _textLabel.NaturalSize2D.Height);
+
+ _animation = new Animation(2000);
+ _animation.AnimateTo(_textLabel, "Orientation", new Rotation(new Radian(new Degree(180.0f)), PositionAxis.Y), 0, 500);
+ _animation.AnimateTo(_textLabel, "Orientation", new Rotation(new Radian(new Degree(0.0f)), PositionAxis.Y), 500, 1000);
+ _animation.Looping = true;
+ _animation.EndAction = Animation.EndActions.Discard;
+ Log.Debug("TCT", "[TestCase][OnCreate][Widget] Pass");
+ base.OnCreate(contentInfo, window);
+ }
+
+ private bool IsEmulator()
+ {
+ string value;
+ var result = Tizen.System.Information.TryGetValue("tizen.org/system/model_name", out value);
+ if (result && value.Equals("Emulator"))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ protected override void OnPause()
+ {
+ Tizen.Log.Fatal("NUIWidget", "Widget Instance OnPause!");
+ _animation.Stop();
+ Log.Debug("TCT", "[TestCase][OnPause][Widget] Pass");
+ base.OnPause();
+ }
+
+ protected override void OnResume()
+ {
+ OnUpdate(_content.Encode(), 1);
+ Tizen.Log.Fatal("NUIWidget", "Widget Instance OnResume!");
+ Log.Debug("TCT", "[TestCase][OnResume][Widget] Pass");
+ base.OnResume();
+ }
+
+ protected override void OnResize(Window window)
+ {
+ Tizen.Log.Fatal("NUIWidget", "Widget Instance OnResize!");
+ Log.Debug("TCT", "[TestCase][OnResize][Widget] Pass");
+ base.OnResize(window);
+ }
+
+ protected override void OnTerminate(string contentInfo, TerminationType type)
+ {
+ Tizen.Log.Fatal("NUIWidget", "Widget Instance OnTerminate!");
+ Log.Debug("TCT", "[TestCase][OnTerminate][Widget] Pass");
+ base.OnTerminate(contentInfo, type);
+ }
+
+ protected override void OnUpdate(string contentInfo, int force)
+ {
+ Tizen.Log.Fatal("NUIWidget", "Widget Instance OnUpdate! " + contentInfo);
+ Bundle content = Bundle.Decode(contentInfo);
+ string imageIdx = Convert.ToString(content.GetItem("ImageIdx"));
+
+ Tizen.Log.Fatal("NUIWidget", "Widget Instance content info is " + imageIdx);
+ Log.Debug("TCT", "[TestCase][OnUpdate][Widget] Pass");
+ base.OnUpdate(contentInfo, force);
+ }
+ }
+
+ class Program : NUIWidgetApplication
+ {
+ public Program(System.Type type) : base(type)
+ {
+ }
+
+ protected override void OnCreate()
+ {
+ base.OnCreate();
+ Log.Debug("TCT", "[TestCase][OnCreate][NUIWidgetApplication] Pass");
+ }
+
+ protected override void OnLocaleChanged(LocaleChangedEventArgs e)
+ {
+ Log.Debug("TCT", "NUIWidgetApplication::OnLocaleChanged()");
+ if (e.Locale != null)
+ {
+ Log.Debug("TCT", "[Test_Properties] Locale properties is not null");
+ Log.Debug("TCT", "[Test_Properties] Current value of Locale : " + e.Locale);
+ Log.Debug("TCT", "[Test_Properties] Locale type: " + e.Locale.GetType());
+ }
+
+ Log.Debug("TCT", "[TestCase][OnLocaleChanged][NUIWidgetApplication] Pass");
+ base.OnLocaleChanged(e);
+ }
+
+ protected override void OnLowBattery(LowBatteryEventArgs e)
+ {
+ Log.Debug("TCT", "NUIWidgetApplication::OnLowBattery()");
+ if (e.LowBatteryStatus != LowBatteryStatus.None)
+ {
+ Log.Debug("TCT", "[Test_Properties] LowBatteryStatus properties is not null");
+ Log.Debug("TCT", "[Test_Properties] Current value of LowBatteryStatus : " + e.LowBatteryStatus.ToString());
+ Log.Debug("TCT", "[Test_Properties] LowBatteryStatus type: " + e.LowBatteryStatus.GetType());
+ }
+
+ Log.Debug("TCT", "[TestCase][OnLowBattery][NUIWidgetApplication] Pass");
+
+ base.OnLowBattery(e);
+ }
+
+ protected override void OnLowMemory(LowMemoryEventArgs e)
+ {
+ Log.Debug("TCT", "NUIWidgetApplication::OnLowMemory()");
+ if (e.LowMemoryStatus != LowMemoryStatus.None)
+ {
+ Log.Debug("TCT", "[Test_Properties] LowMemoryStatus properties is not null");
+ Log.Debug("TCT", "[Test_Properties] Current value of LowMemoryStatus : " + e.LowMemoryStatus.ToString());
+ Log.Debug("TCT", "[Test_Properties] LowMemoryStatus type: " + e.LowMemoryStatus.GetType());
+ }
+ //logBuilder.AppendLine("TCT [TestCase][OnLowMemory] Pass");
+ Log.Debug("TCT", "[TestCase][OnLowMemory][NUIWidgetApplication] Pass");
+
+ base.OnLowMemory(e);
+ }
+
+ protected override void OnPreCreate()
+ {
+ Log.Debug("TCT", "[TestCase][OnPreCreate][NUIWidgetApplication] Pass");
+ base.OnPreCreate();
+ }
+
+ protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
+ {
+ Log.Debug("TCT", "NUIWidgetApplication::OnRegionFormatChanged()");
+ if (e != null)
+ {
+ Log.Debug("TCT", "[Test_Properties] Region properties is not null");
+ Log.Debug("TCT", "[Test_Properties] Current value of Region : " + e.Region);
+ Log.Debug("TCT", "[Test_Properties] Region type: " + e.Region.GetType());
+ }
+
+ Log.Debug("TCT", "[TestCase][OnRegionFormatChanged][NUIWidgetApplication] Pass");
+ base.OnRegionFormatChanged(e);
+ }
+
+ protected override void OnTerminate()
+ {
+ Log.Debug("TCT", "NUIWidgetApplication::OnTerminate()");
+ Log.Debug("TCT", "[TestCase][OnTerminate][NUIWidgetApplication] Pass");
+ base.OnTerminate();
+ }
+
+ public override void Run(string[] args)
+ {
+ //Created += Created_Event_Test;
+ //AppControlReceived += AppControlReceived_Event_Test;
+ //LocaleChanged += LocaleChanged_Event_Test;
+ //LowMemory += LowMemory_Event_Test;
+ //LowBattery += LowBattery_Event_Test;
+ //Terminated += Terminated_Event_Test;
+ //Paused += EventHandlerPaused;
+ //Resumed += EventHandlerResumed;
+ //DeviceOrientationChanged += DeviceOrientationCHanged_Event_Test;
+ //RegionFormatChanged += RegionFormatChanged_Event_Test;
+
+ Log.Debug("TCT", "[TestCase][Run][NUIWidgetApplication] Pass");
+ base.Run(args);
+ }
+
+ public override void Exit()
+ {
+ Log.Debug("TCT", "[TestCase][Exit][NUIWidgetApplication] Pass");
+ base.Exit();
+ }
+
+ public void OnKeyEvent(object sender, Window.KeyEventArgs e)
+ {
+ if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "Escape"))
+ {
+ Exit();
+ }
+ }
+
+ static void Main(string[] args)
+ {
+ var app = new Program(typeof(MyWidget));
+ app.Run(args);
+ app.Exit();
+ }
+ }
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">\r
+\r
+ <PropertyGroup>\r
+ <OutputType>Exe</OutputType>\r
+ <TargetFramework>netcoreapp2.0</TargetFramework>\r
+ </PropertyGroup>\r
+\r
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+ <DebugType>portable</DebugType>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
+ <DebugType>None</DebugType>\r
+ </PropertyGroup>\r
+\r
+ <ItemGroup>\r
+ <Folder Include="lib\" />\r
+ <Folder Include="res\" />\r
+ </ItemGroup>\r
+\r
+ <ItemGroup>\r
+ <PackageReference Include="Tizen.NET" Version="5.0.0.14517" />\r
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.0.0" />\r
+ </ItemGroup>\r
+\r
+</Project>\r
+\r
--- /dev/null
+Microsoft Visual Studio Solution File, Format Version 12.00\r
+# Visual Studio 15\r
+VisualStudioVersion = 15.0.27004.2005\r
+MinimumVisualStudioVersion = 10.0.40219.1\r
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WidgetApplicationWearableSample", "WidgetApplicationWearableSample.csproj", "{532BF9C6-251A-4118-8A7F-D16283C86EF5}"\r
+EndProject\r
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WidgetViewWearableSample", "..\WidgetViewWearableSample\WidgetViewWearableSample.csproj", "{1D5E8613-6E57-4317-9737-A1B4DBEA1C0A}"\r
+EndProject\r
+Global\r
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+ Debug|Any CPU = Debug|Any CPU\r
+ Release|Any CPU = Release|Any CPU\r
+ EndGlobalSection\r
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+ {532BF9C6-251A-4118-8A7F-D16283C86EF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {532BF9C6-251A-4118-8A7F-D16283C86EF5}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {532BF9C6-251A-4118-8A7F-D16283C86EF5}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {532BF9C6-251A-4118-8A7F-D16283C86EF5}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ {1D5E8613-6E57-4317-9737-A1B4DBEA1C0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {1D5E8613-6E57-4317-9737-A1B4DBEA1C0A}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {1D5E8613-6E57-4317-9737-A1B4DBEA1C0A}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {1D5E8613-6E57-4317-9737-A1B4DBEA1C0A}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ EndGlobalSection\r
+ GlobalSection(SolutionProperties) = preSolution\r
+ HideSolutionNode = FALSE\r
+ EndGlobalSection\r
+ GlobalSection(ExtensibilityGlobals) = postSolution\r
+ SolutionGuid = {1121C38F-65D0-4F7B-8097-9A363A641DF2}\r
+ EndGlobalSection\r
+EndGlobal\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="4.0" package="org.tizen.example.WidgetApplicationWearableSample" version="1.0.0">
+ <profile name="common" />
+ <widget-application appid="org.tizen.example.WidgetApplicationWearableSample"
+ exec="WidgetApplicationWearableSample.dll"
+ type="dotnet"
+ main="true"
+ update-period="0">
+ <icon>WidgetApplicationWearableSample.png</icon>
+ <label>WidgetApplicationWearableSample</label>
+ </widget-application>
+</manifest>
--- /dev/null
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.UIComponents;
+using Tizen.Applications;
+using Tizen.Internals.Errors;
+
+namespace WidgetViewSample
+{
+ class Program : NUIApplication
+ {
+ private WidgetViewManager _viewManager = null;
+ private TableView _buttonContainer = null;
+ private WidgetView _widgetView = null;
+ private PushButton _widgetAddBtn = null;
+ private PushButton _widgetDeleteBtn = null;
+ private PushButton _widgetPauseBtn = null;
+ private PushButton _widgetResumeBtn = null;
+ private PushButton _widgetResizeBtn = null;
+ private Window _window = null;
+ private float _pointSize = 30.0f;
+
+ protected override void OnCreate()
+ {
+ base.OnCreate();
+ Initialize();
+ }
+
+ void Initialize()
+ {
+ _window = Window.Instance;
+ _window.BackgroundColor = Color.Black;
+ Tizen.Log.Fatal("NUIWidget", "ApplicationID: " + ApplicationInfo.ApplicationId);
+ float _pointSize = (1.0f / Window.Instance.Dpi.Length()) * 2000.0f;
+
+ _viewManager = new WidgetViewManager(this, ApplicationInfo.ApplicationId);
+
+ if (IsEmulator())
+ {
+ _pointSize = 5.0f;
+ }
+
+ TextLabel guide = new TextLabel();
+ guide.HorizontalAlignment = HorizontalAlignment.Center;
+ guide.VerticalAlignment = VerticalAlignment.Center;
+ guide.BackgroundColor = new Color(43.0f / 255.0f, 145.0f / 255.0f, 175.0f / 255.0f, 1.0f);
+ guide.TextColor = Color.White;
+ guide.PositionUsesPivotPoint = true;
+ guide.ParentOrigin = ParentOrigin.TopLeft;
+ guide.PivotPoint = PivotPoint.TopLeft;
+ guide.Size2D = new Size2D(_window.WindowSize.Width, 100);
+ guide.FontFamily = "Samsung One 600";
+ guide.Position2D = new Position2D(0, 0);
+ guide.MultiLine = false;
+ guide.PointSize = 15.0f;
+ guide.Text = "WidgetView Sample";
+ _window.Add(guide);
+ Tizen.Log.Fatal("NUIWidget", "Add text label");
+
+ _buttonContainer = new TableView(3, 2);
+ _buttonContainer.Size2D = new Size2D(_window.WindowSize.Width, 300);
+ _buttonContainer.ParentOrigin = ParentOrigin.BottomCenter;
+ _buttonContainer.PivotPoint = PivotPoint.BottomCenter;
+ _buttonContainer.PositionUsesPivotPoint = true;
+ _buttonContainer.SetFixedHeight(0, 100.0f);
+ _buttonContainer.SetFixedHeight(1, 100.0f);
+ _buttonContainer.SetFixedHeight(2, 100.0f);
+ _buttonContainer.Focusable = true;
+ _window.Add(_buttonContainer);
+ Tizen.Log.Fatal("NUIWidget", "Add table view");
+
+ _widgetAddBtn = new PushButton();
+ _widgetAddBtn.Label = CreateTextMap(_pointSize, "Add");
+ _widgetAddBtn.Focusable = true;
+ _widgetAddBtn.WidthResizePolicy = ResizePolicyType.FillToParent;
+ _widgetAddBtn.HeightResizePolicy = ResizePolicyType.FillToParent;
+ _widgetAddBtn.Clicked += OnAddBtnClicked;
+ Tizen.Log.Fatal("NUIWidget", "Add button add");
+
+ _widgetDeleteBtn = new PushButton();
+ _widgetDeleteBtn.Label = CreateTextMap(_pointSize, "Delete");
+ _widgetDeleteBtn.Focusable = true;
+ _widgetDeleteBtn.WidthResizePolicy = ResizePolicyType.FillToParent;
+ _widgetDeleteBtn.HeightResizePolicy = ResizePolicyType.FillToParent;
+ _widgetDeleteBtn.Clicked += OnDeleteBtnClicked;
+ Tizen.Log.Fatal("NUIWidget", "Add button delete");
+
+ _widgetPauseBtn = new PushButton();
+ _widgetPauseBtn.Label = CreateTextMap(_pointSize, "Pause");
+ _widgetPauseBtn.Focusable = true;
+ _widgetPauseBtn.WidthResizePolicy = ResizePolicyType.FillToParent;
+ _widgetPauseBtn.HeightResizePolicy = ResizePolicyType.FillToParent;
+ _widgetPauseBtn.Clicked += OnPauseBtnClicked;
+ Tizen.Log.Fatal("NUIWidget", "Add button pause");
+
+ _widgetResumeBtn = new PushButton();
+ _widgetResumeBtn.Label = CreateTextMap(_pointSize, "Resume");
+ _widgetResumeBtn.Focusable = true;
+ _widgetResumeBtn.WidthResizePolicy = ResizePolicyType.FillToParent;
+ _widgetResumeBtn.HeightResizePolicy = ResizePolicyType.FillToParent;
+ _widgetResumeBtn.Clicked += OnResumeBtnClicked;
+ Tizen.Log.Fatal("NUIWidget", "Add button resume");
+
+ _widgetResizeBtn = new PushButton();
+ _widgetResizeBtn.Label = CreateTextMap(_pointSize, "Resize");
+ _widgetResizeBtn.Focusable = true;
+ _widgetResizeBtn.WidthResizePolicy = ResizePolicyType.FillToParent;
+ _widgetResizeBtn.HeightResizePolicy = ResizePolicyType.FillToParent;
+ _widgetResizeBtn.Clicked += OnResizeBtnClicked;
+ Tizen.Log.Fatal("NUIWidget", "Add button Resize");
+
+ _buttonContainer.AddChild(_widgetAddBtn, new TableView.CellPosition(0, 0));
+ _buttonContainer.AddChild(_widgetPauseBtn, new TableView.CellPosition(0, 1));
+ _buttonContainer.AddChild(_widgetResumeBtn, new TableView.CellPosition(1, 0));
+ _buttonContainer.AddChild(_widgetDeleteBtn, new TableView.CellPosition(1, 1));
+ _buttonContainer.AddChild(_widgetResizeBtn, new TableView.CellPosition(2, 0));
+
+ FocusManager.Instance.PreFocusChange += OnPreFocusChange;
+ FocusManager.Instance.SetCurrentFocusView(_buttonContainer);
+
+ Window.Instance.KeyEvent += AppBack;
+ }
+
+ /// <summary>
+ /// This Application will be exited when back key entered.
+ /// </summary>
+ /// <param name="source">Window.Instance</param>
+ /// <param name="e">event</param>
+ private void AppBack(object source, Window.KeyEventArgs e)
+ {
+ if (e.Key.State == Key.StateType.Down)
+ {
+ Tizen.Log.Info("Key", e.Key.KeyPressedName);
+ if (e.Key.KeyPressedName == "XF86Back")
+ {
+ this.Exit();
+ }
+ }
+ }
+ private PropertyMap CreateTextMap(float pointSize, string text)
+ {
+ PropertyMap map = new PropertyMap();
+ map.Insert("visualType", new PropertyValue("TEXT"));
+ map.Insert("pointSize", new PropertyValue(pointSize));
+ map.Insert("text", new PropertyValue(text));
+ return map;
+ }
+
+ private bool IsEmulator()
+ {
+ string value;
+ var result = Tizen.System.Information.TryGetValue("tizen.org/system/model_name", out value);
+ if (result && value.Equals("Emulator"))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ // Callback for KeyboardFocusManager
+ private View OnPreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e)
+ {
+ if (!e.ProposedView && !e.CurrentView)
+ {
+ e.ProposedView = _buttonContainer.GetChildAt(1);
+ }
+ return e.ProposedView;
+ }
+
+ private bool OnAddBtnClicked(object source, EventArgs e)
+ {
+ if (_widgetView == null)
+ {
+ Tizen.Log.Fatal("NUIWidget", "Widget view will creat!");
+
+ Bundle bundle = new Bundle();
+ bundle.AddItem("ImageIdx", "1");
+
+ _widgetView = _viewManager.AddWidget("org.tizen.example.WidgetApplicationSample", bundle.Encode(), 600, 400, 0);
+ _widgetView.WidgetContentUpdated += OnWidgetContentUpdated;
+ _widgetView.Size2D = new Size2D(600, 400);
+ _widgetView.ParentOrigin = ParentOrigin.Center;
+ _widgetView.PivotPoint = PivotPoint.Center;
+ _widgetView.Position2D = new Position2D(-300, -200);
+ _widgetView.PositionUsesPivotPoint = true;
+ _window.Add(_widgetView);
+
+ _widgetView.Size2D = new Size2D(550, 370);
+
+ Tizen.Log.Fatal("NUIWidget", "widget view WidgetID: " + _widgetView.WidgetID);
+ Tizen.Log.Fatal("NUIWidget", "widget view InstanceID: " + _widgetView.InstanceID);
+ Tizen.Log.Fatal("NUIWidget", "widget view ContentInfo: " + _widgetView.ContentInfo);
+ Tizen.Log.Fatal("NUIWidget", "widget view Title: " + _widgetView.Title);
+ Tizen.Log.Fatal("NUIWidget", "widget view UpdatePeriod: " + _widgetView.UpdatePeriod);
+
+ AddEventHandler();
+ }
+ Tizen.Log.Fatal("NUIWidget", "Widget view has been created!");
+
+ return true;
+ }
+
+ private void OnWidgetContentUpdated(object sender, WidgetView.WidgetViewEventArgs e)
+ {
+ Tizen.Log.Fatal("NUIWidget", "Widget view content updated triggered");
+ string updatedContent = e.WidgetView.ContentInfo;
+ Bundle content = Bundle.Decode(updatedContent);
+ string imageIdx = Convert.ToString(content.GetItem("ImageIdx"));
+
+ Tizen.Log.Fatal("NUIWidget", "Get content string " + imageIdx);
+ }
+
+ private bool OnDeleteBtnClicked(object source, EventArgs e)
+ {
+ if (_widgetView != null)
+ {
+ Tizen.Log.Fatal("NUIWidget", "Widget view will delete!");
+ _window.Remove(_widgetView);
+ Tizen.Log.Fatal("NUIWidget", "Widget view will delete111111111!");
+ _widgetView.TerminateWidget();
+ Tizen.Log.Fatal("NUIWidget", "Widget view will delete22222222222!");
+
+ _widgetView.Dispose();
+ _widgetView = null;
+ }
+ Tizen.Log.Fatal("NUIWidget", "Widget view has been removed!");
+ return true;
+ }
+
+ private bool OnResumeBtnClicked(object source, EventArgs e)
+ {
+ if (_widgetView != null)
+ {
+ _widgetView.ResumeWidget();
+ }
+ Tizen.Log.Fatal("NUIWidget", "Widget view has been resumed!");
+ return true;
+ }
+
+
+ private bool OnPauseBtnClicked(object source, EventArgs e)
+ {
+ if (_widgetView != null)
+ {
+ _widgetView.PauseWidget();
+ }
+ Tizen.Log.Fatal("NUIWidget", "Widget view has been paused!");
+ return true;
+ }
+
+ private bool OnResizeBtnClicked(object source, EventArgs e)
+ {
+ if (_widgetView != null)
+ {
+ _widgetView.Size2D = new Size2D(300, 200);
+ }
+ Tizen.Log.Fatal("NUIWidget", "Widget view has been resized!");
+ return true;
+ }
+
+ private void AddEventHandler()
+ {
+ if (_widgetView != null)
+ {
+ _widgetView.WidgetAdded += (src, arg) => {
+ Tizen.Log.Fatal("NUIWidget", "Widget view added triggered");
+ };
+
+ _widgetView.WidgetDeleted += (src, arg) => {
+ Tizen.Log.Fatal("NUIWidget", "Widget view deleted triggered");
+ };
+
+ _widgetView.WidgetCreationAborted += (src, arg) => {
+ Tizen.Log.Fatal("NUIWidget", "Widget view creation aborted triggered");
+ };
+
+
+ _widgetView.WidgetUpdatePeriodChanged += (src, arg) => {
+ Tizen.Log.Fatal("NUIWidget", "Widget view update periodChanged triggered");
+ };
+
+ _widgetView.WidgetFaulted += (src, arg) => {
+ Tizen.Log.Fatal("NUIWidget", "Widget view faulted triggered");
+ };
+ }
+ }
+
+ static void Main(string[] args)
+ {
+ var app = new Program();
+ app.Run(args);
+ }
+ }
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">\r
+\r
+ <PropertyGroup>\r
+ <OutputType>Exe</OutputType>\r
+ <TargetFramework>netcoreapp2.0</TargetFramework>\r
+ </PropertyGroup>\r
+\r
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+ <DebugType>portable</DebugType>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
+ <DebugType>None</DebugType>\r
+ </PropertyGroup>\r
+\r
+ <ItemGroup>\r
+ <Folder Include="lib\" />\r
+ <Folder Include="res\" />\r
+ </ItemGroup>\r
+\r
+ <ItemGroup>\r
+ <PackageReference Include="Tizen.NET" Version="5.0.0.14517" />\r
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.0.0" />\r
+ </ItemGroup>\r
+\r
+</Project>\r
+\r
--- /dev/null
+Microsoft Visual Studio Solution File, Format Version 12.00\r
+# Visual Studio 15\r
+VisualStudioVersion = 15.0.27004.2009\r
+MinimumVisualStudioVersion = 10.0.40219.1\r
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WidgetViewSample", "WidgetViewSample.csproj", "{A8C5D586-35B4-4CED-9073-49A0C66C6617}"\r
+EndProject\r
+Global\r
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+ Debug|Any CPU = Debug|Any CPU\r
+ Release|Any CPU = Release|Any CPU\r
+ EndGlobalSection\r
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+ {A8C5D586-35B4-4CED-9073-49A0C66C6617}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {A8C5D586-35B4-4CED-9073-49A0C66C6617}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {A8C5D586-35B4-4CED-9073-49A0C66C6617}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {A8C5D586-35B4-4CED-9073-49A0C66C6617}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ EndGlobalSection\r
+ GlobalSection(SolutionProperties) = preSolution\r
+ HideSolutionNode = FALSE\r
+ EndGlobalSection\r
+ GlobalSection(ExtensibilityGlobals) = postSolution\r
+ SolutionGuid = {3E9072E7-525A-4C54-A9F8-635519A3A183}\r
+ EndGlobalSection\r
+EndGlobal\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest package="org.tizen.example.WidgetViewSample" version="1.0.0" api-version="4" xmlns="http://tizen.org/ns/packages">
+ <profile name="common" />
+ <ui-application appid="org.tizen.example.WidgetViewSample" exec="WidgetViewSample.dll" multiple="false" nodisplay="false" taskmanage="true" splash-screen-display="true" type="dotnet" launch_mode="single">
+ <label>WidgetViewSample</label>
+ <icon>WidgetViewSample.png</icon>
+ <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
+ </ui-application>
+ <shortcut-list />
+ <privileges>
+ <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+ </privileges>
+ <provides-appdefined-privileges />
+</manifest>
--- /dev/null
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.UIComponents;
+using Tizen.Applications;
+
+namespace WidgetViewSample
+{
+ class Program : NUIApplication
+ {
+ private WidgetViewManager _viewManager = null;
+ private WidgetView _widgetView = null;
+ private PushButton _widgetAddBtn = null;
+ private PushButton _widgetDeleteBtn = null;
+ private PushButton _widgetPauseBtn = null;
+ private PushButton _widgetResumeBtn = null;
+ private PushButton _widgetResizeBtn = null;
+
+ private Window _window = null;
+ private float _pointSize = 4.0f;
+ private View _buttons = null;
+
+ protected override void OnCreate()
+ {
+ base.OnCreate();
+ Initialize();
+ }
+
+ void Initialize()
+ {
+ _window = Window.Instance;
+ _window.BackgroundColor = Color.Black;
+ Tizen.Log.Fatal("NUIWidget", "ApplicationID: " + ApplicationInfo.ApplicationId);
+
+ _viewManager = new WidgetViewManager(this, ApplicationInfo.ApplicationId);
+
+ _buttons = new View();
+ _buttons.Size2D = new Size2D(220, 60);
+ _buttons.Position2D = new Position2D(0, 200);
+ _buttons.ParentOrigin = ParentOrigin.TopLeft;
+ _buttons.PivotPoint = PivotPoint.TopLeft;
+
+ _window.Add(_buttons);
+
+ _widgetAddBtn = new PushButton();
+ _widgetAddBtn.Label = CreateTextMap(_pointSize, "Add");
+ _widgetAddBtn.Size2D = new Size2D(80, 30);
+ _widgetAddBtn.Position2D = new Position2D(-60, 0);
+ _widgetAddBtn.Clicked += OnAddBtnClicked;
+ _buttons.Add(_widgetAddBtn);
+ Tizen.Log.Fatal("NUIWidget", "Add button add");
+
+ _widgetDeleteBtn = new PushButton();
+ _widgetDeleteBtn.Label = CreateTextMap(_pointSize, "Delete");
+ _widgetDeleteBtn.Size2D = new Size2D(80, 30);
+ _widgetDeleteBtn.Position2D = new Position2D(-10, 52);
+ _widgetDeleteBtn.Clicked += OnDeleteBtnClicked;
+ _buttons.Add(_widgetDeleteBtn);
+ Tizen.Log.Fatal("NUIWidget", "Add button delete");
+
+ _widgetPauseBtn = new PushButton();
+ _widgetPauseBtn.Label = CreateTextMap(_pointSize, "Pause");
+ _widgetPauseBtn.Size2D = new Size2D(80, 30);
+ _widgetPauseBtn.Position2D = new Position2D(35, 0);
+ _widgetPauseBtn.Focusable = true;
+ _widgetPauseBtn.Clicked += OnPauseBtnClicked;
+ _buttons.Add(_widgetPauseBtn);
+ Tizen.Log.Fatal("NUIWidget", "Add button pause");
+
+ _widgetResumeBtn = new PushButton();
+ _widgetResumeBtn.Label = CreateTextMap(_pointSize, "Resume");
+ _widgetResumeBtn.Size2D = new Size2D(80, 30);
+ _widgetResumeBtn.Position2D = new Position2D(130, 0);
+ _widgetResumeBtn.Focusable = true;
+ _widgetResumeBtn.Clicked += OnResumeBtnClicked;
+ _buttons.Add(_widgetResumeBtn);
+ Tizen.Log.Fatal("NUIWidget", "Add button resume");
+
+ _widgetResizeBtn = new PushButton();
+ _widgetResizeBtn.Label = CreateTextMap(_pointSize, "Resize");
+ _widgetResizeBtn.Size2D = new Size2D(80, 30);
+ _widgetResizeBtn.Position2D = new Position2D(80, 52);
+ _widgetResizeBtn.Focusable = true;
+ _widgetResizeBtn.Clicked += OnResizeBtnClicked;
+ _buttons.Add(_widgetResizeBtn);
+ Tizen.Log.Fatal("NUIWidget", "Add button resume");
+
+ Window.Instance.KeyEvent += AppBack;
+ }
+
+ /// <summary>
+ /// This Application will be exited when back key entered.
+ /// </summary>
+ /// <param name="source">Window.Instance</param>
+ /// <param name="e">event</param>
+ private void AppBack(object source, Window.KeyEventArgs e)
+ {
+ if (e.Key.State == Key.StateType.Down)
+ {
+ Tizen.Log.Info("Key", e.Key.KeyPressedName);
+ if (e.Key.KeyPressedName == "XF86Back")
+ {
+ this.Exit();
+ }
+ }
+ }
+ private PropertyMap CreateTextMap(float pointSize, string text)
+ {
+ PropertyMap map = new PropertyMap();
+ map.Insert(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text));
+ map.Insert((int)TextVisualProperty.Text, new PropertyValue(text));
+ map.Insert((int)TextVisualProperty.PointSize, new PropertyValue(pointSize));
+ map.Insert((int)TextVisualProperty.VerticalAlignment, new PropertyValue("BOTTOM"));
+ return map;
+ }
+
+ private bool IsEmulator()
+ {
+ string value;
+ var result = Tizen.System.Information.TryGetValue("tizen.org/system/model_name", out value);
+ if (result && value.Equals("Emulator"))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ private bool OnAddBtnClicked(object source, EventArgs e)
+ {
+ if (_widgetView == null)
+ {
+ Tizen.Log.Fatal("NUIWidget", "Widget view will creat!");
+ Bundle bundle = new Bundle();
+ bundle.AddItem("ImageIdx", "1");
+ string content = bundle.Encode();
+ Tizen.Log.Fatal("NUIWidget", "Will send content string " + content);
+
+ _widgetView = _viewManager.AddWidget("org.tizen.example.WidgetApplicationWearableSample", content, 360, 130, 0);
+ _widgetView.WidgetContentUpdated += OnWidgetContentUpdated;
+ _widgetView.Size2D = new Size2D(360, 130);
+ _widgetView.ParentOrigin = ParentOrigin.TopLeft;
+ _widgetView.PivotPoint = PivotPoint.TopLeft;
+ _widgetView.Position2D = new Position2D(0, 50);
+ _widgetView.PositionUsesPivotPoint = true;
+ _window.Add(_widgetView);
+
+ _widgetView.Size2D = new Size2D(360, 130);
+
+ Tizen.Log.Fatal("NUIWidget", "widget view WidgetID: " + _widgetView.WidgetID);
+ Tizen.Log.Fatal("NUIWidget", "widget view InstanceID: " + _widgetView.InstanceID);
+ Tizen.Log.Fatal("NUIWidget", "widget view ContentInfo: " + _widgetView.ContentInfo);
+ Tizen.Log.Fatal("NUIWidget", "widget view Title: " + _widgetView.Title);
+ Tizen.Log.Fatal("NUIWidget", "widget view UpdatePeriod: " + _widgetView.UpdatePeriod);
+
+ AddEventHandler();
+ }
+ Tizen.Log.Fatal("NUIWidget", "Widget view has been created!");
+
+ return true;
+ }
+
+ private void OnWidgetContentUpdated(object sender, WidgetView.WidgetViewEventArgs e)
+ {
+ Tizen.Log.Fatal("NUIWidget", "Widget view content updated triggered");
+ string updatedContent = e.WidgetView.ContentInfo;
+ Bundle content = Bundle.Decode(updatedContent);
+ string imageIdx = Convert.ToString(content.GetItem("ImageIdx"));
+
+ Tizen.Log.Fatal("NUIWidget", "Get content string " + imageIdx);
+ }
+
+ private bool OnDeleteBtnClicked(object source, EventArgs e)
+ {
+ if (_widgetView != null)
+ {
+ Tizen.Log.Fatal("NUIWidget", "Widget view will delete!");
+ _window.Remove(_widgetView);
+ Tizen.Log.Fatal("NUIWidget", "Widget view will delete111111111!");
+ _widgetView.TerminateWidget();
+ Tizen.Log.Fatal("NUIWidget", "Widget view will delete22222222222!");
+
+ _widgetView.Dispose();
+ _widgetView = null;
+ }
+ Tizen.Log.Fatal("NUIWidget", "Widget view has been removed!");
+ return true;
+ }
+
+ private bool OnResumeBtnClicked(object source, EventArgs e)
+ {
+ if (_widgetView != null)
+ {
+ _widgetView.ResumeWidget();
+ }
+ Tizen.Log.Fatal("NUIWidget", "Widget view has been resumed!");
+
+ return true;
+ }
+
+ private bool OnPauseBtnClicked(object source, EventArgs e)
+ {
+ if (_widgetView != null)
+ {
+ _widgetView.PauseWidget();
+ }
+ Tizen.Log.Fatal("NUIWidget", "Widget view has been paused!");
+ return true;
+ }\r
+\r
+ private bool OnResizeBtnClicked(object source, EventArgs e)
+ {
+ if (_widgetView != null)
+ {
+ _widgetView.Size2D = new Size2D(360, 80);
+ }
+ Tizen.Log.Fatal("NUIWidget", "Widget view has been resized!");
+
+ return true;
+ }
+ private void AddEventHandler()
+ {
+ if (_widgetView != null)
+ {
+ _widgetView.WidgetAdded += (src, arg) => {
+ Tizen.Log.Fatal("NUIWidget", "Widget view added triggered");
+ };
+
+ _widgetView.WidgetDeleted += (src, arg) => {
+ Tizen.Log.Fatal("NUIWidget", "Widget view deleted triggered");
+ };
+
+ _widgetView.WidgetCreationAborted += (src, arg) => {
+ Tizen.Log.Fatal("NUIWidget", "Widget view creation aborted triggered");
+ };
+
+
+ _widgetView.WidgetUpdatePeriodChanged += (src, arg) => {
+ Tizen.Log.Fatal("NUIWidget", "Widget view update periodChanged triggered");
+ };
+
+ _widgetView.WidgetFaulted += (src, arg) => {
+ Tizen.Log.Fatal("NUIWidget", "Widget view faulted triggered");
+ };
+ }
+ }
+
+ static void Main(string[] args)
+ {
+ var app = new Program();
+ app.Run(args);
+ }
+ }
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">\r
+\r
+ <PropertyGroup>\r
+ <OutputType>Exe</OutputType>\r
+ <TargetFramework>netcoreapp2.0</TargetFramework>\r
+ </PropertyGroup>\r
+\r
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+ <DebugType>portable</DebugType>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
+ <DebugType>None</DebugType>\r
+ </PropertyGroup>\r
+\r
+ <ItemGroup>\r
+ <Folder Include="lib\" />\r
+ <Folder Include="res\" />\r
+ </ItemGroup>\r
+\r
+ <ItemGroup>\r
+ <PackageReference Include="Tizen.NET" Version="5.0.0.14517" />\r
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.0.0" />\r
+ </ItemGroup>\r
+\r
+</Project>\r
+\r
--- /dev/null
+Microsoft Visual Studio Solution File, Format Version 12.00\r
+# Visual Studio 15\r
+VisualStudioVersion = 15.0.27004.2005\r
+MinimumVisualStudioVersion = 10.0.40219.1\r
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WidgetViewWearableSample", "WidgetViewWearableSample.csproj", "{13CD7B5F-A4C9-40DA-A564-1FB6880FCFFB}"\r
+EndProject\r
+Global\r
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+ Debug|Any CPU = Debug|Any CPU\r
+ Release|Any CPU = Release|Any CPU\r
+ EndGlobalSection\r
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+ {13CD7B5F-A4C9-40DA-A564-1FB6880FCFFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {13CD7B5F-A4C9-40DA-A564-1FB6880FCFFB}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {13CD7B5F-A4C9-40DA-A564-1FB6880FCFFB}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {13CD7B5F-A4C9-40DA-A564-1FB6880FCFFB}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ EndGlobalSection\r
+ GlobalSection(SolutionProperties) = preSolution\r
+ HideSolutionNode = FALSE\r
+ EndGlobalSection\r
+ GlobalSection(ExtensibilityGlobals) = postSolution\r
+ SolutionGuid = {3E9072E7-525A-4C54-A9F8-635519A3A183}\r
+ EndGlobalSection\r
+EndGlobal\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest package="org.tizen.example.WidgetViewWearableSample" version="1.0.0" api-version="4" xmlns="http://tizen.org/ns/packages">
+ <profile name="common" />
+ <ui-application appid="org.tizen.example.WidgetViewWearableSample" exec="WidgetViewWearableSample.dll" multiple="false" nodisplay="false" taskmanage="true" splash-screen-display="true" type="dotnet" launch_mode="single">
+ <label>WidgetViewWearableSample</label>
+ <icon>WidgetViewWearableSample.png</icon>
+ <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
+ </ui-application>
+ <shortcut-list />
+ <privileges>
+ <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+ </privileges>
+ <provides-appdefined-privileges />
+</manifest>
doneButton.LeftFocusableView = run;
//To show all the test case information(Number _className._TCName [result]).
- _initList = new TableView(10, 1);
+ _initList = new TableView(12, 2);
_initList.Focusable = true;
_initList.CellPadding = new Vector2(30, 30);
- _initList.Size2D = new Size2D(Window.Instance.Size.Width - 50, 700);
+ _initList.Size2D = new Size2D(Window.Instance.Size.Width - 50, 800);
_initList.ParentOrigin = Position.ParentOriginTopLeft;
_initList.PivotPoint = PivotPoint.TopLeft;
_initList.Position = new Position(0.0f, 0.0f, 0.0f);
run.DownFocusableView = _initList;
_initList.UpFocusableView = run;
-
_firstPageContainer = new TableView(2, 2);
_firstPageContainer.PivotPoint = Position.PivotPointTopLeft;
_firstPageContainer.ParentOrigin = Position.ParentOriginTopLeft;
void InitializeDetailPage()
{
- _detailList = new TableView(20, 1);
+ _detailList = new TableView(23, 1);
_detailList.Focusable = true;
_detailList.Size2D = new Size2D(Window.Instance.Size.Width - 50, 500);
_detailList.ParentOrigin = Position.ParentOriginTopLeft;
private void CreateInitList()
{
- buttonList = new PushButton[20];
+ buttonList = new PushButton[26];
int tcNum = _tcIDList.Count;
+ Tizen.Log.Fatal("NUI", "_tcIDList.Count: " + _tcIDList.Count);
for (int index = 0; index < tcNum; index++)
{
string name = _tcIDList[index];
FocusManager.Instance.SetCurrentFocusView(runButton);
return false;
};
- _initList.AddChild(buttonList[index], new TableView.CellPosition((uint)index, 0));
+ uint row = (uint)(index / 2);
+ uint column = (uint)(index % 2);
+ _initList.AddChild(buttonList[index], new TableView.CellPosition(row, column));
}
}
ResultNumber.Block += 1;
}
- _initList.RemoveChildAt(new TableView.CellPosition((uint)CurrentTCNum, 0));
+ //_initList.RemoveChildAt(new TableView.CellPosition((uint)CurrentTCNum, 0));
+ uint row = (uint)(CurrentTCNum / 2);
+ uint column = (uint)(CurrentTCNum % 2);
+ _initList.RemoveChildAt(new TableView.CellPosition(row, column));
string name = _tcIDList[CurrentTCNum];
string testcaseName = "#." + (CurrentTCNum + 1).ToString() + name;
string resultText = "[" + _listItem[(int)CurrentTCNum].Result + "]";
FocusManager.Instance.SetCurrentFocusView(runButton);
return false;
};
-
- _initList.AddChild(button, new TableView.CellPosition((uint)CurrentTCNum, 0));
+ //_initList.AddChild(button, new TableView.CellPosition((uint)CurrentTCNum, 0));
+ _initList.AddChild(button, new TableView.CellPosition(row, column));
SetSummaryResult();
notRun.Text = _listItem[CurrentTCNum].Result;
}
label.VerticalAlignment = VerticalAlignment.Center;
label.ParentOrigin = ParentOrigin.TopLeft;
label.PivotPoint = PivotPoint.TopLeft;
- label.Size2D = new Size2D(30, _scrollHeight);
+ label.Size2D = new Size2D(40, _scrollHeight);
label.Position2D = new Position2D(0, 0);
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+using System;
+using System.Threading.Tasks;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.UIComponents;
+using Tizen.Applications;
+
+namespace Tizen.NUI.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.NUIWidgetApplication test")]
+ public class NUIWidgetApplicationTests
+ {
+ private ManualTestNUI _testPage;
+ private WearableManualTestNUI _wearTestPage;
+ private float _pointSize = 5.0f;
+ private bool _isMobile = false;
+ private bool _isWearable = false;
+ private bool _isEmulator = false;
+
+ [SetUp]
+ public void Init()
+ {
+ LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
+ _isMobile = ManualTest.IsMobile();
+ _isWearable = ManualTest.IsWearable();
+ _isEmulator = ManualTest.IsEmulator();
+ AppControl myAppControl = new AppControl();
+ myAppControl.Operation = AppControlOperations.Default;
+ if(ManualTest.IsWearable())
+ {
+ myAppControl.ApplicationId = "org.tizen.example.WidgetViewWearableSample";
+ }
+ else
+ {
+ myAppControl.ApplicationId = "org.tizen.example.WidgetViewSample";
+ }
+ AppControl.SendLaunchRequest(myAppControl);
+
+ if (Window.Instance.Size.Width > 1000)
+ {
+ _pointSize = 20.0f;
+ }
+
+ if(ManualTest.IsWearable())
+ {
+ _pointSize = 4.0f;
+ _wearTestPage = WearableManualTestNUI.GetInstance();
+ }
+ else
+ {
+ _testPage = ManualTestNUI.GetInstance();
+ }
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");
+ }
+
+ private void Confirm()
+ {
+ ManualTest.Confirm();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MANUAL TEST : OnCreate() should be called after launch app.")]
+ [Property("SPEC", "Tizen.NUI.NUIWidgetApplication.OnCreate M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
+ [Precondition(1, "Open terminal to view logs")]
+ [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")]
+ [Precondition(3, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
+ [Step(1, "Click run TC.")]
+ [Step(2, "Move Focus to Add button and click, then return from the widget sample.")]
+ [Step(3, "Check if log show \"[TestCase][OnCreate][NUIWidgetApplication] Pass\".")]
+ [Postcondition(1, "NA")]
+ public async Task OnCreate_MANUAL_TEST()
+ {
+
+ await ManualTest.WaitForConfirm();
+
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MANUAL TEST : OnLocaleChanged() should be called after change Language of device")]
+ [Property("SPEC", "Tizen.NUI.NUIWidgetApplication.OnLocaleChanged M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
+ [Precondition(1, "Open terminal to view logs.")]
+ [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")]
+ [Precondition(3, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
+ [Step(1, "Click run TC")]
+ [Step(2, "Move Focus to Add button and click.")]
+ [Step(3, "Press Home hardkey -> Setting app -> change language -> return to app test -> wait in 20s")]
+ [Step(4, "Check if log show \"[TestCase][OnLocaleChanged][NUIWidgetApplication] Pass\".")]
+ [Postcondition(1, "Close the terminal")]
+ public async Task OnLocaleChanged_MANUAL_TEST()
+ {
+ /* TEST CODE */
+ if (_isEmulator)
+ {
+ Confirm();
+ return;
+ }
+ else
+ {
+ /* TEST CODE */
+ await ManualTest.WaitForConfirm();
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MANUAL TEST : OnLowBattery() should be called normally after launch app")]
+ [Property("SPEC", "Tizen.NUI.NUIWidgetApplication.OnLowBattery M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
+ [Precondition(1, "This test can be tested only in mobile emulator now.")]
+ [Precondition(2, "Open terminal to view logs.")]
+ [Precondition(3, "Enter command \"sdb dlog -c\" to clear log")]
+ [Precondition(4, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
+ [Precondition(5, "Right click on the mobile emulator and Click ControlPanel")]
+ [Step(1, "Click run TC")]
+ [Step(2, "Move Focus to Add button and click.")]
+ [Step(3, "Find and click Battery button in Emulator Control Panel")]
+ [Step(4, "Click level bar to make it under 3%")]
+ [Step(5, "If it is on TV(Emulator or kantM target), or Wearable, just make it pass")]
+ [Step(6, "Check if log show \"[TestCase][OnLowBattery][NUIWidgetApplication] Pass\".")]
+ [Postcondition(1, "Close the terminal")]
+ public async Task OnLowBattery_MANUAL_TEST()
+ {
+ if (!_isMobile || !_isEmulator)
+ {
+ Confirm();
+ return;
+ }
+ else
+ {
+ /* TEST CODE */
+ await ManualTest.WaitForConfirm();
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MANUAL TEST : OnLowMemory() should be called normally after launch app")]
+ [Property("SPEC", "Tizen.NUI.NUIWidgetApplication.OnLowMemory M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
+ [Precondition(1, "This test can be tested only in mobile emulator now.")]
+ [Precondition(2, "Open terminal to view logs.")]
+ [Precondition(3, "Enter command \"sdb dlog -c\" to clear log")]
+ [Precondition(4, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
+ [Precondition(5, "Right click on the mobile emulator and Click ControlPanel")]
+ [Step(1, "Click run TC")]
+ [Step(2, "Move Focus to Add button and click.")]
+ [Step(3, "Find and click Memory button in Emulator Control Panel")]
+ [Step(4, "If it is on TV(Emulator or kantM target), or Wearable, just make it pass")]
+ [Step(5, "Select Soft Warning button")]
+ [Step(6, "Check if log show \"[TestCase][OnLowMemory][NUIWidgetApplication] Pass\".")]
+ [Step(7, "Select Hard Warning button")]
+ [Step(8, "Check if log show \"[TestCase][OnLowMemory][NUIWidgetApplication] Pass\".")]
+ [Postcondition(1, "Close the terminal")]
+ public async Task OnLowMemory_MANUAL_TEST()
+ {
+ if (!_isMobile || !_isEmulator)
+ {
+ Confirm();
+ return;
+ }
+ else
+ {
+ /* TEST CODE */
+ await ManualTest.WaitForConfirm();
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MANUAL TEST : OnPreCreate() should be called after launch app")]
+ [Property("SPEC", "Tizen.NUI.NUIWidgetApplication.OnPreCreate M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
+ [Precondition(1, "Open terminal to view logs.")]
+ [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")]
+ [Precondition(3, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
+ [Step(1, "Click run TC")]
+ [Step(2, "Move Focus to Add button and click, then return from the widget sample.")]
+ [Step(3, "Check if log show \"[TestCase][OnPreCreate][NUIWidgetApplication] Pass\".")]
+ [Postcondition(1, "Close the terminal")]
+ public async Task OnPreCreate_MANUAL_TEST()
+ {
+ await ManualTest.WaitForConfirm();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MANUAL TEST : OnRegionFormatChanged() should be called after change Language of device")]
+ [Property("SPEC", "Tizen.NUI.NUIWidgetApplication.OnRegionFormatChanged M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
+ [Precondition(1, "Open terminal to view logs.")]
+ [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")]
+ [Precondition(3, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
+ [Step(1, "Click run TC")]
+ [Step(2, "Move Focus to Add button and click.")]
+ [Step(3, "[mobile] Press Home hardkey -> Setting app -> change language -> return to app test -> wait in 20s")]
+ [Step(4, "[TV profile] Press Home key -> Settings -> System -> Location -> change location -> return to app test -> wait in 20s")]
+ [Step(5, "[TV profile] if there is no \"Location\" menu, this test can not be tested. Please click \"Pass\" button if \"Location\" menu doesn't exist.")]
+ [Step(6, "[TV profile] Please just make it pass")]
+ [Step(7, "Check if log show \"[TestCase][OnRegionFormatChanged][NUIWidgetApplication] Pass\".")]
+ [Postcondition(1, "Close the terminal")]
+ public async Task OnRegionFormatChanged_MANUAL_TEST()
+ {
+ /* TEST CODE */
+ await ManualTest.WaitForConfirm();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MANUAL TEST : OnTerminate() should be called after call Exit()")]
+ [Property("SPEC", "Tizen.NUI.NUIWidgetApplication.OnTerminate M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
+ [Precondition(1, "Open terminal to view logs.")]
+ [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")]
+ [Precondition(3, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
+ [Step(1, "Click run TC")]
+ [Step(2, "Move Focus to Add button and click.")]
+ [Step(3, "Click the delete button and return from the widget sample.")]
+ [Step(4, "Check if log show \"[TestCase][OnTerminate][NUIWidgetApplication] Pass\".")]
+ [Postcondition(1, "Close the terminal")]
+ public async Task OnTerminate_MANUAL_TEST()
+ {
+ /* TEST CODE */
+ await ManualTest.WaitForConfirm();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MANUAL TEST : Exit() method should be excuted normally")]
+ [Property("SPEC", "Tizen.NUI.NUIWidgetApplication.Exit M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
+ [Precondition(1, "Open terminal to view logs.")]
+ [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")]
+ [Precondition(3, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
+ [Step(1, "Click run TC")]
+ [Step(2, "Move Focus to Add button and click.")]
+ [Step(3, "Click the delete button and return from the widget sample.")]
+ [Step(4, "Check if log show \"[TestCase][Exit][NUIWidgetApplication] Pass\".")]
+ [Postcondition(1, "Close the terminal")]
+ public async Task Exit_MANUAL_TEST()
+ {
+ /* TEST CODE */
+ await ManualTest.WaitForConfirm();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MANUAL TEST : when launch Application, Run() method should be called")]
+ [Property("SPEC", "Tizen.NUI.NUIWidgetApplication.Run M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
+ [Precondition(1, "Open terminal to view logs.")]
+ [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")]
+ [Precondition(3, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
+ [Step(1, "Click run TC")]
+ [Step(2, "Move Focus to Add button and click, then return from the widget sample.")]
+ [Step(3, "Check if log show \"[TestCase][Run][NUIWidgetApplication] Pass\".")]
+ [Postcondition(1, "Close the terminal")]
+ public async Task Run_MANUAL_TEST()
+ {
+ /* TEST CODE */
+ await ManualTest.WaitForConfirm();
+ }
+
+ }
+}
+
+
+
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+using System;
+using System.Threading.Tasks;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.UIComponents;
+using Tizen.Applications;
+
+namespace Tizen.NUI.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Widget test")]
+ public class WidgetTests
+ {
+ private ManualTestNUI _testPage;
+ private WearableManualTestNUI _wearTestPage;
+ private float _pointSize = 5.0f;
+
+ [SetUp]
+ public void Init()
+ {
+ LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
+
+ AppControl myAppControl = new AppControl();
+ myAppControl.Operation = AppControlOperations.Default;
+ if (ManualTest.IsWearable())
+ {
+ myAppControl.ApplicationId = "org.tizen.example.WidgetViewWearableSample";
+ }
+ else
+ {
+ myAppControl.ApplicationId = "org.tizen.example.WidgetViewSample";
+ }
+ AppControl.SendLaunchRequest(myAppControl);
+
+ if (Window.Instance.Size.Width > 1000)
+ {
+ _pointSize = 20.0f;
+ }
+
+ if(ManualTest.IsWearable())
+ {
+ _pointSize = 4.0f;
+ _wearTestPage = WearableManualTestNUI.GetInstance();
+ }
+ else
+ {
+ _testPage = ManualTestNUI.GetInstance();
+ }
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MANUAL TEST : OnCreate() should be called after launch app.")]
+ [Property("SPEC", "Tizen.NUI.Widget.OnCreate M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
+ [Precondition(1, "Open terminal to view logs")]
+ [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")]
+ [Precondition(3, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
+ [Step(1, "Click run TC.")]
+ [Step(2, "Move Focus to Add button and click, then return from the widget sample.")]
+ [Step(3, "Check if log show \"[TestCase][OnCreate][Widget] Pass\".")]
+ [Postcondition(1, "NA")]
+ public async Task OnCreate_MANUAL_TEST()
+ {
+
+ await ManualTest.WaitForConfirm();
+
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MANUAL TEST : OnPause() should be called after launch app, and pause app.")]
+ [Property("SPEC", "Tizen.NUI.Widget.OnPause M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
+ [Precondition(1, "Open terminal to view logs")]
+ [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")]
+ [Precondition(3, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
+ [Step(1, "Click run TC.")]
+ [Step(2, "Move Focus to Add button and click.")]
+ [Step(3, "Move Focus to Pause button and click, then return from the widget sample.")]
+ [Step(4, "Check if log show \"[TestCase][OnPause][Widget] Pass\".")]
+ [Postcondition(1, "Close the terminal")]
+ public async Task OnPause_MANUAL_TEST()
+ {
+ await ManualTest.WaitForConfirm();
+
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MANUAL TEST : OnResize() should be called after launch app, and pause app.")]
+ [Property("SPEC", "Tizen.NUI.Widget.OnResize M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
+ [Precondition(1, "Open terminal to view logs")]
+ [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")]
+ [Precondition(3, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
+ [Step(1, "Click run TC.")]
+ [Step(2, "Move Focus to Add button and click.")]
+ [Step(3, "Move Focus to Resize button and click, then return from the widget sample.")]
+ [Step(4, "Check if log show \"[TestCase][OnResize][Widget] Pass\".")]
+ [Postcondition(1, "Close the terminal")]
+ public async Task OnResize_MANUAL_TEST()
+ {
+ await ManualTest.WaitForConfirm();
+
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MANUAL TEST : OnResume() should be called after launch app, pause app, and resume app.")]
+ [Property("SPEC", "Tizen.NUI.Widget.OnResume M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
+ [Precondition(1, "Open terminal to view logs")]
+ [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")]
+ [Precondition(3, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
+ [Step(1, "Click run TC.")]
+ [Step(2, "Move Focus to Add button and click.")]
+ [Step(3, "Move Focus to Pause button and click.")]
+ [Step(4, "Move Focus to Resume button and click, then return from the widget sample.")]
+ [Step(5, "Check if log show \"[TestCase][OnResume][Widget] Pass\".")]
+ [Postcondition(1, "Close the terminal")]
+ public async Task OnResume_MANUAL_TEST()
+ {
+ await ManualTest.WaitForConfirm();
+
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MANUAL TEST : OnTerminate() should be called after call Exit().")]
+ [Property("SPEC", "Tizen.NUI.Widget.OnTerminate M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
+ [Precondition(1, "Open terminal to view logs")]
+ [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")]
+ [Precondition(3, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
+ [Step(1, "Click run TC.")]
+ [Step(2, "Move Focus to Add button and click.")]
+ [Step(3, "Move Focus to Delete button and click, then return from the widget sample.")]
+ [Step(4, "Check if log show \"[TestCase][OnTerminate][Widget] Pass\".")]
+ [Postcondition(1, "Close the terminal")]
+ public async Task OnTerminate_MANUAL_TEST()
+ {
+ await ManualTest.WaitForConfirm();
+
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MANUAL TEST : OnUpdate() should be called after call Exit().")]
+ [Property("SPEC", "Tizen.NUI.Widget.OnUpdate M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
+ [Precondition(1, "Open terminal to view logs")]
+ [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")]
+ [Precondition(3, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
+ [Step(1, "Click run TC.")]
+ [Step(2, "Move Focus to Add button and click.")]
+ [Step(3, "Check if log show \"[TestCase][OnUpdate][Widget] Pass\".")]
+ [Postcondition(1, "Close the terminal")]
+ public async Task OnUpdate_MANUAL_TEST()
+ {
+ await ManualTest.WaitForConfirm();
+ }
+
+ }
+}
+
+
+