[NUI] Load default theme in preload
authorJiyun Yang <ji.yang@samsung.com>
Tue, 24 Nov 2020 03:11:31 +0000 (12:11 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Thu, 26 Nov 2020 08:19:50 +0000 (17:19 +0900)
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
src/Tizen.NUI/src/public/NUIApplication.cs
src/Tizen.NUI/src/public/Theme/ThemeManager.cs

index eda6321..a716327 100755 (executable)
@@ -384,6 +384,7 @@ namespace Tizen.NUI
         static public void PreLoad()
         {
             Interop.Application.Application_PreInitialize();
+            ThemeManager.EnsureDefaultTheme();
         }
 
         /// <summary>
index 027400e..34c98e9 100755 (executable)
@@ -98,12 +98,7 @@ namespace Tizen.NUI
         {
             get
             {
-                if (defaultTheme == null && !isLoadingDefault)
-                {
-                    isLoadingDefault = true;
-                    defaultTheme = LoadBuiltinTheme(profileDefaultTheme[(int)CurrentProfile]);
-                    isLoadingDefault = false;
-                }
+                EnsureDefaultTheme();
                 return defaultTheme;
             }
             set => defaultTheme = (Theme)value?.Clone();
@@ -302,6 +297,16 @@ namespace Tizen.NUI
             return (Theme)result?.Clone();
         }
 
+        internal static void EnsureDefaultTheme()
+        {
+            if (defaultTheme == null && !isLoadingDefault)
+            {
+                isLoadingDefault = true;
+                defaultTheme = LoadBuiltinTheme(profileDefaultTheme[(int)CurrentProfile]);
+                isLoadingDefault = false;
+            }
+        }
+
         private static Theme LoadBuiltinTheme(string id)
         {
             var loaded = new Theme()