Skip to content

Commit

Permalink
[NUI] LottieAnimationViewBindableProperty changes (Samsung#6076)
Browse files Browse the repository at this point in the history
  • Loading branch information
Clarik authored and dongsug-song committed Apr 22, 2024
1 parent 6db65c2 commit cc6d360
Show file tree
Hide file tree
Showing 2 changed files with 179 additions and 42 deletions.
144 changes: 130 additions & 14 deletions src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
using System.ComponentModel;
using System.Collections.Generic;
using System.Globalization;
using Tizen.NUI;
using Tizen.NUI.Binding;

namespace Tizen.NUI.BaseComponents
{
Expand All @@ -29,6 +31,22 @@ namespace Tizen.NUI.BaseComponents
/// <since_tizen> 7 </since_tizen>
public partial class LottieAnimationView : ImageView
{
static LottieAnimationView()
{
URLProperty = BindableProperty.Create(nameof(URL), typeof(string), typeof(Tizen.NUI.BaseComponents.LottieAnimationView), string.Empty, propertyChanged: SetInternalURLProperty, defaultValueCreator: GetInternalURLProperty);

CurrentFrameProperty = BindableProperty.Create(nameof(CurrentFrame), typeof(int), typeof(Tizen.NUI.BaseComponents.LottieAnimationView), 0, propertyChanged: SetInternalCurrentFrameProperty, defaultValueCreator: GetInternalCurrentFrameProperty);

LoopingModeProperty = BindableProperty.Create(nameof(LoopingMode), typeof(LoopingModeType), typeof(LottieAnimationView), default(LoopingModeType), propertyChanged: SetInternalLoopingModeProperty, defaultValueCreator: GetInternalLoopingModeProperty);

LoopCountProperty = BindableProperty.Create(nameof(LoopCount), typeof(int), typeof(Tizen.NUI.BaseComponents.LottieAnimationView), 0, propertyChanged: SetInternalLoopCountProperty, defaultValueCreator: GetInternalLoopCountProperty);

StopBehaviorProperty = BindableProperty.Create(nameof(StopBehavior), typeof(StopBehaviorType), typeof(LottieAnimationView), default(StopBehaviorType), propertyChanged: SetInternalStopBehaviorProperty, defaultValueCreator: GetInternalStopBehaviorProperty);

RedrawInScalingDownProperty = BindableProperty.Create(nameof(RedrawInScalingDown), typeof(bool), typeof(Tizen.NUI.BaseComponents.LottieAnimationView), false, propertyChanged: SetInternalRedrawInScalingDownProperty, defaultValueCreator: GetInternalRedrawInScalingDownProperty);

EnableFrameCacheProperty = BindableProperty.Create(nameof(EnableFrameCache), typeof(bool), typeof(Tizen.NUI.BaseComponents.LottieAnimationView), false, propertyChanged: SetInternalEnableFrameCacheProperty, defaultValueCreator: GetInternalEnableFrameCacheProperty);
}

#region Constructor, Destructor, Dispose
/// <summary>
Expand Down Expand Up @@ -123,11 +141,25 @@ public string URL
{
get
{
return GetValue(URLProperty) as string;
if (NUIApplication.IsUsingXaml)
{
return GetValue(URLProperty) as string;
}
else
{
return GetInternalURLProperty(this) as string;
}
}
set
{
SetValue(URLProperty, value);
if (NUIApplication.IsUsingXaml)
{
SetValue(URLProperty, value);
}
else
{
SetInternalURLProperty(this, null, value);
}
NotifyPropertyChanged();
}
}
Expand Down Expand Up @@ -349,11 +381,25 @@ public int CurrentFrame
{
get
{
return (int)GetValue(CurrentFrameProperty);
if (NUIApplication.IsUsingXaml)
{
return (int)GetValue(CurrentFrameProperty);
}
else
{
return (int) GetInternalCurrentFrameProperty(this);
}
}
set
{
SetValue(CurrentFrameProperty, value);
if (NUIApplication.IsUsingXaml)
{
SetValue(CurrentFrameProperty, value);
}
else
{
SetInternalCurrentFrameProperty(this, null, value);
}
NotifyPropertyChanged();
}
}
Expand Down Expand Up @@ -385,11 +431,25 @@ public LoopingModeType LoopingMode
{
get
{
return (LoopingModeType)GetValue(LoopingModeProperty);
if (NUIApplication.IsUsingXaml)
{
return (LoopingModeType)GetValue(LoopingModeProperty);
}
else
{
return (LoopingModeType)GetInternalLoopingModeProperty(this);
}
}
set
{
SetValue(LoopingModeProperty, value);
if (NUIApplication.IsUsingXaml)
{
SetValue(LoopingModeProperty, value);
}
else
{
SetInternalLoopingModeProperty(this, null, value);
}
NotifyPropertyChanged();
}
}
Expand Down Expand Up @@ -438,11 +498,25 @@ public int LoopCount
{
get
{
return (int)GetValue(LoopCountProperty);
if (NUIApplication.IsUsingXaml)
{
return (int)GetValue(LoopCountProperty);
}
else
{
return (int)GetInternalLoopCountProperty(this);
}
}
set
{
SetValue(LoopCountProperty, value);
if (NUIApplication.IsUsingXaml)
{
SetValue(LoopCountProperty, value);
}
else
{
SetInternalLoopCountProperty(this, null, value);
}
NotifyPropertyChanged();
}
}
Expand Down Expand Up @@ -476,11 +550,25 @@ public StopBehaviorType StopBehavior
{
get
{
return (StopBehaviorType)GetValue(StopBehaviorProperty);
if (NUIApplication.IsUsingXaml)
{
return (StopBehaviorType)GetValue(StopBehaviorProperty);
}
else
{
return (StopBehaviorType)GetInternalStopBehaviorProperty(this);
}
}
set
{
SetValue(StopBehaviorProperty, value);
if (NUIApplication.IsUsingXaml)
{
SetValue(StopBehaviorProperty, value);
}
else
{
SetInternalStopBehaviorProperty(this, null, value);
}
NotifyPropertyChanged();
}
}
Expand Down Expand Up @@ -518,11 +606,25 @@ public bool RedrawInScalingDown
{
get
{
return (bool)GetValue(RedrawInScalingDownProperty);
if (NUIApplication.IsUsingXaml)
{
return (bool)GetValue(RedrawInScalingDownProperty);
}
else
{
return (bool)GetInternalRedrawInScalingDownProperty(this);
}
}
set
{
SetValue(RedrawInScalingDownProperty, value);
if (NUIApplication.IsUsingXaml)
{
SetValue(RedrawInScalingDownProperty, value);
}
else
{
SetInternalRedrawInScalingDownProperty(this, null, value);
}
NotifyPropertyChanged();
}
}
Expand Down Expand Up @@ -554,11 +656,25 @@ public bool EnableFrameCache
{
get
{
return (bool)GetValue(EnableFrameCacheProperty);
if (NUIApplication.IsUsingXaml)
{
return (bool)GetValue(EnableFrameCacheProperty);
}
else
{
return (bool)GetInternalEnableFrameCacheProperty(this);
}
}
set
{
SetValue(EnableFrameCacheProperty, value);
if (NUIApplication.IsUsingXaml)
{
SetValue(EnableFrameCacheProperty, value);
}
else
{
SetInternalEnableFrameCacheProperty(this, null, value);
}
NotifyPropertyChanged();
}
}
Expand Down
Loading

0 comments on commit cc6d360

Please sign in to comment.