Fixed Album window not closing issue 66/316966/2 accepted/tizen_unified accepted/tizen_unified_x accepted/tizen/unified/20241231.014854 accepted/tizen/unified/20250614.044603 accepted/tizen/unified/x/20241231.051829 accepted/tizen/unified/x/20250615.060243 accepted/tizen/unified/x/asan/20250113.002203
authorMd. Farhan Mahtab/NC eXperience Group /SRBD/Engineer/Samsung Electronics <farhan.m1@samsung.com>
Fri, 20 Dec 2024 11:04:52 +0000 (17:04 +0600)
committerMd. Farhan Mahtab/NC eXperience Group /SRBD/Engineer/Samsung Electronics <farhan.m1@samsung.com>
Fri, 20 Dec 2024 12:52:28 +0000 (18:52 +0600)
[Problem][TTEN-496] Clicking back button doesn't close album window

[Cause & Measure]
 Cause   : In NavigateBack function, last page is removed from the navigator which doesn't properly dispose the page
 Measure : To properly remove the page, the page also need to be removed from gadgetPages
           and the gadget also need to be removed from NUIGadgetManager

Change-Id: I6b97cd4a4754d33b1ac194f6e839bcf53569e37e
Signed-off-by: Md. Farhan Mahtab/NC eXperience Group /SRBD/Engineer/Samsung Electronics <farhan.m1@samsung.com>
SettingCore/GadgetNavigation.cs
packaging/org.tizen.cssettings-1.2.4.tpk

index f07c9a80a8e4c981a6b5ff08e37963a8245356aa..4444baf0681580dcdf2651bb01483c952b095db1 100644 (file)
@@ -42,15 +42,23 @@ namespace SettingCore
                 }
             };
 
-            NUIApplication.GetDefaultWindow().GetDefaultNavigator().Popped += (s, e) =>
+            NUIApplication.GetDefaultWindow().GetDefaultNavigator().Popped += GadgetPoppedEventHandler;
+        }
+
+
+        private static void GadgetPoppedEventHandler(object o, PoppedEventArgs e)
+        {
+            RemoveGadget(e.Page);
+        }
+
+        private static void RemoveGadget(Page page)
+        {
+            if (gadgetPages.TryGetValue(page, out MenuGadget gadget))
             {
-                if (gadgetPages.TryGetValue(e.Page, out MenuGadget gadget))
-                {
-                    NUIGadgetManager.Remove(gadget);
-                    gadgetPages.Remove(e.Page);
-                }
-                NUIApplication.GetDefaultWindow().GetDefaultNavigator().EnableBackNavigation = true;
-            };
+                NUIGadgetManager.Remove(gadget);
+                gadgetPages.Remove(page);
+            }
+            NUIApplication.GetDefaultWindow().GetDefaultNavigator().EnableBackNavigation = true;
         }
 
         public static void SetFullScreenMode(bool fullScreen)
@@ -198,6 +206,8 @@ namespace SettingCore
             Page currentPage = (Page)NUIApplication.GetDefaultWindow().GetDefaultNavigator().GetChildAt(0);
             NUIApplication.GetDefaultWindow().GetDefaultNavigator().Remove(currentPage);
             NUIApplication.GetDefaultWindow().GetDefaultNavigator().Add(previousView);
+
+            RemoveGadget(currentPage);
         }
 
         private static Control GetMoreButton(IEnumerable<MoreMenuItem> moreMenu)
index 3599eedc1d49b4487fbaac610c0d8a79b4a38bd3..d25d44470472dd5197cc4386dfec6834f5dcc671 100644 (file)
Binary files a/packaging/org.tizen.cssettings-1.2.4.tpk and b/packaging/org.tizen.cssettings-1.2.4.tpk differ