Modifies Svace issues 14/141014/1
authorHyerim Kim <rimi.kim@samsung.com>
Thu, 27 Jul 2017 12:39:09 +0000 (21:39 +0900)
committerHyerim Kim <rimi.kim@samsung.com>
Thu, 27 Jul 2017 12:39:09 +0000 (21:39 +0900)
Change-Id: Ic2cb93ae4ca0133ff13683bd5eb334d70ef4bc9d
Signed-off-by: Hyerim Kim <rimi.kim@samsung.com>
TVMediaHub/TVMediaHub.Tizen/Models/ContentProvider.cs
TVMediaHub/TVMediaHub.Tizen/Models/ImageProvider.cs
TVMediaHub/TVMediaHub.Tizen/Utils/NinePatchImageRenderer.cs
TVMediaHub/TVMediaHub.Tizen/Views/ImageGroup.xaml.cs
TVMediaHub/TVMediaHub.Tizen/Views/ImageItem.xaml.cs
TVMediaHub/TVMediaHub.Tizen/Views/MusicGroup.xaml.cs
TVMediaHub/TVMediaHub.Tizen/Views/VideoGroup.xaml.cs

index 264090d..e4d9e71 100755 (executable)
@@ -164,18 +164,18 @@ namespace TVMediaHub.Tizen.Models
 
                     break;
                 case SortOption.Album:
-                    if (lastGroupItem == null || lastGroupItem.Title != (mediaInformationEx.MediaContentInformation as AudioInformation).Album)
+                    if (lastGroupItem == null || lastGroupItem.Title != (mediaInformationEx.MediaContentInformation as AudioInformation)?.Album)
                     {
                         newGroupFlag = true;
-                        newTitle = (mediaInformationEx.MediaContentInformation as AudioInformation).Album.ToString();
+                        newTitle = (mediaInformationEx.MediaContentInformation as AudioInformation)?.Album.ToString();
                     }
 
                     break;
                 case SortOption.Artist:
-                    if (lastGroupItem == null || lastGroupItem.Title != (mediaInformationEx.MediaContentInformation as AudioInformation).Artist)
+                    if (lastGroupItem == null || lastGroupItem.Title != (mediaInformationEx.MediaContentInformation as AudioInformation)?.Artist)
                     {
                         newGroupFlag = true;
-                        newTitle = (mediaInformationEx.MediaContentInformation as AudioInformation).Artist.ToString();
+                        newTitle = (mediaInformationEx.MediaContentInformation as AudioInformation)?.Artist.ToString();
                     }
 
                     break;
index ea3aa87..3651963 100755 (executable)
@@ -53,7 +53,7 @@ namespace TVMediaHub.Tizen.Models
                 // Check 1 : The size of the image file must be less than 4MB.
                 var fileInfo = new FileInfo(mediaContent.MediaContentInformation.FilePath);
 
-                if (fileInfo != null && fileInfo.Length > 8 * 1024 * 1024)
+                if (fileInfo?.Length > 8 * 1024 * 1024)
                 {
                     DbgPort.D(mediaContent.MediaContentInformation.DisplayName + ": This content is not available");
                     mediaContent.IsAvailable = false;
index b494f0a..fa13d4d 100755 (executable)
@@ -66,7 +66,10 @@ namespace TVMediaHub.Tizen.Utils
         private void UpdateImageColor()
         {
             var img = Element as NinePatch;
-            Control.Color = new ElmSharp.Color(Convert.ToInt32(img.ImageColor.R * 255), Convert.ToInt32(img.ImageColor.G * 255), Convert.ToInt32(img.ImageColor.B * 255), Convert.ToInt32(img.ImageColor.A * 255));
+            if (Control != null)
+            {
+                Control.Color = new ElmSharp.Color(Convert.ToInt32(img.ImageColor.R * 255), Convert.ToInt32(img.ImageColor.G * 255), Convert.ToInt32(img.ImageColor.B * 255), Convert.ToInt32(img.ImageColor.A * 255));
+            }
         }
 
         /// <summary>
@@ -75,7 +78,7 @@ namespace TVMediaHub.Tizen.Utils
         void UpdateBorder()
         {
             var img = Element as NinePatch;
-            Control.SetBorder(img.BorderLeft, img.BorderRight, img.BorderTop, img.BorderBottom);
+            Control?.SetBorder(img.BorderLeft, img.BorderRight, img.BorderTop, img.BorderBottom);
         }
 
         /// <summary>
index 6d539eb..c09f90a 100755 (executable)
@@ -167,7 +167,7 @@ namespace TVMediaHub.Tizen.Views
                             length: 167,
                             finished: (v2, IsCanceled2) =>
                             {
-                                if (!IsCanceled)
+                                if (!IsCanceled2)
                                 {
                                     GroupTitle.TextColor = Color.FromRgba(0, 129, 198, 255);
                                 }
index 39cb993..f9633c3 100755 (executable)
@@ -338,7 +338,7 @@ namespace TVMediaHub.Tizen.Views
             var x = this.X;
             var y = this.Y;
             var parent = (VisualElement)this.Parent;
-            while (parent != null && parent.Parent.GetType() == typeof(VisualElement))
+            while (parent != null && parent.Parent?.GetType() == typeof(VisualElement))
             {
                 x += parent.X;
                 y += parent.Y;
index d4b06a0..54e93d4 100755 (executable)
@@ -332,7 +332,7 @@ namespace TVMediaHub.Tizen.Views
                             length: 167,
                             finished: (v2, IsCanceled2) =>
                             {
-                                if (!IsCanceled)
+                                if (!IsCanceled2)
                                 {
                                     GroupTitle.TextColor = Color.FromRgba(0, 129, 198, 255);
                                 }
index 204d1e9..1e30a31 100755 (executable)
@@ -190,7 +190,7 @@ namespace TVMediaHub.Tizen.Views
                             length: 167,
                             finished: (v2, IsCanceled2) =>
                             {
-                                if (!IsCanceled)
+                                if (!IsCanceled2)
                                 {
                                     GroupTitle.TextColor = Color.FromRgba(0, 129, 198, 255);
                                 }