From 372c241de854d7b3da99a15c1167ef2912c4568d Mon Sep 17 00:00:00 2001 From: Eunki Hong Date: Wed, 26 Jul 2023 01:49:52 +0900 Subject: [PATCH] [NUI] Make Action id as internal static readonly Since we share the same action id for each Play / Pause / etc, we don't need to consider overwrite the action id now. Signed-off-by: Eunki Hong --- .../src/public/BaseComponents/AnimatedImageView.cs | 14 ++++--------- .../src/public/BaseComponents/ImageView.cs | 14 ++++--------- .../public/BaseComponents/LottieAnimationView.cs | 24 ++++++++-------------- .../src/public/BaseComponents/ViewEnum.cs | 4 +--- 4 files changed, 17 insertions(+), 39 deletions(-) diff --git a/src/Tizen.NUI/src/public/BaseComponents/AnimatedImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/AnimatedImageView.cs index e8ac7c7..13254f5 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/AnimatedImageView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/AnimatedImageView.cs @@ -28,6 +28,10 @@ namespace Tizen.NUI.BaseComponents public partial class AnimatedImageView : ImageView { #region Internal + /// + /// Actions property value to Jump to the specified frame. + /// + internal static readonly int ActionJumpTo = Interop.AnimatedImageView.AnimatedImageVisualActionJumpToGet(); #endregion Internal #region Private @@ -50,9 +54,6 @@ namespace Tizen.NUI.BaseComponents [EditorBrowsable(EditorBrowsableState.Never)] public AnimatedImageView() : base() { - ActionPlay = Interop.AnimatedImageView.AnimatedImageVisualActionPlayGet(); - ActionPause = Interop.AnimatedImageView.AnimatedImageVisualActionPauseGet(); - ActionStop = Interop.AnimatedImageView.AnimatedImageVisualActionStopGet(); } /// @@ -355,13 +356,6 @@ namespace Tizen.NUI.BaseComponents return ret; } } - - /// - /// Actions property value to Jump to the specified frame. - /// This property can be redefined by child class if it use different value. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - protected int ActionJumpTo { get; set; } = Interop.AnimatedImageView.AnimatedImageVisualActionJumpToGet(); #endregion Property #region Method diff --git a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs index b552ea5..af61687 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs @@ -891,28 +891,22 @@ namespace Tizen.NUI.BaseComponents /// /// Actions property value for Reload image. /// - private int ActionReload { get; set; } = Interop.ImageView.ImageVisualActionReloadGet(); + internal static readonly int ActionReload = Interop.ImageView.ImageVisualActionReloadGet(); /// /// Actions property value to Play animated images. - /// This property can be redefined by child class if it use different value. /// - [EditorBrowsable(EditorBrowsableState.Never)] - protected int ActionPlay { get; set; } = Interop.AnimatedImageView.AnimatedImageVisualActionPlayGet(); + internal static readonly int ActionPlay = Interop.AnimatedImageView.AnimatedImageVisualActionPlayGet(); /// /// Actions property value to Pause animated images. - /// This property can be redefined by child class if it use different value. /// - [EditorBrowsable(EditorBrowsableState.Never)] - protected int ActionPause { get; set; } = Interop.AnimatedImageView.AnimatedImageVisualActionPauseGet(); + internal static readonly int ActionPause = Interop.AnimatedImageView.AnimatedImageVisualActionPauseGet(); /// /// Actions property value to Stop animated images. - /// This property can be redefined by child class if it use different value. /// - [EditorBrowsable(EditorBrowsableState.Never)] - protected int ActionStop { get; set; } = Interop.AnimatedImageView.AnimatedImageVisualActionStopGet(); + internal static readonly int ActionStop = Interop.AnimatedImageView.AnimatedImageVisualActionStopGet(); internal VisualFittingModeType ConvertFittingModetoVisualFittingMode(FittingModeType value) { diff --git a/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs b/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs index 31d8826..f73cc2d 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs @@ -49,10 +49,6 @@ namespace Tizen.NUI.BaseComponents /// 7 public LottieAnimationView(float scale = 1.0f, bool shown = true) : base() { - ActionPlay = Interop.LottieAnimationView.AnimatedVectorImageVisualActionPlayGet(); - ActionPause = Interop.LottieAnimationView.AnimatedVectorImageVisualActionPauseGet(); - ActionStop = Interop.LottieAnimationView.AnimatedVectorImageVisualActionStopGet(); - NUILog.Debug($"< constructor GetId={GetId()} >"); currentStates.url = ""; currentStates.loopCount = 1; @@ -442,18 +438,6 @@ namespace Tizen.NUI.BaseComponents return currentStates.redrawInScalingDown; } } - - - /// - /// Actions property value to Jump to the specified frame. - /// This property can be redefined by child class if it use different value. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - protected int ActionJumpTo { get; set; } = Interop.LottieAnimationView.AnimatedVectorImageVisualActionJumpToGet(); - - // This is used for internal purpose. hidden API. - [EditorBrowsable(EditorBrowsableState.Never)] - protected int ActionSetDynamicProperty { get; set; } = Interop.LottieAnimationView.AnimatedVectorImageVisualActionSetDynamicProperty(); #endregion Property @@ -916,6 +900,14 @@ namespace Tizen.NUI.BaseComponents #region Internal + /// + /// Actions property value to Jump to the specified frame. + /// + internal static readonly int ActionJumpTo = Interop.LottieAnimationView.AnimatedVectorImageVisualActionJumpToGet(); + + // This is used for internal purpose. + internal static readonly int ActionSetDynamicProperty = Interop.LottieAnimationView.AnimatedVectorImageVisualActionSetDynamicProperty(); + internal class VisualEventSignalArgs : EventArgs { public int VisualIndex diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewEnum.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewEnum.cs index 825e27d..639bd54 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewEnum.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewEnum.cs @@ -166,10 +166,8 @@ namespace Tizen.NUI.BaseComponents /// /// Actions property value to update visual property. /// Note : Only few kind of properies can be update. Update with invalid property action is undefined. - /// This property can be redefined by child class if it use different value. /// - [EditorBrowsable(EditorBrowsableState.Never)] - protected int ActionUpdateProperty { get; set; } = Interop.Visual.GetActionUpdateProperty(); + internal static readonly int ActionUpdateProperty = Interop.Visual.GetActionUpdateProperty(); internal enum PropertyRange { -- 2.7.4