From: admin Date: Tue, 21 Jul 2020 15:51:50 +0000 (+0000) Subject: Merge remote-tracking branch 'origin/master' into tizen X-Git-Tag: accepted/tizen/unified/20200722.014942~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2cd8a14f82a529d6d0d0a79a9a217da5929b8830;hp=fd8aba96e8ddafeec0a0f1cdfa2896066f4e8500;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Merge remote-tracking branch 'origin/master' into tizen --- diff --git a/src/Tizen.NUI.Components/Controls/Button.Internal.cs b/src/Tizen.NUI.Components/Controls/Button.Internal.cs index 10652bc..dd0c0fb 100755 --- a/src/Tizen.NUI.Components/Controls/Button.Internal.cs +++ b/src/Tizen.NUI.Components/Controls/Button.Internal.cs @@ -57,7 +57,7 @@ namespace Tizen.NUI.Components /// /// The click information. [EditorBrowsable(EditorBrowsableState.Never)] - protected virtual void OnClick(ClickEventArgs eventArgs) + protected virtual void OnClicked(ClickedEventArgs eventArgs) { } @@ -367,12 +367,15 @@ namespace Tizen.NUI.Components LayoutChild(); } - private void OnClickInternal(ClickEventArgs eventArgs) + private void OnClickedInternal(ClickedEventArgs eventArgs) { Command?.Execute(CommandParameter); - OnClick(eventArgs); - Extension?.OnClick(this, eventArgs); - ClickEvent?.Invoke(this, eventArgs); + OnClicked(eventArgs); + Extension?.OnClicked(this, eventArgs); + + ClickEventArgs nestedEventArgs = new ClickEventArgs(); + ClickEvent?.Invoke(this, nestedEventArgs); + Clicked?.Invoke(this, eventArgs); } private void OnIconRelayout(object sender, EventArgs e) diff --git a/src/Tizen.NUI.Components/Controls/Button.cs b/src/Tizen.NUI.Components/Controls/Button.cs index 1662feb..64a8cb2 100755 --- a/src/Tizen.NUI.Components/Controls/Button.cs +++ b/src/Tizen.NUI.Components/Controls/Button.cs @@ -23,6 +23,14 @@ using Tizen.NUI.Components.Extension; namespace Tizen.NUI.Components { /// + /// ClickedEventArgs is a class to record button click event arguments which will sent to user. + /// + /// 8 + public class ClickedEventArgs : EventArgs + { + } + + /// /// Button is one kind of common component, a button clearly describes what action will occur when the user selects it. /// Button may contain text or an icon. /// @@ -172,9 +180,16 @@ namespace Tizen.NUI.Components /// An event for the button clicked signal which can be used to subscribe or unsubscribe the event handler provided by the user.
/// /// 6 + [Obsolete("Deprecated in API8; Will be removed in API10. Please use Clicked event instead.")] public event EventHandler ClickEvent; /// + /// An event for the button clicked signal which can be used to subscribe or unsubscribe the event handler provided by the user. + /// + /// 8 + public event EventHandler Clicked; + + /// /// An event for the button state changed signal which can be used to subscribe or unsubscribe the event handler provided by the user.
///
/// 6 @@ -613,8 +628,8 @@ namespace Tizen.NUI.Components if (clicked) { - ClickEventArgs eventArgs = new ClickEventArgs(); - OnClickInternal(eventArgs); + ClickedEventArgs eventArgs = new ClickedEventArgs(); + OnClickedInternal(eventArgs); } } } @@ -687,8 +702,8 @@ namespace Tizen.NUI.Components if (clicked) { - ClickEventArgs eventArgs = new ClickEventArgs(); - OnClickInternal(eventArgs); + ClickedEventArgs eventArgs = new ClickedEventArgs(); + OnClickedInternal(eventArgs); } return true; @@ -736,6 +751,7 @@ namespace Tizen.NUI.Components /// ClickEventArgs is a class to record button click event arguments which will sent to user. /// /// 6 + [Obsolete("Deprecated in API8; Will be removed in API10. Please use ClickedEventArgs instead.")] public class ClickEventArgs : EventArgs { } diff --git a/src/Tizen.NUI.Components/Controls/Extension/ButtonExtension.cs b/src/Tizen.NUI.Components/Controls/Extension/ButtonExtension.cs index 83a8b1b..b18c06b 100644 --- a/src/Tizen.NUI.Components/Controls/Extension/ButtonExtension.cs +++ b/src/Tizen.NUI.Components/Controls/Extension/ButtonExtension.cs @@ -83,7 +83,7 @@ namespace Tizen.NUI.Components.Extension /// The Button instance that the extension currently applied to. /// The click event information. [EditorBrowsable(EditorBrowsableState.Never)] - public virtual void OnClick(Button button, Button.ClickEventArgs eventArgs) + public virtual void OnClicked(Button button, ClickedEventArgs eventArgs) { } diff --git a/src/Tizen.NUI.Components/Controls/Scrollbar.cs b/src/Tizen.NUI.Components/Controls/Scrollbar.cs index 1059fca..5da4255 100755 --- a/src/Tizen.NUI.Components/Controls/Scrollbar.cs +++ b/src/Tizen.NUI.Components/Controls/Scrollbar.cs @@ -111,6 +111,7 @@ namespace Tizen.NUI.Components private Calculator calculator; private Size containerSize = new Size(0, 0); private ScrollbarStyle scrollbarStyle => ViewStyle as ScrollbarStyle; + private bool mScrollEnabled = true; #endregion Fields @@ -341,6 +342,11 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public override void ScrollTo(float position, uint durationMs = 0, AlphaFunction alphaFunction = null) { + if (mScrollEnabled == false) + { + return; + } + if (calculator == null) { return; @@ -482,6 +488,23 @@ namespace Tizen.NUI.Components thumbVisual.UpdateVisual(true); } + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool ScrollEnabled + { + get + { + return mScrollEnabled; + } + set + { + if (value != mScrollEnabled) + { + mScrollEnabled = value; + } + } + } + #endregion Methods diff --git a/src/Tizen.NUI.Components/Controls/ScrollbarBase.cs b/src/Tizen.NUI.Components/Controls/ScrollbarBase.cs index 0017e57..45d8de5 100755 --- a/src/Tizen.NUI.Components/Controls/ScrollbarBase.cs +++ b/src/Tizen.NUI.Components/Controls/ScrollbarBase.cs @@ -26,6 +26,8 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public abstract class ScrollbarBase : Control { + private bool mScrollEnabled = true; + #region Constructors /// @@ -84,6 +86,12 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public abstract void Initialize(float contentLength, float viewportLength, float currentPosition, bool isHorizontal = false); + /// + /// Enable or disable scrolling. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public abstract bool ScrollEnabled { get; set; } + #endregion Methods } } diff --git a/src/Tizen.NUI.Components/Controls/Slider.Internal.cs b/src/Tizen.NUI.Components/Controls/Slider.Internal.cs index d5c1883..ae6859b 100755 --- a/src/Tizen.NUI.Components/Controls/Slider.Internal.cs +++ b/src/Tizen.NUI.Components/Controls/Slider.Internal.cs @@ -44,6 +44,8 @@ namespace Tizen.NUI.Components private float currentSlidedOffset; private EventHandler valueChangedHandler; private EventHandler slidingFinishedHandler; + private EventHandler sliderValueChangedHandler; + private EventHandler sliderSlidingFinishedHandler; private EventHandler stateChangedHandler; bool isFocused = false; @@ -204,6 +206,13 @@ namespace Tizen.NUI.Components slidingFinishedHandler(this, args); } + if (null != sliderSlidingFinishedHandler) + { + SliderSlidingFinishedEventArgs args = new SliderSlidingFinishedEventArgs(); + args.CurrentValue = curValue; + sliderSlidingFinishedHandler(this, args); + } + UpdateState(isFocused, false); } } diff --git a/src/Tizen.NUI.Components/Controls/Slider.cs b/src/Tizen.NUI.Components/Controls/Slider.cs index 9bf9703..592d52a 100755 --- a/src/Tizen.NUI.Components/Controls/Slider.cs +++ b/src/Tizen.NUI.Components/Controls/Slider.cs @@ -22,6 +22,32 @@ using Tizen.NUI.Binding; namespace Tizen.NUI.Components { /// + /// Slider value changed event data. + /// + /// 8 + public class SliderValueChangedEventArgs : EventArgs + { + /// + /// Current Slider value + /// + /// 8 + public float CurrentValue { get; set; } + } + + /// + /// Slider sliding finished event data. + /// + /// 8 + public class SliderSlidingFinishedEventArgs : EventArgs + { + /// + /// Current Slider value + /// + /// 8 + public float CurrentValue { get; set; } + } + + /// /// A slider lets users select a value from a continuous or discrete range of values by moving the slider thumb. /// /// 6 @@ -108,6 +134,7 @@ namespace Tizen.NUI.Components /// The value changed event handler. /// /// 6 + [Obsolete("Deprecated in API8; Will be removed in API10. Please use ValueChanged event instead.")] public event EventHandler ValueChangedEvent { add @@ -124,6 +151,7 @@ namespace Tizen.NUI.Components /// The sliding finished event handler. /// /// 6 + [Obsolete("Deprecated in API8; Will be removed in API10. Please use SlidingFinished event instead.")] public event EventHandler SlidingFinishedEvent { add @@ -137,6 +165,38 @@ namespace Tizen.NUI.Components } /// + /// The value changed event handler. + /// + /// 8 + public event EventHandler ValueChanged + { + add + { + sliderValueChangedHandler += value; + } + remove + { + sliderValueChangedHandler -= value; + } + } + + /// + /// The sliding finished event handler. + /// + /// 8 + public event EventHandler SlidingFinished + { + add + { + sliderSlidingFinishedHandler += value; + } + remove + { + sliderSlidingFinishedHandler -= value; + } + } + + /// /// The state changed event handler. /// /// 6 @@ -830,6 +890,13 @@ namespace Tizen.NUI.Components args.CurrentValue = curValue; valueChangedHandler(this, args); } + + if (sliderValueChangedHandler != null) + { + SliderValueChangedEventArgs args = new SliderValueChangedEventArgs(); + args.CurrentValue = curValue; + sliderValueChangedHandler(this, args); + } } private bool OnTouchEventForBgTrack(object source, TouchEventArgs e) @@ -846,6 +913,13 @@ namespace Tizen.NUI.Components args.CurrentValue = curValue; slidingFinishedHandler(this, args); } + + if (null !=sliderSlidingFinishedHandler) + { + SliderSlidingFinishedEventArgs args = new SliderSlidingFinishedEventArgs(); + args.CurrentValue = curValue; + sliderSlidingFinishedHandler(this, args); + } } return false; } @@ -884,6 +958,13 @@ namespace Tizen.NUI.Components args.CurrentValue = curValue; valueChangedHandler(this, args); } + + if (null != sliderValueChangedHandler) + { + SliderValueChangedEventArgs args = new SliderValueChangedEventArgs(); + args.CurrentValue = curValue; + sliderValueChangedHandler(this, args); + } } } @@ -1000,12 +1081,14 @@ namespace Tizen.NUI.Components /// Value Changed event data. /// /// 6 + [Obsolete("Deprecated in API8; Will be removed in API10. Please use SliderValueChangedEventArgs instead.")] public class ValueChangedArgs : EventArgs { /// /// Curren value /// /// 6 + [Obsolete("Deprecated in API8; Will be removed in API10. Please use SliderValueChangedEventArgs.CurrentValue instead.")] public float CurrentValue; } @@ -1013,12 +1096,14 @@ namespace Tizen.NUI.Components /// Value Changed event data. /// /// 6 + [Obsolete("Deprecated in API8; Will be removed in API10. Please use SliderSlidingFinishedEventArgs instead.")] public class SlidingFinishedArgs : EventArgs { /// /// Curren value /// /// 6 + [Obsolete("Deprecated in API8; Will be removed in API10. Please use SliderSlidingFinishedEventArgs.CurrentValue instead.")] public float CurrentValue; } diff --git a/src/Tizen.NUI.Components/Controls/Switch.cs b/src/Tizen.NUI.Components/Controls/Switch.cs index f658e40..0d668dd 100755 --- a/src/Tizen.NUI.Components/Controls/Switch.cs +++ b/src/Tizen.NUI.Components/Controls/Switch.cs @@ -66,9 +66,16 @@ namespace Tizen.NUI.Components /// An event for the item selected signal which can be used to subscribe or unsubscribe the event handler provided by the user.
/// /// 6 + [Obsolete("Deprecated in API8; Will be removed in API10. Please use SelectedChanged event instead.")] public event EventHandler SelectedEvent; /// + /// An event for the item selected signal which can be used to subscribe or unsubscribe the event handler provided by the user. + /// + /// 8 + public event EventHandler SelectedChanged; + + /// /// Return a copied Style instance of Switch /// /// @@ -334,12 +341,20 @@ namespace Tizen.NUI.Components eventArgs.IsSelected = IsSelected; SelectedEvent(this, eventArgs); } + + if (SelectedChanged != null) + { + SelectedChangedEventArgs eventArgs = new SelectedChangedEventArgs(); + eventArgs.IsSelected = IsSelected; + SelectedChanged(this, eventArgs); + } } /// /// SelectEventArgs is a class to record item selected arguments which will sent to user. /// /// 6 + [Obsolete("Deprecated in API8; Will be removed in API10. Please use SelectedChangedEventArgs instead.")] public class SelectEventArgs : EventArgs { /// Select state of Switch diff --git a/src/Tizen.NUI.Wearable/src/public/CircularScrollbar.cs b/src/Tizen.NUI.Wearable/src/public/CircularScrollbar.cs index d369d59..656fe7e 100644 --- a/src/Tizen.NUI.Wearable/src/public/CircularScrollbar.cs +++ b/src/Tizen.NUI.Wearable/src/public/CircularScrollbar.cs @@ -90,6 +90,7 @@ namespace Tizen.NUI.Wearable private Size containerSize = new Size(0, 0); private Animation thumbStartAngleAnimation; private Animation thumbSweepAngleAnimation; + private bool mScrollEnabled = true; #endregion Fields @@ -313,6 +314,11 @@ namespace Tizen.NUI.Wearable { currentPosition = position; + if (mScrollEnabled == false) + { + return; + } + if (thumbVisual == null) { return; @@ -451,6 +457,23 @@ namespace Tizen.NUI.Wearable thumbVisual.UpdateVisual(true); } + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool ScrollEnabled + { + get + { + return mScrollEnabled; + } + set + { + if (value != mScrollEnabled) + { + mScrollEnabled = value; + } + } + } + #endregion Methods } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs index 24dcee8..207b539 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs @@ -24,7 +24,6 @@ using Tizen.NUI.Binding; namespace Tizen.NUI.BaseComponents { - /// /// A control which renders a short text string.
/// Text labels are lightweight, non-editable, and do not respond to the user input.
@@ -32,6 +31,49 @@ namespace Tizen.NUI.BaseComponents /// 3 public partial class TextLabel : View { + private class TextLayout : LayoutItem + { + protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec) + { + // Padding will be automatically applied by DALi TextLabel. + float totalWidth = widthMeasureSpec.Size.AsDecimal(); + float totalHeight = heightMeasureSpec.Size.AsDecimal(); + + if (widthMeasureSpec.Mode == MeasureSpecification.ModeType.Exactly) + { + if (heightMeasureSpec.Mode != MeasureSpecification.ModeType.Exactly) + { + totalHeight = Owner.GetHeightForWidth(totalWidth); + heightMeasureSpec = new MeasureSpecification(new LayoutLength(totalHeight), MeasureSpecification.ModeType.Exactly); + } + } + else + { + if (heightMeasureSpec.Mode == MeasureSpecification.ModeType.Exactly) + { + // GetWidthForHeight is not implemented. + totalWidth = Owner.GetNaturalSize().Width; + widthMeasureSpec = new MeasureSpecification(new LayoutLength(totalWidth), MeasureSpecification.ModeType.Exactly); + } + else + { + Vector3 naturalSize = Owner.GetNaturalSize(); + totalWidth = naturalSize.Width; + totalHeight = naturalSize.Height; + + heightMeasureSpec = new MeasureSpecification(new LayoutLength(totalHeight), MeasureSpecification.ModeType.Exactly); + widthMeasureSpec = new MeasureSpecification(new LayoutLength(totalWidth), MeasureSpecification.ModeType.Exactly); + } + } + + MeasuredSize.StateType childWidthState = MeasuredSize.StateType.MeasuredSizeOK; + MeasuredSize.StateType childHeightState = MeasuredSize.StateType.MeasuredSizeOK; + + SetMeasuredDimensions(ResolveSizeAndState(new LayoutLength(totalWidth), widthMeasureSpec, childWidthState), + ResolveSizeAndState(new LayoutLength(totalHeight), heightMeasureSpec, childHeightState)); + } + } + static TextLabel() { } private string textLabelSid = null; @@ -55,12 +97,14 @@ namespace Tizen.NUI.BaseComponents public TextLabel() : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + Layout = new TextLayout(); } /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] public TextLabel(TextLabelStyle viewStyle) : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true, viewStyle) { + Layout = new TextLayout(); } /// @@ -72,6 +116,7 @@ namespace Tizen.NUI.BaseComponents public TextLabel(bool shown) : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + Layout = new TextLayout(); SetVisible(shown); } @@ -83,6 +128,7 @@ namespace Tizen.NUI.BaseComponents public TextLabel(string text) : this(Interop.TextLabel.TextLabel_New__SWIG_1(text), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + Layout = new TextLayout(); } /// @@ -95,6 +141,7 @@ namespace Tizen.NUI.BaseComponents public TextLabel(string text, bool shown) : this(Interop.TextLabel.TextLabel_New__SWIG_1(text), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + Layout = new TextLayout(); SetVisible(shown); } diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 8ceee29..e0641ae 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -1612,7 +1612,7 @@ namespace Tizen.NUI.BaseComponents set { Extents padding = value; - if (Layout !=null) + if (Layout != null) { // Layout set so store Padding in LayoutItem instead of in View. // If View stores the Padding value then Legacy Size Negotiation will overwrite @@ -1620,15 +1620,14 @@ namespace Tizen.NUI.BaseComponents Layout.Padding = value; // If Layout is a LayoutItem then it could be a View that handles it's own padding. // Let the View keeps it's padding. Still store Padding in Layout to reduce code paths. - if( Layout.GetType() != typeof(LayoutItem)) // If a Layout container of some kind. + if (typeof(LayoutGroup).IsAssignableFrom(Layout.GetType())) // If a Layout container of some kind. { - padding = new Extents(0,0,0,0); // Reset value stored in View. + padding = new Extents(0, 0, 0, 0); // Reset value stored in View. } - _layout?.RequestLayout(); } + SetValue(PaddingProperty, padding); NotifyPropertyChanged(); - _layout?.RequestLayout(); } } diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TextPageUtil.cs b/src/Tizen.NUI/src/public/Utility/TextPageUtil.cs similarity index 85% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TextPageUtil.cs rename to src/Tizen.NUI/src/public/Utility/TextPageUtil.cs index 6e110ff..c188f7a 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TextPageUtil.cs +++ b/src/Tizen.NUI/src/public/Utility/TextPageUtil.cs @@ -1,15 +1,36 @@ -using System.Collections.Generic; +/* + * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + using System; +using System.Collections.Generic; +using System.ComponentModel; using System.IO; using Tizen.NUI; using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Wearable; -namespace Tizen.NUI.Samples +namespace Tizen.NUI.Utility { + + /// + /// This is a class for stroing the text of a page. + /// + [EditorBrowsable(EditorBrowsableState.Never)] class PageData { public string previousTag {get; set;} @@ -18,6 +39,10 @@ namespace Tizen.NUI.Samples public int endOffset {get; set;} } + /// + /// This is a class that stores information when parsing markup text. + /// + [EditorBrowsable(EditorBrowsableState.Never)] class TagData { public string tagName {get; set;} @@ -25,6 +50,10 @@ namespace Tizen.NUI.Samples public bool isEndTag {get; set;} } + /// + /// This is utility class for paging very long text. + /// + [EditorBrowsable(EditorBrowsableState.Never)] public class TextPageUtil { private static char LESS_THAN = '<'; @@ -50,7 +79,11 @@ namespace Tizen.NUI.Samples private List characterList; private string pageString; - + /// + /// When text is inputed, the text is paging in the TextLabe size unit. + /// The total number of pages. + /// + [EditorBrowsable(EditorBrowsableState.Never)] public int SetText(TextLabel label, string str) { if(str == null) return 0; @@ -125,6 +158,11 @@ namespace Tizen.NUI.Samples return totalPageCnt; } + /// + /// Input the page number returns the text of the page. + /// The text of the page. + /// + [EditorBrowsable(EditorBrowsableState.Never)] public string GetText(int pageNum) { if( pageNum > totalPageCnt || pageNum < 1 ) { diff --git a/src/Tizen.NUI/src/public/Window.cs b/src/Tizen.NUI/src/public/Window.cs index 6f01fe3..4d17177 100755 --- a/src/Tizen.NUI/src/public/Window.cs +++ b/src/Tizen.NUI/src/public/Window.cs @@ -1311,6 +1311,60 @@ namespace Tizen.NUI Interop.Window.delete_Window(swigCPtr); } + private static Dictionary frameCallbackList = new Dictionary(); + + private static readonly object locker = new object(); + + private static int key = 0; + + private static FrameCallbackType internalHookFrameCallback = OnInternalHookFrameCallback; + + private struct internalHookCallbackType + { + public FrameCallbackType userCallback; + public int frameId; + } + + private static void OnInternalHookFrameCallback(int id) + { + lock (locker) + { + if (frameCallbackList.ContainsKey(id)) + { + if (frameCallbackList[id].userCallback != null) + { + frameCallbackList[id].userCallback.Invoke(frameCallbackList[id].frameId); + frameCallbackList.Remove(id); + } + else + { + NUILog.Error($"found userCallback is NULL"); + frameCallbackList.Remove(id); + } + } + } + } + + private int AddInterHookCallback(FrameCallbackType callback, int frameId) + { + if (null == callback) + { + throw new ArgumentNullException(nameof(callback), "FrameCallbackType should not be null"); + } + var assignedKey = 0; + lock (locker) + { + key++; + assignedKey = key; + frameCallbackList.Add(assignedKey, new internalHookCallbackType() + { + userCallback = callback, + frameId = frameId, + }); + } + return assignedKey; + } + /// /// Type of callback which is called when the frame rendering is done by graphics driver or when the frame is displayed on display. /// @@ -1335,14 +1389,8 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public void AddFrameRenderedCallback(FrameCallbackType callback, int frameId) { - IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback); - - if (IntPtr.Zero == ip) - { - throw new ArgumentNullException(nameof(callback), "FrameCallbackType should not be null"); - } - - Interop.WindowInternal.AddFrameRenderedCallback(swigCPtr, new HandleRef(this, ip), frameId); + var assignedKey = AddInterHookCallback(callback, frameId); + Interop.WindowInternal.AddFrameRenderedCallback(swigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate(internalHookFrameCallback)), assignedKey); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -1364,14 +1412,8 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public void AddFramePresentedCallback(FrameCallbackType callback, int frameId) { - IntPtr ip = Marshal.GetFunctionPointerForDelegate(callback); - - if (IntPtr.Zero == ip) - { - throw new ArgumentNullException(nameof(callback), "FrameCallbackType should not be null"); - } - - Interop.WindowInternal.AddFramePresentedCallback(swigCPtr, new HandleRef(this, ip), frameId); + var assignedKey = AddInterHookCallback(callback, frameId); + Interop.WindowInternal.AddFramePresentedCallback(swigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate(internalHookFrameCallback)), assignedKey); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/AddFrameRenderedCallbackTest.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/AddFrameRenderedCallbackTest.cs index cc21b81..016c94c 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/AddFrameRenderedCallbackTest.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/AddFrameRenderedCallbackTest.cs @@ -22,13 +22,18 @@ namespace Tizen.NUI.Samples Window win; Window.FrameCallbackType cb; + TextLabel tl; + View view; void test() { + tlog.Fatal(tag, $"test start"); win = NUIApplication.GetDefaultWindow(); win.TouchEvent += WinTouchEvent; - View view = new View(); + view = new View(); view.Size = new Size(100, 100); view.BackgroundColor = Color.Blue; + view.Focusable = true; + view.KeyEvent += View_KeyEvent; win.Add(view); cb = testCallback; @@ -38,6 +43,14 @@ namespace Tizen.NUI.Samples Timer timer = new Timer(5000); timer.Tick += testOnTick; timer.Start(); + + tl = new TextLabel("frameId"); + tl.Size = new Size(500, 200); + tl.Position = new Position(10, 200); + tl.BackgroundColor = Color.White; + win.Add(tl); + + FocusManager.Instance.SetCurrentFocusView(view); } private void WinTouchEvent(object sender, Window.TouchEventArgs e) @@ -60,7 +73,49 @@ namespace Tizen.NUI.Samples void testCallback(int id) { - Console.WriteLine($"testCallback() id={id}"); + tlog.Fatal(tag, $"testCallback() id={id}"); + tl.Text = $"frameId={id}"; + } + + private bool View_KeyEvent(object source, View.KeyEventArgs e) + { + if (e.Key.State == Key.StateType.Down) + { + if (e.Key.KeyPressedName == "1") + { + cb = testCallback; + win.AddFrameRenderedCallback(cb, cnt++); + tlog.Fatal(tag, $"1) testOnTick() AddFrameRenderedCallback() send id={cnt}"); + } + else if (e.Key.KeyPressedName == "2") + { + cb = testCallback; + win.AddFramePresentedCallback(cb, cnt++); + tlog.Fatal(tag, $"2) testOnTick() AddFramePresentedCallback() send id={cnt}"); + } + else if (e.Key.KeyPressedName == "3") + { + cb = testCallback; + win.AddFramePresentedCallback(cb, cnt++); + cb = null; + tlog.Fatal(tag, $"3) testOnTick() AddFramePresentedCallback() send id={cnt}"); + } + else if (e.Key.KeyPressedName == "4") + { + win.AddFrameRenderedCallback((int id) => + { + tlog.Fatal(tag, $"testCallback() id={id}"); + tl.Text = $"frameId={id}"; + }, cnt++); + tlog.Fatal(tag, $"4) testOnTick() AddFrameRenderedCallback() send id={cnt}"); + } + else if (e.Key.KeyPressedName == "Return") + { + Random rand = new Random(); + view.BackgroundColor = new Color((float)rand.NextDouble(), (float)rand.NextDouble(), (float)rand.NextDouble(), 1); + } + } + return true; } diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/AnimatedImageViewTest.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/AnimatedImageViewTest.cs index b35b7ef..53c1ca4 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/AnimatedImageViewTest.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/AnimatedImageViewTest.cs @@ -149,13 +149,13 @@ namespace Tizen.NUI.Samples root.Add(box); box.image.SetValues(); - box.but1.ClickEvent += But1_ClickEvent; + box.but1.Clicked += But1_Clicked; box.but1.Style.Text.Text = new Selector { Normal = "Pause !", Selected = "Play !" }; - box.but2.ClickEvent += But2_ClickEvent; + box.but2.Clicked += But2_Clicked; box.but2.Style.Text.Text = new Selector { Normal = "Stop !", @@ -175,7 +175,7 @@ namespace Tizen.NUI.Samples box2.image.URLs = list; box2.image.Play(); - box2.but1.ClickEvent += But1_ClickEvent1; + box2.but1.Clicked += But1_Clicked1; box2.but1.Style.Text.Text = new Selector { Normal = "Pause !", @@ -189,7 +189,7 @@ namespace Tizen.NUI.Samples box2.but1.Style.Text.MultiLine = true; - box2.but2.ClickEvent += But2_ClickEvent1; + box2.but2.Clicked += But2_Clicked1; box2.but2.IsSelectable = false; box2.but2.Style.Text.Text = new Selector { @@ -197,7 +197,7 @@ namespace Tizen.NUI.Samples Pressed = "Up 100ms", }; - box2.but3.ClickEvent += But3_ClickEvent; + box2.but3.Clicked += But3_Clicked; box2.but3.IsSelectable = false; box2.but3.Style.Text.Text = new Selector { @@ -208,9 +208,9 @@ namespace Tizen.NUI.Samples } - private void But3_ClickEvent(object sender, Button.ClickEventArgs e) + private void But3_Clicked(object sender, ClickedEventArgs e) { - tlog.Fatal(tag, $"But3_ClickEvent()!"); + tlog.Fatal(tag, $"But3_Clicked()!"); var src = sender as Button; if (src != null) { @@ -220,9 +220,9 @@ namespace Tizen.NUI.Samples } } - private void But2_ClickEvent1(object sender, Button.ClickEventArgs e) + private void But2_Clicked1(object sender, ClickedEventArgs e) { - tlog.Fatal(tag, $"But2_ClickEvent1()!"); + tlog.Fatal(tag, $"But2_Clicked1()!"); var src = sender as Button; if (src != null) { @@ -231,9 +231,9 @@ namespace Tizen.NUI.Samples box2.status.Text = $"playing now, frame delay: {box2.image.FrameDelay}ms, loop count: {box2.image.LoopCount}"; } } - private void But1_ClickEvent1(object sender, Button.ClickEventArgs e) + private void But1_Clicked1(object sender, ClickedEventArgs e) { - tlog.Fatal(tag, $"But1_ClickEvent1()!"); + tlog.Fatal(tag, $"But1_Clicked1()!"); var src = sender as Button; if (src != null) { @@ -253,9 +253,9 @@ namespace Tizen.NUI.Samples } } - private void But2_ClickEvent(object sender, Button.ClickEventArgs e) + private void But2_Clicked(object sender, ClickedEventArgs e) { - tlog.Fatal(tag, $"But2_ClickEvent()!"); + tlog.Fatal(tag, $"But2_Clicked()!"); var src = sender as Button; if (src != null) { @@ -272,9 +272,9 @@ namespace Tizen.NUI.Samples } } - private void But1_ClickEvent(object sender, Button.ClickEventArgs e) + private void But1_Clicked(object sender, ClickedEventArgs e) { - tlog.Fatal(tag, $"But1_ClickEvent()!"); + tlog.Fatal(tag, $"But1_Clicked()!"); var src = sender as Button; if (src != null) { diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ButtonSample.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ButtonSample.cs index 30fd978..517c7c9 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ButtonSample.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ButtonSample.cs @@ -81,7 +81,7 @@ namespace Tizen.NUI.Samples iconButton.Size = new Size(80, 80); iconButton.Icon.ResourceUrl = CommonResource.GetTVResourcePath() + "component/c_radiobutton/c_radiobutton_white_check.png"; parent2.Add(iconButton); - iconButton.ClickEvent += (ojb, e) => { + iconButton.Clicked += (ojb, e) => { var btn = iconButton.Icon.GetParent() as Button; string name = btn.Name; }; diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/CaptureTest.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/CaptureTest.cs index c4e2612..ccf0f33 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/CaptureTest.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/CaptureTest.cs @@ -51,7 +51,7 @@ namespace Tizen.NUI.Samples //checkCaptureNew(); } - private void onCaptureFinished(object sender, CaptureFinishStateEventArgs e) + private void onCaptureFinished(object sender, CaptureFinishedEventArgs e) { log.Debug(tag, $"onCaptureFinished() statue={e.Success} \n"); diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/CubeTransitionEffectSample.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/CubeTransitionEffectSample.cs index 6c2b9ad..435848e 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/CubeTransitionEffectSample.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/CubeTransitionEffectSample.cs @@ -128,7 +128,7 @@ namespace Tizen.NUI.Samples style.PivotPoint = PivotPoint.TopLeft; style.Size = new Size(58, 58); mSlideshowButton = new Button(style); - mSlideshowButton.ClickEvent += OnPushButtonClicked; + mSlideshowButton.Clicked += OnPushButtonClicked; mSlideshowButton.RaiseToTop(); @@ -240,7 +240,7 @@ namespace Tizen.NUI.Samples if (mSlideshowButton) { tool_bar.Remove(mSlideshowButton); - mSlideshowButton.ClickEvent -= OnPushButtonClicked; + mSlideshowButton.Clicked -= OnPushButtonClicked; mSlideshowButton.Dispose(); mSlideshowButton = null; } diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/GridLayoutSample.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/GridLayoutSample.cs index 8e66f7d..10b54e5 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/GridLayoutSample.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/GridLayoutSample.cs @@ -118,8 +118,8 @@ namespace Tizen.NUI.Samples Size = new Size(100, 50), Margin = 10, }; - btn_1.ClickEvent += Btn1_ClickEvent; - btn_2.ClickEvent += Btn2_ClickEvent; + btn_1.Clicked += Btn1_Clicked; + btn_2.Clicked += Btn2_Clicked; bottomView.Add(btn_1); bottomView.Add(btn_2); @@ -149,14 +149,14 @@ namespace Tizen.NUI.Samples Size = new Size(50, 50), Margin = 10, }; - btn_5.ClickEvent += Btn5_ClickEvent; - btn_6.ClickEvent += Btn6_ClickEvent; + btn_5.Clicked += Btn5_Clicked; + btn_6.Clicked += Btn6_Clicked; bottomView_2.Add(btn_5); bottomView_2.Add(btn_6); } - private void Btn1_ClickEvent(object sender, Button.ClickEventArgs e) + private void Btn1_Clicked(object sender, ClickedEventArgs e) { GridLayout layout = new GridLayout(); layout.Columns = 5; @@ -166,7 +166,7 @@ namespace Tizen.NUI.Samples layout.LayoutWithTransition = true; } - private void Btn2_ClickEvent(object sender, Button.ClickEventArgs e) + private void Btn2_Clicked(object sender, ClickedEventArgs e) { GridLayout layout = new GridLayout(); layout.LayoutWithTransition = true; @@ -177,12 +177,12 @@ namespace Tizen.NUI.Samples layoutOption = 2; } - private void Btn5_ClickEvent(object sender, Button.ClickEventArgs e) + private void Btn5_Clicked(object sender, ClickedEventArgs e) { ObjectProcess(true); } - private void Btn6_ClickEvent(object sender, Button.ClickEventArgs e) + private void Btn6_Clicked(object sender, ClickedEventArgs e) { ObjectProcess(false); } diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ItemViewDemo/ItemViewSample.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ItemViewDemo/ItemViewSample.cs index 5fc9425..ee113ed 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ItemViewDemo/ItemViewSample.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ItemViewDemo/ItemViewSample.cs @@ -488,7 +488,7 @@ namespace Tizen.NUI.Samples mEditButton.IsSelectable = true; mEditButton.Size = new Size(34, 34); mEditButton.LeaveRequired = true; - mEditButton.ClickEvent += (obj, e) => + mEditButton.Clicked += (obj, e) => { SwitchToNextMode(); }; @@ -522,7 +522,7 @@ namespace Tizen.NUI.Samples mLayoutButton.IsSelectable = true; mLayoutButton.Size = new Size(34, 34); mLayoutButton.LeaveRequired = true; - mLayoutButton.ClickEvent += (obj, e) => + mLayoutButton.Clicked += (obj, e) => { mCurrentLayout = (mCurrentLayout + 1) % (int)mItemView.GetLayoutCount(); ChangeLayout(); @@ -573,7 +573,7 @@ namespace Tizen.NUI.Samples mDeleteButton.Size = new Size(50, 50); mDeleteButton.LeaveRequired = true; mDeleteButton.Hide(); - mDeleteButton.ClickEvent += (obj, e) => + mDeleteButton.Clicked += (obj, e) => { ItemIdContainer removeList = new ItemIdContainer(); for (uint i = 0; i < mItemView.GetChildCount(); ++i) @@ -616,7 +616,7 @@ namespace Tizen.NUI.Samples mInsertButton.Size = new Size(50, 50); mInsertButton.LeaveRequired = true; mInsertButton.Hide(); - mInsertButton.ClickEvent += (obj, e) => + mInsertButton.Clicked += (obj, e) => { ItemContainer insertList = new ItemContainer(); Random random = new Random(); @@ -659,7 +659,7 @@ namespace Tizen.NUI.Samples mReplaceButton.Size = new Size(50, 50); mReplaceButton.LeaveRequired = true; mReplaceButton.Hide(); - mReplaceButton.ClickEvent += (obj, e) => + mReplaceButton.Clicked += (obj, e) => { ItemContainer replaceList = new ItemContainer(); Random random = new Random(); diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/LoadingSample.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/LoadingSample.cs index d8f25f0..fbc65d9 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/LoadingSample.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/LoadingSample.cs @@ -115,7 +115,7 @@ namespace Tizen.NUI.Samples button[0].BackgroundColor = Color.Green; layout[0].Add(button[0]); button[0].Focusable = true; - button[0].ClickEvent += propFpsAdd; + button[0].Clicked += propFpsAdd; FocusManager.Instance.SetCurrentFocusView(button[0]); button[1] = new Button(); @@ -125,7 +125,7 @@ namespace Tizen.NUI.Samples button[1].BackgroundColor = Color.Green; layout[0].Add(button[1]); button[1].Focusable = true; - button[1].ClickEvent += propFpsMinus; + button[1].Clicked += propFpsMinus; FocusManager.Instance.SetCurrentFocusView(button[1]); gridLayout.Add(layout[0]); diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/PopupSample.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/PopupSample.cs index 177be52..d33830b 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/PopupSample.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/PopupSample.cs @@ -225,7 +225,7 @@ namespace Tizen.NUI.Samples button.WidthSpecification = 580; button.HeightSpecification = 80; button.TextLabel.Text = "LayoutDirection is left to right"; - button.ClickEvent += ButtonClickEvent; + button.Clicked += ButtonClicked; parent1.Add(parent2); parent1.Add(button); @@ -278,7 +278,7 @@ namespace Tizen.NUI.Samples } } - private void ButtonClickEvent(object sender, Button.ClickEventArgs e) + private void ButtonClicked(object sender, ClickedEventArgs e) { if (popup.LayoutDirection == ViewLayoutDirectionType.LTR) { diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ProgressSample.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ProgressSample.cs index ccf5429..2ed312e 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ProgressSample.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ProgressSample.cs @@ -127,7 +127,7 @@ namespace Tizen.NUI.Samples button[0].BackgroundColor = Color.Green; layout[2].Add(button[0]); button[0].Focusable = true; - button[0].ClickEvent += ProgressAdd; + button[0].Clicked += ProgressAdd; button[1] = new Button(); button[1].WidthSpecification = 140; @@ -136,7 +136,7 @@ namespace Tizen.NUI.Samples button[1].BackgroundColor = Color.Green; layout[2].Add(button[1]); button[1].Focusable = true; - button[1].ClickEvent += ProgressMinus; + button[1].Clicked += ProgressMinus; } private void CreateAttrElements() diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/PropertyNotificationTest.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/PropertyNotificationTest.cs index 7789b91..05e16b5 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/PropertyNotificationTest.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/PropertyNotificationTest.cs @@ -41,7 +41,7 @@ namespace Tizen.NUI.Samples Name = "test button", }; - button.ClickEvent += (object source, Button.ClickEventArgs args) => + button.Clicked += (object source, ClickedEventArgs args) => { if (++cnt % 2 == 0) { diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ScrollBarSample.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ScrollBarSample.cs index 4d3d94e..d321a24 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ScrollBarSample.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ScrollBarSample.cs @@ -144,16 +144,16 @@ namespace Tizen.NUI.Samples } button[0].Text = "+"; - button[0].ClickEvent += Scroll1Add; + button[0].Clicked += Scroll1Add; button[1].Text = "-"; - button[1].ClickEvent += Scroll1Minus; + button[1].Clicked += Scroll1Minus; button[2].Text = "+ / - 4"; - button[2].ClickEvent += Scroll1_2move; + button[2].Clicked += Scroll1_2move; button[3].Text = "change direction"; - button[3].ClickEvent += Scroll1_2Changed; + button[3].Clicked += Scroll1_2Changed; button[3].Size = new Size(180, 50); // Set focus to Add Button diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/SiblingOrderTest.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/SiblingOrderTest.cs index c7d35c1..1e95c2b 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/SiblingOrderTest.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/SiblingOrderTest.cs @@ -32,7 +32,7 @@ namespace Tizen.NUI.Samples Position = new Position(10, H1 + 20), Text = "add new child", }; - b1.ClickEvent += B1_ClickEvent; + b1.Clicked += B1_Clicked; win.Add(b1); b2 = new Button() @@ -41,7 +41,7 @@ namespace Tizen.NUI.Samples Position = new Position(10, H1 + 20 + 120), Text = "refresh sibling order", }; - b2.ClickEvent += B2_ClickEvent; + b2.Clicked += B2_Clicked; win.Add(b2); b3 = new Button() @@ -50,7 +50,7 @@ namespace Tizen.NUI.Samples Position = new Position(10, H1 + 20 + 120 + 120), Text = "place children to fit parent", }; - b3.ClickEvent += B3_ClickEvent; + b3.Clicked += B3_Clicked; win.Add(b3); text = new TextLabel() @@ -64,7 +64,7 @@ namespace Tizen.NUI.Samples win.Add(text); } - private void B1_ClickEvent(object sender, Button.ClickEventArgs e) + private void B1_Clicked(object sender, ClickedEventArgs e) { string n = "CH" + (v.ChildCount + 1); var ch = new TextLabel(); @@ -93,7 +93,7 @@ namespace Tizen.NUI.Samples a.Finished += A_Finished; } - private void B2_ClickEvent(object sender, Button.ClickEventArgs e) + private void B2_Clicked(object sender, ClickedEventArgs e) { for(int i=0; i < v.ChildCount; i++) { @@ -105,7 +105,7 @@ namespace Tizen.NUI.Samples } } - private void B3_ClickEvent(object sender, Button.ClickEventArgs e) + private void B3_Clicked(object sender, ClickedEventArgs e) { for (int i = 0; i < v.ChildCount; i++) { @@ -135,9 +135,9 @@ namespace Tizen.NUI.Samples public void Deactivate() { - b1.ClickEvent -= B1_ClickEvent; - b2.ClickEvent -= B2_ClickEvent; - b3.ClickEvent -= B3_ClickEvent; + b1.Clicked -= B1_Clicked; + b2.Clicked -= B2_Clicked; + b3.Clicked -= B3_Clicked; b1.Unparent(); b2.Unparent(); diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/SliderSample.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/SliderSample.cs index 1001a5d..3a4221a 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/SliderSample.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/SliderSample.cs @@ -249,8 +249,8 @@ namespace Tizen.NUI.Samples source.MinValue = MIN_VALUE; source.MaxValue = MAX_VALUE; source.StateChangedEvent += OnStateChanged; - source.ValueChangedEvent += OnValueChanged; - source.SlidingFinishedEvent += OnSlidingFinished; + source.ValueChanged += OnValueChanged; + source.SlidingFinished += OnSlidingFinished; source.Size = new Size(w, h); source.CurrentValue = curValue; return source; @@ -266,14 +266,14 @@ namespace Tizen.NUI.Samples source.MinValue = MIN_VALUE; source.MaxValue = MAX_VALUE; source.StateChangedEvent += OnStateChanged; - source.ValueChangedEvent += OnValueChanged; - source.SlidingFinishedEvent += OnSlidingFinished; + source.ValueChanged += OnValueChanged; + source.SlidingFinished += OnSlidingFinished; source.Size = new Size(w, h); source.CurrentValue = curValue; return source; } - private void OnValueChanged(object sender, Slider.ValueChangedArgs args) + private void OnValueChanged(object sender, SliderValueChangedEventArgs args) { Slider source = sender as Slider; if (source != null) @@ -289,7 +289,7 @@ namespace Tizen.NUI.Samples } } - private void OnSlidingFinished(object sender, Slider.SlidingFinishedArgs args) + private void OnSlidingFinished(object sender, SliderSlidingFinishedEventArgs args) { Slider source = sender as Slider; if (source != null) diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TabSample.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TabSample.cs index 5ab9bd2..0946c27 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TabSample.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TabSample.cs @@ -188,14 +188,14 @@ namespace Tizen.NUI.Samples button = new Button(buttonStyle); button.Size = new Size(500, 80); button.TextLabel.Text = mode[index]; - button.ClickEvent += ButtonClickEvent; + button.Clicked += ButtonClicked; parentView[2].Add(button); // Button of LayoutDirection button2 = new Button(buttonStyle); button2.Size = new Size(500, 80); button2.TextLabel.Text = "LayoutDirection is left to right"; - button2.ClickEvent += ButtonClickEvent2; + button2.Clicked += ButtonClicked2; parentView[2].Add(button2); } @@ -264,7 +264,7 @@ namespace Tizen.NUI.Samples createText[1].Text = "Create Tab just by Style, Selected index from " + e.PreviousIndex + " to " + e.CurrentIndex; } - private void ButtonClickEvent(object sender, Button.ClickEventArgs e) + private void ButtonClicked(object sender, ClickedEventArgs e) { index = (index + 1) % 4; button.TextLabel.Text = mode[index]; @@ -282,7 +282,7 @@ namespace Tizen.NUI.Samples }; } - private void ButtonClickEvent2(object sender, Button.ClickEventArgs e) + private void ButtonClicked2(object sender, ClickedEventArgs e) { if (tab.LayoutDirection == ViewLayoutDirectionType.LTR) { diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TextPageSample.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TextPageSample.cs index d3399c4..f2f5096 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TextPageSample.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TextPageSample.cs @@ -1,7 +1,6 @@ using Tizen.NUI; using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Wearable; +using Tizen.NUI.Utility; using System; using System.IO; @@ -33,20 +32,11 @@ namespace Tizen.NUI.Samples { Window window = NUIApplication.GetDefaultWindow(); - TextLabelStyle attr = new TextLabelStyle - { - - BackgroundColor = Color.Yellow, - TextColor = Color.Blue, - }; - - - label = new TextLabel(attr); + label = new TextLabel(); label.Size = new Size(300, 700); label.PointSize = 11.0f; label.MultiLine = true; - TextPageUtil util = new TextPageUtil(); int pageCount = util.SetText( label, LoadTerms() ); Tizen.Log.Error("NUI", $"pageCount: {pageCount}\n"); diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ToastSample.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ToastSample.cs index 2076a69..d3997f2 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ToastSample.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/ToastSample.cs @@ -121,9 +121,9 @@ namespace Tizen.NUI.Samples parentView[1].Add(button[i]); } button[0].Text = "toast1_1 Show"; - button[0].ClickEvent += toast1_1Show; + button[0].Clicked += toast1_1Show; button[1].Text = "toast2_1 Show"; - button[1].ClickEvent += toast2_1Show; + button[1].Clicked += toast2_1Show; // Set init focus FocusManager.Instance.SetCurrentFocusView(button[0]); diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/WearablePopupTest.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/WearablePopupTest.cs index 93032ec..b930415 100755 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/WearablePopupTest.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/WearablePopupTest.cs @@ -90,8 +90,8 @@ namespace Tizen.NUI.Samples myContent1.ParentOrigin = ParentOrigin.Center; myContent1.PivotPoint = PivotPoint.Center; myPopup1.AppendContent("ContentText", myContent1); - leftButton.ClickEvent += LeftButton_ClickEvent; - rightButton.ClickEvent += RightButton_ClickEvent; + leftButton.Clicked += LeftButton_Clicked; + rightButton.Clicked += RightButton_Clicked; myPopup1.OutsideClicked += Mp_OutsideClicked; myPopup1.ContentContainer.WidthResizePolicy = ResizePolicyType.FitToChildren; @@ -114,12 +114,12 @@ namespace Tizen.NUI.Samples NUIApplication.GetDefaultWindow().Add(t1); } - private void RightButton_ClickEvent(object sender, Button.ClickEventArgs e) + private void RightButton_Clicked(object sender, ClickedEventArgs e) { myPopup1.Dismiss(); } - private void LeftButton_ClickEvent(object sender, Button.ClickEventArgs e) + private void LeftButton_Clicked(object sender, ClickedEventArgs e) { myContent1.TextColor = Color.Yellow; }