There was some bug when we try to get TotalFrame when async load json file.
DALi engine side default total frame number is 0, and NUI is -1.
So, if we try to get TotalFrame from dali which is still loading, it will
cache the internal total frame as 0. After than, we can never get valid value.
To avoid this problem, we have 2 choice
1. Wait until async load finished, and then get total frame at dali side.
2. Just get 0 for now, and try again when total frame cached as 0.
Solution 1 need some time to resolve it. So now just make 2.
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
get
{
int ret = currentStates.totalFrame;
get
{
int ret = currentStates.totalFrame;
{
Interop.View.InternalRetrievingVisualPropertyInt(this.SwigCPtr, ImageView.Property.IMAGE, ImageVisualProperty.TotalFrameNumber, out ret);
{
Interop.View.InternalRetrievingVisualPropertyInt(this.SwigCPtr, ImageView.Property.IMAGE, ImageVisualProperty.TotalFrameNumber, out ret);
public void Activate()
{
lav = new LottieAnimationView();
public void Activate()
{
lav = new LottieAnimationView();
+ lav.SynchronousLoading = false;
lav.URL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "a.json";
lav.LoopCount = -1;
lav.BackgroundColor = Color.White;
NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(lav);
lav.URL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "a.json";
lav.LoopCount = -1;
lav.BackgroundColor = Color.White;
NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(lav);
+ Tizen.Log.Error("NUI", $"Total frame before resource ready : {lav.TotalFrame} / might be 0 if still load images. or, might be valid value if load finished during above logic running.\n");
+
+ lav.ResourceReady += (o, e) =>
+ {
+ if (lav.LoadingStatus == ImageView.LoadingStatusType.Failed)
+ {
+ Tizen.Log.Error("NUI", $"Load failed!\n");
+ }
+ else
+ {
+ Tizen.Log.Error("NUI", $"Total frame after resource ready : {lav.TotalFrame}\n");
+ lav.Play();
+ }
+ };
}
public void Deactivate()
{
}
public void Deactivate()
{