summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEunyoung Lee <ey928.lee@samsung.com>2022-10-01 15:57:55 +0900
committerEunyoung Lee <ey928.lee@samsung.com>2022-10-01 15:57:55 +0900
commitcd7dacb94f27a65e1d414dec73ff9638d903046f (patch)
tree291d52caea42b66a3252f4d99e89fd420b0eb1e0
parentd33ab8d205a3cc3316a2570e07d5f8283fbabe18 (diff)
parent22231df5c96ac80cf1ad765c94fd1b5a194d60ef (diff)
downloadtray-cd7dacb94f27a65e1d414dec73ff9638d903046f.tar.gz
tray-cd7dacb94f27a65e1d414dec73ff9638d903046f.tar.bz2
tray-cd7dacb94f27a65e1d414dec73ff9638d903046f.zip
Merge branch 'tizen' of ssh://review.tizen.org:29418/profile/iot/apps/dotnet/tray into tizen
Change-Id: I08ba657defd69a0c18c64c3189539729dd5a0563
-rwxr-xr-xApps/Models/AppInfoModel.cs35
-rwxr-xr-x[-rw-r--r--]Apps/ViewManager.cs1
-rwxr-xr-xApps/ViewModels/AppInfoViewModel.cs8
-rwxr-xr-x[-rw-r--r--]Apps/ViewModels/AppViewModel.cs5
-rwxr-xr-x[-rw-r--r--]Apps/Views/AppView.cs5
-rwxr-xr-xApps/Views/CustomBorder.cs8
-rw-r--r--TrayApplication/Models/AppInfoModel.cs2
-rwxr-xr-xpackaging/org.tizen.Apps-1.0.0.tpkbin59571 -> 59745 bytes
-rwxr-xr-xpackaging/org.tizen.TrayApplication-1.0.0.tpkbin5481668 -> 5481683 bytes
9 files changed, 37 insertions, 27 deletions
diff --git a/Apps/Models/AppInfoModel.cs b/Apps/Models/AppInfoModel.cs
index e7a301a..2c7949b 100755
--- a/Apps/Models/AppInfoModel.cs
+++ b/Apps/Models/AppInfoModel.cs
@@ -1,12 +1,14 @@
using System;
using System.Collections.Generic;
using Tizen.NUI;
-using Tizen.Applications;
using Apps.Common;
namespace Apps.Models
{
class AppInfoModel : PropertyNotifier
- {
+ {
+ private ImageVisual defaultVisual;
+ private GradientVisual gradientVisual;
+
public AppInfoModel(string name, string applicationId, string url)
{
Name = name;
@@ -35,25 +37,23 @@ namespace Apps.Models
set => SetProperty(ref iconBackground, value);
}
- private void SetDefaultBackground()
+ private void SetDefaultImageVisual()
{
- ImageVisual imageVisual = new ImageVisual()
+ defaultVisual = new ImageVisual()
{
URL = Resources.GetImagePath() + "default_gradient.png",
};
- IconBackground = imageVisual.OutputVisualMap;
}
- private void SetGradientBackground(PropertyArray stopColor)
+ private void SetGradientVisual(PropertyArray stopColor)
{
- GradientVisual gradientVisual = new GradientVisual()
+ gradientVisual = new GradientVisual()
{
StartPosition = new Vector2(0.0f, -1.0f),
EndPosition = new Vector2(0.0f, 1.0f),
StopColor = stopColor,
SpreadMethod = GradientVisualSpreadMethodType.Pad,
};
- IconBackground = gradientVisual.OutputVisualMap;
}
private PropertyArray GetGradientStopColors(Palette palette)
@@ -124,13 +124,26 @@ namespace Apps.Models
if (stopColor.Count() < 2)
{
Tizen.Log.Info(Resources.LogTag, "Palette or palatte values not valid, adding default gradient");
- SetDefaultBackground();
+ SetDefaultImageVisual();
+ IconBackground = defaultVisual.OutputVisualMap;
}
else
{
- Tizen.Log.Info(Resources.LogTag, "setting palette color");
- SetGradientBackground(stopColor);
+ Tizen.Log.Info(Resources.LogTag, "setting palette color");
+ SetGradientVisual(stopColor);
+ IconBackground = gradientVisual.OutputVisualMap;
}
}
+
+ ~AppInfoModel()
+ {
+ Tizen.Log.Info(Resources.LogTag, "Clearing NUI PropertyMap resources");
+ defaultVisual?.Dispose();
+ defaultVisual = null;
+ gradientVisual?.Dispose();
+ gradientVisual = null;
+ IconBackground?.Dispose();
+ IconBackground = null;
+ }
}
}
diff --git a/Apps/ViewManager.cs b/Apps/ViewManager.cs
index 468ec1a..29b7a3e 100644..100755
--- a/Apps/ViewManager.cs
+++ b/Apps/ViewManager.cs
@@ -6,7 +6,6 @@ using System.IO;
using Tizen.NUI;
using Tizen.NUI.Xaml;
using Tizen.Applications;
-using Tizen.NUI;
using Apps.Common;
using Apps.ViewModels;
using Apps.Views;
diff --git a/Apps/ViewModels/AppInfoViewModel.cs b/Apps/ViewModels/AppInfoViewModel.cs
index 797cac0..5db5d6d 100755
--- a/Apps/ViewModels/AppInfoViewModel.cs
+++ b/Apps/ViewModels/AppInfoViewModel.cs
@@ -14,11 +14,15 @@ namespace Apps.ViewModels
}
public void CreateData(IEnumerable<ApplicationInfo> list)
- {
+ {
Clear();
+ if (list == null)
+ {
+ return;
+ }
foreach (ApplicationInfo appInfo in list)
{
- if (string.IsNullOrEmpty(appInfo.IconPath))
+ if (appInfo == null || string.IsNullOrEmpty(appInfo.IconPath))
{
continue;
}
diff --git a/Apps/ViewModels/AppViewModel.cs b/Apps/ViewModels/AppViewModel.cs
index 9e088c7..870a76a 100644..100755
--- a/Apps/ViewModels/AppViewModel.cs
+++ b/Apps/ViewModels/AppViewModel.cs
@@ -1,12 +1,9 @@
-using System;
-using System.Collections;
+using System.Collections;
using System.Collections.Generic;
-using System.Text;
using System.Windows.Input;
using Tizen.Applications;
using Tizen.NUI.Binding;
using Apps.Common;
-using Apps.Models;
namespace Apps.ViewModels
{
diff --git a/Apps/Views/AppView.cs b/Apps/Views/AppView.cs
index dd98864..ff905a8 100644..100755
--- a/Apps/Views/AppView.cs
+++ b/Apps/Views/AppView.cs
@@ -1,5 +1,4 @@
-using System.Collections;
-using System.Windows.Input;
+using System.Windows.Input;
using Tizen.NUI;
using Tizen.NUI.Components;
using Tizen.NUI.BaseComponents;
@@ -40,7 +39,7 @@ namespace Apps.Views
return item;
});
Header = GetHeader();
- this.SetBinding(CollectionView.ItemsSourceProperty, "AppListSource");
+ this.SetBinding(ItemsSourceProperty, "AppListSource");
this.SetBinding(AppSelectCommandProperty, "AppSelectCommand");
SelectionChanged += OnAppSelection;
diff --git a/Apps/Views/CustomBorder.cs b/Apps/Views/CustomBorder.cs
index 0cecea8..41c43bc 100755
--- a/Apps/Views/CustomBorder.cs
+++ b/Apps/Views/CustomBorder.cs
@@ -1,11 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Tizen;
-using Tizen.NUI;
-using Tizen.NUI.Components;
+using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Apps.Common;
+
namespace Apps.Views
{
class CustomBorder : DefaultBorder
diff --git a/TrayApplication/Models/AppInfoModel.cs b/TrayApplication/Models/AppInfoModel.cs
index 0d27c85..6a80c9e 100644
--- a/TrayApplication/Models/AppInfoModel.cs
+++ b/TrayApplication/Models/AppInfoModel.cs
@@ -61,6 +61,7 @@ namespace TrayApplication.Models
URL = Resources.GetImagePath() + "default_gradient.png",
};
IconBackground = imageVisual.OutputVisualMap;
+ imageVisual.Dispose();
}
private void SetGradientBackground(PropertyArray stopColor)
@@ -73,6 +74,7 @@ namespace TrayApplication.Models
SpreadMethod = GradientVisualSpreadMethodType.Pad,
};
IconBackground = gradientVisual.OutputVisualMap;
+ gradientVisual.Dispose();
}
private PropertyArray GetGradientStopColors(Palette palette)
diff --git a/packaging/org.tizen.Apps-1.0.0.tpk b/packaging/org.tizen.Apps-1.0.0.tpk
index 14a309b..0d0c247 100755
--- a/packaging/org.tizen.Apps-1.0.0.tpk
+++ b/packaging/org.tizen.Apps-1.0.0.tpk
Binary files differ
diff --git a/packaging/org.tizen.TrayApplication-1.0.0.tpk b/packaging/org.tizen.TrayApplication-1.0.0.tpk
index 7282e54..9effc77 100755
--- a/packaging/org.tizen.TrayApplication-1.0.0.tpk
+++ b/packaging/org.tizen.TrayApplication-1.0.0.tpk
Binary files differ