Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[NUI] add asynchronous tasked animation play" #6683

Open
wants to merge 1 commit into
base: DevelNUI
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions src/Tizen.NUI/src/public/Animation/Animation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ namespace Tizen.NUI
using System.Reflection;
using System.Globalization;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;

using Tizen.NUI.BaseComponents;

Expand Down Expand Up @@ -63,7 +61,6 @@ public class Animation : BaseHandle
private System.IntPtr finishedCallbackOfNative;

private AnimationProgressReachedEventCallbackType animationProgressReachedEventCallback;
private TaskCompletionSource animationTaskCompletionSource;

private string[] properties = null;
private string[] destValue = null;
Expand Down Expand Up @@ -1351,13 +1348,6 @@ public void Clear()
{
Interop.Animation.Clear(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();

if (animationTaskCompletionSource != null)
{
animationTaskCompletionSource.SetCanceled();
animationTaskCompletionSource = null;
}

}

internal object ConvertTo(object value, Type toType)
Expand All @@ -1375,33 +1365,6 @@ internal object ConvertTo(object value, Type toType)
return ConvertTo(value, toType, getConverter);
}

/// <summary>
/// Plays the animation asynchronously.
/// </summary>
/// <returns>A Task that completes when the animation finishes.</returns>
internal Task PlayAsync()
{
if (DisableAnimation)
{
return Task.FromCanceled(CancellationToken.None);
}

if (animationTaskCompletionSource != null)
{
animationTaskCompletionSource.SetCanceled();
}
animationTaskCompletionSource = new TaskCompletionSource();
void finished(object sender, EventArgs e)
{
Finished -= finished;
animationTaskCompletionSource.SetResult();
animationTaskCompletionSource = null;
}
Finished += finished;
Play();
return animationTaskCompletionSource.Task;
}

internal object ConvertTo(object value, Type toType, Func<object> getConverter)
{
if (value == null)
Expand Down
Loading