From d1dbf6d0b68f6a490b2e842fd446ab517b110f86 Mon Sep 17 00:00:00 2001 From: "dongsug.song" Date: Tue, 2 May 2017 12:49:35 +0900 Subject: [PATCH] ViewRegistryHelper class is moved to Application side - ViewRegistryHelper class is only required for the application which uses Dali json theme/style Builder - ViewRegistryHelper uses C# System.Runtime library and this causes some delay at launching time (ex: KantM board, 300ms delay) - This is not needed for all application (no need to included in NUI) so it is moved to application side. Conflicts: NUISamples/NUISamples/NUISamples.TizenTV/examples/Main.cs Change-Id: I5ee38801a1f81991f9d6e76a0cbaa6b59d4a3d4f Signed-off-by: dongsug.song --- NUISamples/NUISamples/NUISamples.TizenTV/NUISamples.TizenTV.csproj | 3 ++- NUISamples/NUISamples/NUISamples.TizenTV/examples/Main.cs | 6 +++--- .../examples/date-picker-using-json}/ViewRegistryHelper.cs | 7 ++++--- .../{ => date-picker-using-json}/date-picker-using-json.cs | 4 +++- src/Tizen.NUI/Tizen.NUI.csproj | 1 - src/Tizen.NUI/src/internal/Application.cs | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) rename {src/Tizen.NUI/src/internal => NUISamples/NUISamples/NUISamples.TizenTV/examples/date-picker-using-json}/ViewRegistryHelper.cs (66%) rename NUISamples/NUISamples/NUISamples.TizenTV/examples/{ => date-picker-using-json}/date-picker-using-json.cs (97%) diff --git a/NUISamples/NUISamples/NUISamples.TizenTV/NUISamples.TizenTV.csproj b/NUISamples/NUISamples/NUISamples.TizenTV/NUISamples.TizenTV.csproj index 7526a1e..e122bf7 100755 --- a/NUISamples/NUISamples/NUISamples.TizenTV/NUISamples.TizenTV.csproj +++ b/NUISamples/NUISamples/NUISamples.TizenTV/NUISamples.TizenTV.csproj @@ -58,7 +58,7 @@ - + @@ -72,6 +72,7 @@ + diff --git a/NUISamples/NUISamples/NUISamples.TizenTV/examples/Main.cs b/NUISamples/NUISamples/NUISamples.TizenTV/examples/Main.cs index f7992b7..3a0c2f0 100755 --- a/NUISamples/NUISamples/NUISamples.TizenTV/examples/Main.cs +++ b/NUISamples/NUISamples/NUISamples.TizenTV/examples/Main.cs @@ -15,8 +15,8 @@ namespace NUISamples.TizenTV.examples static void Main(string[] args) { //new ControlDashboard.Example().Run(args); //o - new DatePickerTest.Example().Run(args); //o - //new DatePickerUsingJson.Example().Run(args); //o + //new DatePickerTest.Example().Run(args); //o + new DatePickerUsingJson.Example().Run(args); //o //new HelloTest.Example().Run(args); //o //new HelloWorldTest.Example().Run(args); //o //new Test1.Example().Run(args); //o @@ -29,7 +29,7 @@ namespace NUISamples.TizenTV.examples //new DaliTest.Example().Run(args); //o //new RelativeVectorTest.Example().Run(args); //new VisaulAnimationExample.Example().Run(args); - new VisaulAnimationExample.Example2().Run(args); + //new VisaulAnimationExample.Example2().Run(args); //new VisualViewTest.Example().Run(args); //o //new VisualViewTest2.VisualSample().Run(args); //new VisualViewTest3.Example().Run(args); //o diff --git a/src/Tizen.NUI/src/internal/ViewRegistryHelper.cs b/NUISamples/NUISamples/NUISamples.TizenTV/examples/date-picker-using-json/ViewRegistryHelper.cs similarity index 66% rename from src/Tizen.NUI/src/internal/ViewRegistryHelper.cs rename to NUISamples/NUISamples/NUISamples.TizenTV/examples/date-picker-using-json/ViewRegistryHelper.cs index 6df88e5..95a86d8 100755 --- a/src/Tizen.NUI/src/internal/ViewRegistryHelper.cs +++ b/NUISamples/NUISamples/NUISamples.TizenTV/examples/date-picker-using-json/ViewRegistryHelper.cs @@ -1,14 +1,15 @@ using System; +using Tizen.NUI; -// include all custom views here which will be -namespace Tizen.NUI + +namespace DatePickerUsingJson { public class ViewRegistryHelper { static public void Initialize() { // Register all views with the type registry - System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (typeof(Tizen.NUI.Spin).TypeHandle); + System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (typeof(Spin).TypeHandle); } } } diff --git a/NUISamples/NUISamples/NUISamples.TizenTV/examples/date-picker-using-json.cs b/NUISamples/NUISamples/NUISamples.TizenTV/examples/date-picker-using-json/date-picker-using-json.cs similarity index 97% rename from NUISamples/NUISamples/NUISamples.TizenTV/examples/date-picker-using-json.cs rename to NUISamples/NUISamples/NUISamples.TizenTV/examples/date-picker-using-json/date-picker-using-json.cs index d810898..fcd1b29 100755 --- a/NUISamples/NUISamples/NUISamples.TizenTV/examples/date-picker-using-json.cs +++ b/NUISamples/NUISamples/NUISamples.TizenTV/examples/date-picker-using-json/date-picker-using-json.cs @@ -46,8 +46,10 @@ namespace DatePickerUsingJson Stage stage = Stage.Instance; stage.BackgroundColor = Color.White; - // load date JSON template... + //This is required for the Application which uses JSON theme and style of Dali builder + ViewRegistryHelper.Initialize(); + // load date JSON template... _builder = new Builder (); // Optional constant to see logging information coming out diff --git a/src/Tizen.NUI/Tizen.NUI.csproj b/src/Tizen.NUI/Tizen.NUI.csproj index 9d88869..07bed33 100755 --- a/src/Tizen.NUI/Tizen.NUI.csproj +++ b/src/Tizen.NUI/Tizen.NUI.csproj @@ -287,7 +287,6 @@ - diff --git a/src/Tizen.NUI/src/internal/Application.cs b/src/Tizen.NUI/src/internal/Application.cs index 89de23b..5188882 100755 --- a/src/Tizen.NUI/src/internal/Application.cs +++ b/src/Tizen.NUI/src/internal/Application.cs @@ -1104,7 +1104,7 @@ namespace Tizen.NUI LOG(" NewApplication(string stylesheet, Application.WindowMode windowMode) is called! "); // register all Views with the type registry, so that can be created / styled via JSON - ViewRegistryHelper.Initialize(); + //ViewRegistryHelper.Initialize(); //moved to Application side. Application ret = New(1, stylesheet, windowMode); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); -- 2.7.4