private AnimatedImageVisual imageVisual = null;
private int frameRate = (int)(1000 / 16.6f);
- internal new class Property
- {
- internal static readonly int ActionPlay = Interop.ImageView.ImageVisualActionPlayGet();
- internal static readonly int ActionPause = Interop.ImageView.ImageVisualActionPauseGet();
- internal static readonly int ActionStop = Interop.ImageView.ImageVisualActionStopGet();
- }
+
+ /// <summary>
+ /// Actions value to Play animated images.
+ /// </summary>
+ private static int ActionPlay = Interop.AnimatedImageView.AnimatedImageVisualActionPlayGet();
+
+ /// <summary>
+ /// Actions value to Pause animated images.
+ /// </summary>
+ private static int ActionPause = Interop.AnimatedImageView.AnimatedImageVisualActionPauseGet();
+
+ /// <summary>
+ /// Actions value to Stop animated images.
+ /// </summary>
+ private static int ActionStop = Interop.AnimatedImageView.AnimatedImageVisualActionStopGet();
static Loading() { }
public void Play()
{
PropertyValue attributes = new PropertyValue(0);
- this.DoAction(imageVisual.VisualIndex, Property.ActionPlay, attributes);
+ this.DoAction(imageVisual.VisualIndex, ActionPlay, attributes);
attributes.Dispose();
}
public void Pause()
{
PropertyValue attributes = new PropertyValue(0);
- this.DoAction(imageVisual.VisualIndex, Property.ActionPause, attributes);
+ this.DoAction(imageVisual.VisualIndex, ActionPause, attributes);
attributes.Dispose();
}
public void Stop()
{
PropertyValue attributes = new PropertyValue(0);
- this.DoAction(imageVisual.VisualIndex, Property.ActionStop, attributes);
+ this.DoAction(imageVisual.VisualIndex, ActionStop, attributes);
attributes.Dispose();
}
--- /dev/null
+/*
+ * Copyright(c) 2021 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+namespace Tizen.NUI
+{
+ internal static partial class Interop
+ {
+ internal static partial class AnimatedImageView
+ {
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AnimatedImageVisual_Actions_PLAY_get")]
+ public static extern int AnimatedImageVisualActionPlayGet();
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AnimatedImageVisual_Actions_PAUSE_get")]
+ public static extern int AnimatedImageVisualActionPauseGet();
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AnimatedImageVisual_Actions_STOP_get")]
+ public static extern int AnimatedImageVisualActionStopGet();
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AnimatedImageVisual_Actions_JUMP_TO_get")]
+ public static extern int AnimatedImageVisualActionJumpToGet();
+ }
+ }
+}
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ImageView_SWIGUpcast")]
public static extern global::System.IntPtr Upcast(global::System.IntPtr jarg1);
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_ImageView_IMAGE_VISUAL_ACTION_RELOAD_get")]
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_ImageVisual_Actions_RELOAD_get")]
public static extern int ImageVisualActionReloadGet();
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_ImageView_IMAGE_VISUAL_ACTION_PLAY_get")]
- public static extern int ImageVisualActionPlayGet();
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_ImageView_IMAGE_VISUAL_ACTION_PAUSE_get")]
- public static extern int ImageVisualActionPauseGet();
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_ImageView_IMAGE_VISUAL_ACTION_STOP_get")]
- public static extern int ImageVisualActionStopGet();
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ImageView_New__SWIG_0")]
public static extern global::System.IntPtr ImageView_New__SWIG_0();
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_ImageView")]
public static extern void delete_ImageView(global::System.Runtime.InteropServices.HandleRef jarg1);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ImageView_Property_IMAGE_get")]
- public static extern int ImageView_Property_IMAGE_get();
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ImageView_Property_PRE_MULTIPLIED_ALPHA_get")]
- public static extern int ImageView_Property_PRE_MULTIPLIED_ALPHA_get();
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ImageView_Property_PIXEL_AREA_get")]
- public static extern int ImageView_Property_PIXEL_AREA_get();
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_ImageView_IMAGE_VISUAL_ACTION_RELOAD_get")]
- public static extern int ImageView_IMAGE_VISUAL_ACTION_RELOAD_get();
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_ImageView_IMAGE_VISUAL_ACTION_PLAY_get")]
- public static extern int ImageView_IMAGE_VISUAL_ACTION_PLAY_get();
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_ImageView_IMAGE_VISUAL_ACTION_PAUSE_get")]
- public static extern int ImageView_IMAGE_VISUAL_ACTION_PAUSE_get();
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_ImageView_IMAGE_VISUAL_ACTION_STOP_get")]
- public static extern int ImageView_IMAGE_VISUAL_ACTION_STOP_get();
}
}
}
--- /dev/null
+/*
+ * Copyright(c) 2021 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+namespace Tizen.NUI
+{
+ internal static partial class Interop
+ {
+ internal static partial class LottieAnimationView
+ {
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AnimatedVectorImageVisual_Actions_PLAY_get")]
+ public static extern int AnimatedVectorImageVisualActionPlayGet();
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AnimatedVectorImageVisual_Actions_PAUSE_get")]
+ public static extern int AnimatedVectorImageVisualActionPauseGet();
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AnimatedVectorImageVisual_Actions_STOP_get")]
+ public static extern int AnimatedVectorImageVisualActionStopGet();
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AnimatedVectorImageVisual_Actions_JUMP_TO_get")]
+ public static extern int AnimatedVectorImageVisualActionJumpToGet();
+ }
+ }
+}
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Image_Visual_BORDER_get")]
public static extern int ImageVisualBorderGet();
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Visual_Actions_UPDATE_PROPERTY_get")]
+ public static extern int GetActionUpdateProperty();
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class AnimatedImageView : ImageView
{
+ #region Internal
+ #endregion Internal
+
+ #region Private
+ private string url = "";
+ private List<string> resourceURLs = new List<string>();
+ private int batchSize = 1;
+ private int cacheSize = 1;
+ private int frameDelay = 0;
+ private int loopCount = -1;
+ private bool dirtyFlag = false;
+ private StopBehaviorType stopBehavior;
+ private PropertyMap propertyMap;
+ #endregion Private
+
#region Constructor, Destructor, Dispose
/// <summary>
/// Construct AnimatedImageView
[EditorBrowsable(EditorBrowsableState.Never)]
public AnimatedImageView() : base()
{
+ ActionPlay = Interop.AnimatedImageView.AnimatedImageVisualActionPlayGet();
+ ActionPause = Interop.AnimatedImageView.AnimatedImageVisualActionPauseGet();
+ ActionStop = Interop.AnimatedImageView.AnimatedImageVisualActionStopGet();
+
dirtyFlag = true;
}
{
set
{
- DoAction(ImageView.Property.IMAGE, (int)ActionType.jumpTo, new PropertyValue(value));
+ DoAction(ImageView.Property.IMAGE, ActionJumpTo, new PropertyValue(value));
}
get
{
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>
+ protected internal int ActionJumpTo { get; set; } = Interop.AnimatedImageView.AnimatedImageVisualActionJumpToGet();
#endregion Property
#region Method
MaximumFrame
}
- private enum ActionType
- {
- play,
- pause,
- stop,
- jumpTo,
- };
#endregion Event, Enum, Struct, ETC
-
-
- #region Internal
- #endregion Internal
-
-
- #region Private
- private string url = "";
- private List<string> resourceURLs = new List<string>();
- private int batchSize = 1;
- private int cacheSize = 1;
- private int frameDelay = 0;
- private int loopCount = -1;
- private bool dirtyFlag = false;
- private StopBehaviorType stopBehavior;
- private PropertyMap propertyMap;
- #endregion Private
}
}
public void Reload()
{
PropertyValue attributes = new PropertyValue(0);
- this.DoAction(ImageView.Property.IMAGE, Property.ActionReload, attributes);
+ this.DoAction(ImageView.Property.IMAGE, ActionReload, attributes);
attributes?.Dispose();
}
public void Play()
{
PropertyValue attributes = new PropertyValue(0);
- this.DoAction(ImageView.Property.IMAGE, Property.ActionPlay, attributes);
+ this.DoAction(ImageView.Property.IMAGE, ActionPlay, attributes);
attributes?.Dispose();
}
public void Pause()
{
PropertyValue attributes = new PropertyValue(0);
- this.DoAction(ImageView.Property.IMAGE, Property.ActionPause, attributes);
+ this.DoAction(ImageView.Property.IMAGE, ActionPause, attributes);
attributes?.Dispose();
}
public void Stop()
{
PropertyValue attributes = new PropertyValue(0);
- this.DoAction(ImageView.Property.IMAGE, Property.ActionStop, attributes);
+ this.DoAction(ImageView.Property.IMAGE, ActionStop, attributes);
attributes?.Dispose();
}
}
}
+ /// <summary>
+ /// Actions property value for Reload image.
+ /// </summary>
+ private int ActionReload { get; set; } = 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>
+ protected internal int ActionPlay { get; set; } = 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>
+ protected internal int ActionPause { get; set; } = 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>
+ protected internal int ActionStop { get; set; } = Interop.AnimatedImageView.AnimatedImageVisualActionStopGet();
+
internal VisualFittingModeType ConvertFittingModetoVisualFittingMode(FittingModeType value)
{
switch (value)
internal static readonly int IMAGE = Interop.ImageView.ImageGet();
internal static readonly int PreMultipliedAlpha = Interop.ImageView.PreMultipliedAlphaGet();
internal static readonly int PixelArea = Interop.ImageView.PixelAreaGet();
- internal static readonly int ActionReload = Interop.ImageView.ImageVisualActionReloadGet();
- internal static readonly int ActionPlay = Interop.ImageView.ImageVisualActionPlayGet();
- internal static readonly int ActionPause = Interop.ImageView.ImageVisualActionPauseGet();
- internal static readonly int ActionStop = Interop.ImageView.ImageVisualActionStopGet();
}
private enum ImageType
/// <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.frame = -1;
{
currentStates.frame = value;
NUILog.Debug($"<[{GetId()}]SET frame={currentStates.frame}>");
- DoAction(ImageView.Property.IMAGE, (int)actionType.jumpTo, new PropertyValue(currentStates.frame));
+ DoAction(ImageView.Property.IMAGE, ActionJumpTo, new PropertyValue(currentStates.frame));
}
get
{
NUILog.Debug($"<[{GetId()}] SET loopMode={currentStates.loopMode}>");
PropertyMap map = new PropertyMap();
map.Add(ImageVisualProperty.LoopingMode, new PropertyValue((int)currentStates.loopMode));
- DoAction(ImageView.Property.IMAGE, (int)actionType.updateProperty, new PropertyValue(map));
+ DoAction(ImageView.Property.IMAGE, Interop.Visual.GetActionUpdateProperty(), new PropertyValue(map));
}
get
{
NUILog.Debug($"<[{GetId()}]SET currentStates.loopCount={currentStates.loopCount}>");
PropertyMap map = new PropertyMap();
map.Add(ImageVisualProperty.LoopCount, new PropertyValue(currentStates.loopCount));
- DoAction(ImageView.Property.IMAGE, (int)actionType.updateProperty, new PropertyValue(map));
+ DoAction(ImageView.Property.IMAGE, Interop.Visual.GetActionUpdateProperty(), new PropertyValue(map));
}
get
{
NUILog.Debug($"<[{GetId()}]SET val={currentStates.stopEndAction}>");
PropertyMap map = new PropertyMap();
map.Add(ImageVisualProperty.StopBehavior, new PropertyValue((int)currentStates.stopEndAction));
- DoAction(ImageView.Property.IMAGE, (int)actionType.updateProperty, new PropertyValue(map));
+ DoAction(ImageView.Property.IMAGE, Interop.Visual.GetActionUpdateProperty(), new PropertyValue(map));
}
get
{
NUILog.Debug($"<[{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));
+ DoAction(ImageView.Property.IMAGE, Interop.Visual.GetActionUpdateProperty(), new PropertyValue(map));
}
get
{
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>
+ protected internal int ActionJumpTo { get; set; } = Interop.LottieAnimationView.AnimatedVectorImageVisualActionJumpToGet();
#endregion Property
PropertyMap map = new PropertyMap();
map.Add(ImageVisualProperty.PlayRange, new PropertyValue(array));
- DoAction(ImageView.Property.IMAGE, (int)actionType.updateProperty, new PropertyValue(map));
+ DoAction(ImageView.Property.IMAGE, Interop.Visual.GetActionUpdateProperty(), new PropertyValue(map));
NUILog.Debug($" [{GetId()}] currentStates.min:({currentStates.framePlayRangeMin}, max:{currentStates.framePlayRangeMax})>");
}
PropertyMap map = new PropertyMap();
map.Add(ImageVisualProperty.PlayRange, new PropertyValue(array));
- DoAction(ImageView.Property.IMAGE, (int)actionType.updateProperty, new PropertyValue(map));
+ DoAction(ImageView.Property.IMAGE, Interop.Visual.GetActionUpdateProperty(), new PropertyValue(map));
NUILog.Debug($" [{GetId()}] currentStates.mark1:{currentStates.mark1}, mark2:{currentStates.mark2} >");
}
};
private states currentStates;
- private enum actionType
- {
- play,
- pause,
- stop,
- jumpTo,
- updateProperty,
- };
-
private struct DevelVisual
{
internal enum Type