Adding Dispose and Updating tpk name. 06/297706/2
authorShivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com>
Wed, 23 Aug 2023 06:31:37 +0000 (12:01 +0530)
committerShivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com>
Wed, 23 Aug 2023 06:40:50 +0000 (12:10 +0530)
Change-Id: I218dc2342af34a71958009428d1e1a0ee232b64e
Signed-off-by: Shivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com>
Notifications/Notifications.cs
Notifications/Notifications.csproj
Notifications/ViewManager.cs
Notifications/Views/BaseView.cs
packaging/org.tizen.Notifications-1.0.0.tpk [deleted file]
packaging/org.tizen.notifications-1.0.0.tpk [new file with mode: 0644]

index 4af2278b283847f615613d0909f56fb1a47c6d31..8f3e27f98c02380371cef672e16fb61988bdbf3f 100644 (file)
@@ -86,6 +86,7 @@ namespace Notifications
         protected override void OnTerminate()
         {
             Tizen.Log.Info(AppConstants.LogTag, "On App Terminate");
+            viewManager.Dispose();
             base.OnTerminate();
         }
 
index 255472ed14c98a727beb1d7f7dab2c8a932aa4a9..c28a26a9c3faaa616db7538c6b328f8c58309397 100644 (file)
@@ -3,7 +3,6 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <TargetFramework>tizen11.0</TargetFramework>
-    <AssemblyName>Notifications</AssemblyName>
   </PropertyGroup>
 
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
index 34b313c560663387eb260cabd3ff34b1c64032a5..49471ade98d66f0510ae72baae686fa3fa037d59 100644 (file)
@@ -27,6 +27,23 @@ namespace Notifications
             ThemeManager.ThemeChanged += OnThemeChanged;
         }
 
+        public void Dispose()
+        {
+            if (notificationsViewModel != null)
+            {
+                notificationsViewModel.NotificationSelected -= OnNotificationSelected;
+            }
+
+            if(notificationsDetailViewModel != null)
+            {
+                notificationsDetailViewModel.DetailContentRemoved -= OnDetailContentRemoved;
+            }
+
+            baseView.BindingContext = null;
+            baseView.BackKeyPressed -= OnBackKeyPressed;
+            baseView.Dispose();
+        }
+
         private void OnThemeChanged(object sender, ThemeChangedEventArgs e)
         {
             if (e.IsPlatformThemeChanged)
index 3c38778ea77a432dedf66d92868d2640d0aebe70..7a2bc0ac2cc353b95d330e611fadc407570d0dcf 100644 (file)
@@ -206,5 +206,45 @@ namespace Notifications.Views
             get => (bool)GetValue(IsContentAvailableProperty);
             set => SetValue(IsContentAvailableProperty, value);
         }
+
+        protected override void Dispose(DisposeTypes type)
+        {
+            if (Disposed)
+            {
+                return;
+            }
+
+            if (type == DisposeTypes.Explicit)
+            {
+                RemoveContent();
+
+                detailContentView?.Dispose();
+                detailContentView = null;
+
+                noNotificationsText?.Dispose();
+                noNotificationsText = null;
+
+                notificationsView.SelectedItem = null;
+                notificationsView?.Dispose();
+                notificationsView = null;
+
+                clearAllButton?.Dispose();
+                clearAllButton = null;
+
+                topView?.Remove(backButton);
+                backButton?.Dispose();
+                backButton = null;
+
+                topView?.Remove(titleText);
+                titleText?.Dispose();
+                titleText = null;
+
+                Remove(topView);
+                topView?.Dispose();
+                topView = null;
+            }
+            Tizen.Log.Info(AppConstants.LogTag, "Dispose BaseView");
+            base.Dispose(type);
+        }
     }
 }
diff --git a/packaging/org.tizen.Notifications-1.0.0.tpk b/packaging/org.tizen.Notifications-1.0.0.tpk
deleted file mode 100644 (file)
index bca8b0f..0000000
Binary files a/packaging/org.tizen.Notifications-1.0.0.tpk and /dev/null differ
diff --git a/packaging/org.tizen.notifications-1.0.0.tpk b/packaging/org.tizen.notifications-1.0.0.tpk
new file mode 100644 (file)
index 0000000..0685203
Binary files /dev/null and b/packaging/org.tizen.notifications-1.0.0.tpk differ