[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>
Thu, 3 Dec 2020 07:37:45 +0000 (16:37 +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 c216372e43c386aa544442c0153f7723ee646a5d..2cf360d948f652a02b5093fb854bbc627579514c 100755 (executable)
@@ -697,7 +697,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,
@@ -706,7 +706,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 e81df9ce80d5c2509a157f1bae9049f8298eebf0..033e51c185639446dc833971015c0caf69df6d8e 100644 (file)
@@ -309,7 +309,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)]