Skip to content

Commit

Permalink
[NUI] Make Action id as internal static readonly
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Eunki Hong committed Jul 25, 2023
1 parent 10522fe commit edd6be6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 36 deletions.
14 changes: 4 additions & 10 deletions src/Tizen.NUI/src/public/BaseComponents/AnimatedImageView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ namespace Tizen.NUI.BaseComponents
public partial class AnimatedImageView : ImageView
{
#region Internal
/// <summary>
/// Actions property value to Jump to the specified frame.
/// </summary>
internal static readonly int ActionJumpTo = Interop.AnimatedImageView.AnimatedImageVisualActionJumpToGet();
#endregion Internal

#region Private
Expand All @@ -50,9 +54,6 @@ public partial class AnimatedImageView : ImageView
[EditorBrowsable(EditorBrowsableState.Never)]
public AnimatedImageView() : base()
{
ActionPlay = Interop.AnimatedImageView.AnimatedImageVisualActionPlayGet();
ActionPause = Interop.AnimatedImageView.AnimatedImageVisualActionPauseGet();
ActionStop = Interop.AnimatedImageView.AnimatedImageVisualActionStopGet();
}

/// <summary>
Expand Down Expand Up @@ -355,13 +356,6 @@ private int InternalCurrentFrame
return ret;
}
}

/// <summary>
/// Actions property value to Jump to the specified frame.
/// This property can be redefined by child class if it use different value.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected int ActionJumpTo { get; set; } = Interop.AnimatedImageView.AnimatedImageVisualActionJumpToGet();
#endregion Property

#region Method
Expand Down
14 changes: 4 additions & 10 deletions src/Tizen.NUI/src/public/BaseComponents/ImageView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -891,28 +891,22 @@ private bool InternalCropToMask
/// <summary>
/// Actions property value for Reload image.
/// </summary>
private int ActionReload { get; set; } = Interop.ImageView.ImageVisualActionReloadGet();
internal static readonly int ActionReload = Interop.ImageView.ImageVisualActionReloadGet();

/// <summary>
/// Actions property value to Play animated images.
/// This property can be redefined by child class if it use different value.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected int ActionPlay { get; set; } = Interop.AnimatedImageView.AnimatedImageVisualActionPlayGet();
internal static readonly int ActionPlay = Interop.AnimatedImageView.AnimatedImageVisualActionPlayGet();

/// <summary>
/// Actions property value to Pause animated images.
/// This property can be redefined by child class if it use different value.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected int ActionPause { get; set; } = Interop.AnimatedImageView.AnimatedImageVisualActionPauseGet();
internal static readonly int ActionPause = Interop.AnimatedImageView.AnimatedImageVisualActionPauseGet();

/// <summary>
/// Actions property value to Stop animated images.
/// This property can be redefined by child class if it use different value.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected int ActionStop { get; set; } = Interop.AnimatedImageView.AnimatedImageVisualActionStopGet();
internal static readonly int ActionStop = Interop.AnimatedImageView.AnimatedImageVisualActionStopGet();

internal VisualFittingModeType ConvertFittingModetoVisualFittingMode(FittingModeType value)
{
Expand Down
24 changes: 8 additions & 16 deletions src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ public partial class LottieAnimationView : ImageView
/// <since_tizen> 7 </since_tizen>
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;
Expand Down Expand Up @@ -442,18 +438,6 @@ private bool InternalRedrawInScalingDown
return currentStates.redrawInScalingDown;
}
}


/// <summary>
/// Actions property value to Jump to the specified frame.
/// This property can be redefined by child class if it use different value.
/// </summary>
[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


Expand Down Expand Up @@ -916,6 +900,14 @@ public enum VectorProperty


#region Internal
/// <summary>
/// Actions property value to Jump to the specified frame.
/// </summary>
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
Expand Down

0 comments on commit edd6be6

Please sign in to comment.