[NUI] Fix View.BackgroundImage getter and View.ImageSyncronousLoading to support...
authorJiyun Yang <ji.yang@samsung.com>
Thu, 27 Aug 2020 05:52:32 +0000 (14:52 +0900)
committerGitHub <noreply@github.com>
Thu, 27 Aug 2020 05:52:32 +0000 (14:52 +0900)
Previous code, it didn't work for other visuals except ImageVisual.

Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
Co-authored-by: WonYoung Choi <wy80.choi@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs
src/Tizen.NUI/src/public/BaseComponents/ViewSelectorData.cs

index 8b27138..29e716b 100755 (executable)
@@ -2215,15 +2215,11 @@ namespace Tizen.NUI.BaseComponents
             set
             {
                 _backgroundImageSynchronosLoading = value;
-                string bgUrl = "";
-                int visualType = 0;
-                Background.Find(Visual.Property.Type)?.Get(out visualType);
-                if (visualType == (int)Visual.Type.Image)
-                {
-                    Background.Find(ImageVisualProperty.URL)?.Get(out bgUrl);
-                }
 
-                if (bgUrl.Length != 0)
+                string bgUrl = null;
+                Background.Find(ImageVisualProperty.URL)?.Get(out bgUrl);
+
+                if (!string.IsNullOrEmpty(bgUrl))
                 {
                     PropertyMap bgMap = this.Background;
                     bgMap.Add("synchronousLoading", new PropertyValue(_backgroundImageSynchronosLoading));
index a0493bb..72540a6 100755 (executable)
@@ -155,12 +155,7 @@ namespace Tizen.NUI.BaseComponents
             string backgroundImage = "";
 
             Tizen.NUI.PropertyMap background = view.Background;
-            int visualType = 0;
-            background.Find(Visual.Property.Type)?.Get(out visualType);
-            if ((visualType == (int)Visual.Type.Image) || (visualType == (int)Visual.Type.NPatch))
-            {
-                background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage);
-            }
+            background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage);
 
             return backgroundImage;
         });
index a977e65..35e83e4 100644 (file)
@@ -38,17 +38,9 @@ namespace Tizen.NUI.BaseComponents
         });
         public TriggerableSelector<string> BackgroundImage { get; } = new TriggerableSelector<string>(View.BackgroundImageProperty, delegate(View view)
         {
-            var background = view.Background;
-            int visualType = 0;
-            background.Find(Visual.Property.Type)?.Get(out visualType);
-
-            if ((visualType == (int)Visual.Type.Image) || (visualType == (int)Visual.Type.NPatch))
-            {
-                string backgroundImage = "";
-                background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage);
-                return backgroundImage;
-            }
-            return null;
+            string backgroundImage = null;
+            view.Background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage);
+            return backgroundImage;
         });
         public TriggerableSelector<Rectangle> BackgroundImageBorder { get; } = new TriggerableSelector<Rectangle>(View.BackgroundImageBorderProperty);
         public TriggerableSelector<Color> Color { get; } = new TriggerableSelector<Color>(View.ColorProperty, delegate(View view)