From f995112547068dcb3df4f75886bd997a9dc728ec Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Fri, 12 Nov 2021 13:16:40 +0900 Subject: [PATCH] [ATSPI] CollectionView - Show highlighed descendant The 1st generation child ContentContainer is always showing. So it was not able to show highlighted descendant by AccessibilityScrollToChild. The child is a descendant of CollectionView from following patch. https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-toolkit/+/266414/ With this patch set, It is possible to show highlighted descendant. --- .../Controls/RecyclerView/CollectionView.cs | 25 ++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs index 0e89ad1..fc7e437 100755 --- a/src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs @@ -850,16 +850,29 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] protected override bool AccessibilityScrollToChild(View child) { - foreach (RecyclerViewItem item in ContentContainer.Children.Where((item) => item is RecyclerViewItem)) + if (ScrollingDirection == Direction.Horizontal) { - if (child == item) + if (child.ScreenPosition.X + child.Size.Width <= this.ScreenPosition.X) + { + ScrollTo((float)(child.ScreenPosition.X - ContentContainer.ScreenPosition.X), false); + } + else if (child.ScreenPosition.X >= this.ScreenPosition.X + this.Size.Width) { - ScrollToIndex(item.Index); - return true; + ScrollTo((float)(child.ScreenPosition.X + child.Size.Width - ContentContainer.ScreenPosition.X - this.Size.Width), false); } } - - return false; + else + { + if (child.ScreenPosition.Y + child.Size.Height <= this.ScreenPosition.Y) + { + ScrollTo((float)(child.ScreenPosition.Y - ContentContainer.ScreenPosition.Y), false); + } + else if (child.ScreenPosition.Y >= this.ScreenPosition.Y + this.Size.Height) + { + ScrollTo((float)(child.ScreenPosition.Y + child.Size.Height - ContentContainer.ScreenPosition.Y - this.Size.Height), false); + } + } + return true; } // Realize and Decorate the item. -- 2.7.4