[NUI] Fix not to get framework path via StyleManager
authorJiyun Yang <ji.yang@samsung.com>
Thu, 3 Dec 2020 07:31:21 +0000 (16:31 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 8 Dec 2020 06:23:12 +0000 (15:23 +0900)
StyleManager uses dali singleton service which is not initialized in PreLoad().
Previously in Preload(), ThemeManager got framework resource path via static constant in StyleManager,
which leaded to initialize StyleManager instance that is not valid in PreLoad().

So this patch moved framework resource path constant to the constant file.

Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
src/Tizen.NUI.Components/Controls/ScrollableBase.cs
src/Tizen.NUI.Wearable/src/public/WearableStyle/CircularPaginationStyle.cs
src/Tizen.NUI/src/public/NUIConstants.cs
src/Tizen.NUI/src/public/StyleManager.cs
src/Tizen.NUI/src/public/Theme/ThemeManager.cs
src/Tizen.NUI/src/public/Xaml/MarkupExtensions/NUIResourcePathExtension.cs

index e5fe965ea81250005f4401fb9d0fadf0db466ad7..2ce075b4075c43415418fb77387616580d1231ee 100755 (executable)
@@ -642,7 +642,7 @@ namespace Tizen.NUI.Components
             //Show vertical shadow on the top (or bottom) of the scrollable when panning down (or up).
             verticalTopShadowView = new View
             {
-                BackgroundImage = Tizen.NUI.StyleManager.FrameworkResourcePath + "nui_component_default_scroll_over_shooting_top.png",
+                BackgroundImage = Tizen.NUI.FrameworkInformation.ResourcePath + "nui_component_default_scroll_over_shooting_top.png",
                 Opacity = 1.0f,
                 SizeHeight = 0.0f,
                 PositionUsesPivotPoint = true,
@@ -651,7 +651,7 @@ namespace Tizen.NUI.Components
             };
             verticalBottomShadowView = new View
             {
-                BackgroundImage = Tizen.NUI.StyleManager.FrameworkResourcePath + "nui_component_default_scroll_over_shooting_bottom.png",
+                BackgroundImage = Tizen.NUI.FrameworkInformation.ResourcePath + "nui_component_default_scroll_over_shooting_bottom.png",
                 Opacity = 1.0f,
                 SizeHeight = 0.0f,
                 PositionUsesPivotPoint = true,
index 7a3d8a518f96df985f96e9cf6929bed9fcc000d7..8d47b68b68f6d8d4a175585f9bb435a4e456644b 100755 (executable)
@@ -130,13 +130,13 @@ namespace Tizen.NUI.Wearable
             IndicatorSize = new Size(10, 10);
             IndicatorImageURL = new Selector<string>()
             {
-                Normal = Tizen.NUI.StyleManager.FrameworkResourcePath + "nui_component_default_pagination_normal_dot.png",
-                Selected = Tizen.NUI.StyleManager.FrameworkResourcePath + "nui_component_default_pagination_focus_dot.png",
+                Normal = Tizen.NUI.FrameworkInformation.ResourcePath + "nui_component_default_pagination_normal_dot.png",
+                Selected = Tizen.NUI.FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
             };
             CenterIndicatorImageURL = new Selector<string>()
             {
-                Normal = Tizen.NUI.StyleManager.FrameworkResourcePath + "nui_wearable_circular_pagination_center_normal_dot.png",
-                Selected = Tizen.NUI.StyleManager.FrameworkResourcePath + "nui_wearable_circular_pagination_center_focus_dot.png",
+                Normal = Tizen.NUI.FrameworkInformation.ResourcePath + "nui_wearable_circular_pagination_center_normal_dot.png",
+                Selected = Tizen.NUI.FrameworkInformation.ResourcePath + "nui_wearable_circular_pagination_center_focus_dot.png",
             };
         }
     }
index 93fbcdd7bb6eefa67b6628aad675d04b5432b613..178d165df765b74d530ba6d9699fd65805e7bed6 100755 (executable)
@@ -1805,4 +1805,13 @@ namespace Tizen.NUI
         /// </summary>
         NoThirdParty
     }
+
+    /// <summary>
+    /// TODO This is to get TizenFX resource path. It needs to be fixed to use application framework API in the future.
+    /// Internal use only. Do not open this API.
+    /// </summary>
+    internal struct FrameworkInformation
+    {
+        public readonly static string ResourcePath = "/usr/share/dotnet.tizen/framework/res/";
+    }
 }
index c045b27850ecbc9f33b05ed6d91017d16a706ee7..2484c1f2cc83c3aad2ee10f74ba71258b6cab9e0 100755 (executable)
@@ -36,13 +36,6 @@ namespace Tizen.NUI
         private EventHandler<StyleChangedEventArgs> _styleManagerStyleChangedEventHandler;
         private StyleChangedCallbackDelegate _styleManagerStyleChangedCallbackDelegate;
 
-        /// <summary>
-        /// Internal use only. Do not open this API.
-        /// This is to get TizenFX resource path. It needs to be fixed to use application framework API in the future.
-        /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public readonly static string FrameworkResourcePath = "/usr/share/dotnet.tizen/framework/res/";
-
         /// <summary>
         /// Creates a StyleManager handle.<br />
         /// This can be initialized with StyleManager::Get().<br />
index 34c98e9e678075ab6a653a2b84ee31ad46601511..90ec77e9622152ebddecc3dd2d022e9ff2b1ba3d 100755 (executable)
@@ -318,7 +318,7 @@ namespace Tizen.NUI
 
             foreach (var project in nuiThemeProjects)
             {
-                string path = StyleManager.FrameworkResourcePath + "/Theme/" + project + "_" + id + ".xaml";
+                string path = FrameworkInformation.ResourcePath + "/Theme/" + project + "_" + id + ".xaml";
 
                 if (!File.Exists(path))
                 {
index 08e622bc0477cf9ca000739e7319409299d49935..00bd6c358e819f0834040e6131c0b9b232d7d38b 100644 (file)
@@ -22,7 +22,7 @@ namespace Tizen.NUI.Xaml
 
         /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public string ProvideValue(IServiceProvider serviceProvider) => StyleManager.FrameworkResourcePath + FilePath;
+        public string ProvideValue(IServiceProvider serviceProvider) => FrameworkInformation.ResourcePath + FilePath;
 
         /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]