Fixed TalkBack - Double action on click not working in Settings App 14/316014/2
authorMobaswirul Islam/NC eXperience Group /SRBD/Engineer/Samsung Electronics <mobaswirul.i@samsung.com>
Mon, 12 Aug 2024 11:04:24 +0000 (17:04 +0600)
committerMobaswirul Islam/NC eXperience Group /SRBD/Engineer/Samsung Electronics <mobaswirul.i@samsung.com>
Tue, 13 Aug 2024 08:49:29 +0000 (14:49 +0600)
[Problem] [TNINE-348] Tizen 8.0 Validation TalkBack - Double action on click not working

[Cause & Measure]
 Causes : a) AccessibilityActivated event was not handled properly
  b) Navigator.Push() disables border's accessibility
 Measure : a) Handled AccessibilityActivated Event.
   b) Used Add function instead of Push.

Change-Id: I129c1df64ca9cb5a68c7e7fc15968735bcace097
Signed-off-by: Mobaswirul Islam/NC eXperience Group /SRBD/Engineer/Samsung Electronics <mobaswirul.i@samsung.com>
SettingCore/GadgetNavigation.cs
SettingCore/Views/MainMenuItem.cs
SettingView/SettingView.cs
packaging/org.tizen.cssettings-1.2.0.tpk

index 48ef88c5be98ce7eb035826191c7a1ec5d7cfcd3..f809f5c650db2fd555a1db6af59160d85ff5a44b 100644 (file)
@@ -21,6 +21,8 @@ namespace SettingCore
 
         private static readonly SemaphoreSlim semaphore = new SemaphoreSlim(1);
 
+        private static Stack<View> gadgetViews = new Stack<View>();
+
         static GadgetNavigation()
         {
             SystemSettings.LocaleLanguageChanged += (object sender, LocaleLanguageChangedEventArgs e) => {
@@ -60,7 +62,7 @@ namespace SettingCore
 
             if (baseContentPage is BaseContentPage)
             {
-                NUIApplication.GetDefaultWindow().GetDefaultNavigator().Pop();
+                RemoveGadgetView();
             }
             else
             {
@@ -68,8 +70,7 @@ namespace SettingCore
 
                 try
                 {
-                    // CreateTransitions issue
-                    NUIApplication.GetDefaultWindow().GetDefaultNavigator().PopWithTransition();
+                    RemoveGadgetView();
                 }
                 catch (Exception ex)
                 {
@@ -88,12 +89,7 @@ namespace SettingCore
                 if (info == null)
                 {
                     Logger.Warn($"could not find gadget for menupath: {menuPath}");
-                    return;
-                }
-
-                if (gadgetPages.Values.Select(x => x.ClassName).Contains(info.ClassName))
-                {
-                    Logger.Verbose($"Already navigated to menupath: {menuPath}");
+                    semaphore.Release();
                     return;
                 }
 
@@ -114,8 +110,7 @@ namespace SettingCore
 
                     try
                     {
-                        // CreateTransitions issue
-                        NUIApplication.GetDefaultWindow().GetDefaultNavigator().PushWithTransition(contentPage);
+                        AddGadgetView(contentPage);
                     }
                     catch (Exception ex)
                     {
@@ -123,6 +118,7 @@ namespace SettingCore
                     }
 
                     gadgetPages.Add(contentPage, gadget);
+                    semaphore.Release();
                     return;
                 }
 
@@ -133,6 +129,7 @@ namespace SettingCore
                 var backButton = new BackButton();
                 backButton.Margin = new Extents(0, 8, 0, 0).SpToPx();
                 backButton.Clicked += (s, e) => NavigateBack();
+                backButton.AccessibilityActivated += (s, e) => NavigateBack();
 
                 var moreItems = new List<View>();
 
@@ -170,7 +167,7 @@ namespace SettingCore
                     gadget.OnPageAppeared?.Invoke();
                 };
 
-                NUIApplication.GetDefaultWindow().GetDefaultNavigator().Push(page);
+                AddGadgetView(page);
                 gadgetPages.Add(page, gadget);
             }
             catch (Exception e)
@@ -183,6 +180,34 @@ namespace SettingCore
             }
         }
 
+        public static void AddGadgetView(View newView)
+        {
+            Logger.Debug("Adding New Gadget View");
+            View currentView = NUIApplication.GetDefaultWindow().GetDefaultNavigator().GetChildAt(0);
+            if (currentView == null)
+            {
+                Logger.Warn("CurrentView is Null.");
+                return;
+            }
+            gadgetViews.Push(currentView);
+            NUIApplication.GetDefaultWindow().GetDefaultNavigator().Remove(currentView);
+            NUIApplication.GetDefaultWindow().GetDefaultNavigator().Add(newView);
+        }
+
+        public static void RemoveGadgetView()
+        {
+            Logger.Debug($"Removing Gadget View");
+            View previousView = gadgetViews.Pop();
+            if (previousView == null)
+            {
+                Logger.Warn("LastPage is Null.");
+                return;
+            }
+            Page currentPage = (Page)NUIApplication.GetDefaultWindow().GetDefaultNavigator().GetChildAt(0);
+            NUIApplication.GetDefaultWindow().GetDefaultNavigator().Remove(currentPage);
+            NUIApplication.GetDefaultWindow().GetDefaultNavigator().Add(previousView);
+        }
+
         private static Control GetMoreButton(IEnumerable<MoreMenuItem> moreMenu)
         {
             if (moreMenu == null)
@@ -273,7 +298,7 @@ namespace SettingCore
                             Direction = FlexLayout.FlexDirection.Row,
                             ItemsAlignment = FlexLayout.AlignmentType.Center
                         };
-   
+
                         // remove buttons icon
                         item.Remove(item.Children[0]);
 
index a9575a81c4f9f286e4801140adcafbf4170b47f4..9413a2ba4105f103eec831fb792d692c1f40700f 100644 (file)
@@ -68,6 +68,11 @@ namespace SettingCore.Views
                 GadgetNavigation.NavigateTo(MenuPath);
             };
 
+            AccessibilityActivated += (s, e) =>
+            {
+                GadgetNavigation.NavigateTo(MenuPath);
+            };
+
             ThemeManager.ThemeChanged += ThemeManager_ThemeChanged;
         }
 
@@ -75,8 +80,8 @@ namespace SettingCore.Views
         {
             titleTextLabel.Text = title;
             iconBackground.BackgroundColor = iconBackgroundColor;
-        }        
-        
+        }
+
         public override void OnChangeSelected(bool selected)
         {
             if (selected)
index e1589870ee613037af9d007145cf858ea767e83c..365f68497c178b100ae5d9b2c944332c48d75b27 100644 (file)
@@ -116,7 +116,10 @@ namespace SettingView
 
             GetDefaultWindow().Remove(GetDefaultWindow().GetDefaultNavigator());
             GetDefaultWindow().SetDefaultNavigator(navigator);
-            GetDefaultWindow().GetDefaultNavigator().Push(page);
+
+            // Navigator().Push() disables border's accessibility.
+            // Using Navigator().Add()
+            GetDefaultWindow().GetDefaultNavigator().Add(page);
 
             RegisterEvents();
 
index bb99f5749e258e39c67889646df9154e968ec78d..85cd7cefa5d9667a5c505502ace833b2eaf92553 100644 (file)
Binary files a/packaging/org.tizen.cssettings-1.2.0.tpk and b/packaging/org.tizen.cssettings-1.2.0.tpk differ