From: Eunki, Hong Date: Wed, 18 Oct 2023 06:17:35 +0000 (+0900) Subject: [NUI] Make AddFrameUpdateCallback with root view X-Git-Tag: accepted/tizen/unified/20231205.024657~77 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5f034908690ff2f8187dc7de872349e6e33af0d;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Make AddFrameUpdateCallback with root view Previously, we can only add the root view of FrameUpdateCallback as root layer of window. Now let we add some API that user can set specific view for given FrameUpdateCallback will use. This API will be used when we want to optimize callback behaviour. Signed-off-by: Eunki, Hong --- diff --git a/src/Tizen.NUI/src/public/Window/Window.cs b/src/Tizen.NUI/src/public/Window/Window.cs index 12eff27..3779dfe 100755 --- a/src/Tizen.NUI/src/public/Window/Window.cs +++ b/src/Tizen.NUI/src/public/Window/Window.cs @@ -2219,6 +2219,19 @@ namespace Tizen.NUI } /// + /// Add FrameUpdateCallback with root view. + /// FrameUpdateCallbackInterface can only detach Views under given view. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void AddFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback, View rootView) + { + if(rootView != null) + { + frameUpdateCallback?.AddFrameUpdateCallback(stageCPtr, View.getCPtr(rootView)); + } + } + + /// /// Remove FrameUpdateCallback /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/FrameUpdateCallbackTest.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/FrameUpdateCallbackTest.cs index fe02d9a..80751c1 100644 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/FrameUpdateCallbackTest.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/FrameUpdateCallbackTest.cs @@ -540,7 +540,8 @@ namespace Tizen.NUI.Samples // Add frame callback on window. // OnUpdate callback of frameUpdateCallback will be called before every render frame. - window.AddFrameUpdateCallback(frameUpdateCallback); + // We can set root view what given frameUpdateCallback used + window.AddFrameUpdateCallback(frameUpdateCallback, controlView); // compute limit position the container could go. leftDirectionLimit = (float)window.Size.Width - (totalSize + (float)(INITIAL_POSITION));