From: EverLEEst(SangHyeon Lee) Date: Wed, 22 Jun 2022 06:57:48 +0000 (+0900) Subject: [NUI] update ScrollableBase focus for Forward/Backward/Clockwise/CounterClockwise. X-Git-Tag: accepted/tizen/unified/20231205.024657~887 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=291acdb05f93fab35490f60f3ebbfa539b93362d;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] update ScrollableBase focus for Forward/Backward/Clockwise/CounterClockwise. Clockwise : Match as Down on Vertical, Right on Horizontal. CounterClockwise : Match as Up on Vertical, Left on Horizontal. Forward : Tab. call GetNearestFocusableActor on Parent View. Backward: Shift+Tab. call GetNearestFocusableActor on Parent View. Currently Forward/Backward is unimplemented on other components, so calling parent view's GetNearestFocusableActor didn't catch any valid next focusable view. This need to be fixed for Tab/ShiftTab action. --- diff --git a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs index ff79153..b716067 100755 --- a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs +++ b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs @@ -1981,15 +1981,19 @@ namespace Tizen.NUI.Components float stepDistance = (stepScrollDistance != 0? stepScrollDistance : (isHorizontal ? Size.Width * 0.25f : Size.Height * 0.25f)); bool forward = ((isHorizontal && direction == View.FocusDirection.Right) || - (!isHorizontal && direction == View.FocusDirection.Down)); + (!isHorizontal && direction == View.FocusDirection.Down) || + (direction == View.FocusDirection.Clockwise)); bool backward = ((isHorizontal && direction == View.FocusDirection.Left) || - (!isHorizontal && direction == View.FocusDirection.Up)); + (!isHorizontal && direction == View.FocusDirection.Up) || + (direction == View.FocusDirection.CounterClockwise)); - // Reached end of scroll. move out focus from ScrollableBase. - if ((forward && maxScrollDistance - targetPosition < 0.1f) || (backward && targetPosition < 0.1f)) + // Move out focus from ScrollableBase. + // FIXME: Forward, Backward is unimplemented other components. + if (direction == View.FocusDirection.Forward || direction == View.FocusDirection.Backward || + (forward && maxScrollDistance - targetPosition < 0.1f) || (backward && targetPosition < 0.1f)) { var next = FocusManager.Instance.GetNearestFocusableActor(this.Parent, this, direction); - Debug.WriteLineIf(focusDebugScrollableBase, $"Reached End of Scroll. Next focus target {next}:{next?.ID}"); + Debug.WriteLineIf(focusDebugScrollableBase, $"Focus move [{direction}] out from ScrollableBase! Next focus target {next}:{next?.ID}"); return next; } @@ -2027,6 +2031,7 @@ namespace Tizen.NUI.Components } else { + Debug.WriteLineIf(focusDebugScrollableBase, "current focus view is not decendant. return ScrollableBase!"); return this; }