/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Tizen.NUI.BaseComponents
{
- #if (NUI_DEBUG_ON)
+#if (NUI_DEBUG_ON)
using tlog = Tizen.Log;
- #endif
+#endif
/// <summary>
/// LottieAnimationView renders an animated vector image (Lottie file).
currentStates.changed = false;
currentStates.totalFrame = -1;
currentStates.scale = scale;
+ currentStates.redrawInScalingDown = true;
SetVisible(shown);
}
}
/// <summary>
- /// Sets or gets the loop count.
+ /// Sets or gets the loop count.
/// </summary>
/// <remarks>
/// The minus value means the infinite loop count.
return currentStates.stopEndAction;
}
}
+
+ /// <summary>
+ /// Whether to redraw the image when the visual is scaled down.
+ /// </summary>
+ /// <remarks>
+ /// Inhouse API.
+ /// It is used in the AnimatedVectorImageVisual.The default is true.
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool RedrawInScalingDown
+ {
+ set
+ {
+ currentStates.changed = true;
+ currentStates.redrawInScalingDown = value;
+ tlog.Fatal(tag, $"<[{GetId()}]SET currentStates.redrawInScalingDown={currentStates.redrawInScalingDown}>");
+ PropertyMap map = new PropertyMap();
+ map.Add(ImageVisualProperty.RedrawInScalingDown, new PropertyValue(currentStates.redrawInScalingDown));
+ DoAction(ImageView.Property.IMAGE, (int)actionType.updateProperty, new PropertyValue(map));
+ }
+ get
+ {
+ PropertyMap map = base.Image;
+ var ret = true;
+ if (map != null)
+ {
+ PropertyValue val = map.Find(ImageVisualProperty.RedrawInScalingDown);
+ if (val != null)
+ {
+ if (val.Get(out ret))
+ {
+ if (ret != currentStates.redrawInScalingDown)
+ {
+ tlog.Fatal(tag, $"<[ERROR][{GetId()}](LottieAnimationView) different redrawInScalingDown! gotten={ret}, redrawInScalingDown={currentStates.redrawInScalingDown}>");
+ }
+ currentStates.redrawInScalingDown = ret;
+ return currentStates.redrawInScalingDown;
+ }
+ }
+ }
+ Tizen.Log.Error(tag, $"<[ERROR][{GetId()}](LottieAnimationView) Fail to get redrawInScalingDown from dali currentStates.redrawInScalingDown={currentStates.redrawInScalingDown}>");
+ return currentStates.redrawInScalingDown;
+ }
+ }
#endregion Property
}
/// <summary>
- /// A marker has its start frame and end frame.
+ /// A marker has its start frame and end frame.
/// Animation will play between the start frame and the end frame of the marker if one marker is specified.
/// Or animation will play between the start frame of the first marker and the end frame of the second marker if two markers are specified. *
/// </summary>
internal PlayStateType playState;
internal List<Tuple<string, int, int>> contentInfo;
internal string mark1, mark2;
+ internal bool redrawInScalingDown;
};
private states currentStates;
private void debugPrint()
{
tlog.Fatal(tag, $"===================================");
- tlog.Fatal(tag, $"<[{GetId()}] get currentStates : url={currentStates.url}, loopCount={currentStates.loopCount}, framePlayRangeMin/Max({currentStates.framePlayRangeMin},{currentStates.framePlayRangeMax}) ");
- tlog.Fatal(tag, $" get from Property : StopBehavior={StopBehavior}, LoopMode={LoopingMode}, LoopCount={LoopCount}, PlayState={PlayState} >");
+ tlog.Fatal(tag, $"<[{GetId()}] get currentStates : url={currentStates.url}, loopCount={currentStates.loopCount}, \nframePlayRangeMin/Max({currentStates.framePlayRangeMin},{currentStates.framePlayRangeMax}) ");
+ tlog.Fatal(tag, $" get from Property : StopBehavior={StopBehavior}, LoopMode={LoopingMode}, LoopCount={LoopCount}, PlayState={PlayState}");
+ tlog.Fatal(tag, $" RedrawInScalingDown={RedrawInScalingDown} >");
tlog.Fatal(tag, $"===================================");
}
#endregion Private
private bool BeReadyToShow(LottieAnimationView lottieView)
{
// Validate input lottieView
- if (null== lottieView || lottieView.PlayState == LottieAnimationView.PlayStateType.Invalid)
+ if (null == lottieView || lottieView.PlayState == LottieAnimationView.PlayStateType.Invalid)
{
return false;
}