--- /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
+{
+ using global::System;
+ using global::System.Runtime.InteropServices;
+
+ internal static partial class Interop
+ {
+ internal static partial class ScaleTransitionItem
+ {
+ [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_ScaleTransition")]
+ public static extern IntPtr NewEmpty();
+
+ [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ScaleTransition_New_1")]
+ public static extern IntPtr New(HandleRef view, float scale, HandleRef timePeriod);
+
+ [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ScaleTransition_New_2")]
+ public static extern IntPtr New(HandleRef view, HandleRef scale, HandleRef timePeriod);
+
+ [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_ScaleTransition")]
+ public static extern void Delete(HandleRef scaleTransition);
+
+ [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_ScaleTransition_Set")]
+ public static extern IntPtr NewScaleTransitionItem(HandleRef scaleTransition);
+
+ [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ScaleTransition_Assign")]
+ public static extern IntPtr Assign(HandleRef destination, HandleRef source);
+ }
+ }
+}
--- /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
+{
+ using System;
+ using System.ComponentModel;
+
+ using Tizen.NUI.BaseComponents;
+
+ /// <summary>
+ /// ScaleTransitionItem is an object to set scale transition of a View that will appear or disappear.
+ /// ScaleTransitionItem object is required to be added to the TransitionSet to play.
+ /// </summary>
+ internal class ScaleTransitionItem : TransitionItemBase
+ {
+ /// <summary>
+ /// Creates an initialized ScaleTransition.<br />
+ /// </summary>
+ /// <remarks>Delay and duration of timePeriod must be greater than zero.</remarks>
+ public ScaleTransitionItem(View view, float scale, bool isAppearing, TimePeriod timePeriod, AlphaFunction alphaFunction) : this(Interop.ScaleTransitionItem.New(view.SwigCPtr, scale, timePeriod.SwigCPtr), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ AppearingTransition = isAppearing;
+ AlphaFunction = alphaFunction;
+ }
+
+ /// <summary>
+ /// Creates an initialized ScaleTransition.<br />
+ /// </summary>
+ /// <remarks>Delay and duration of timePeriod must be greater than zero.</remarks>
+ public ScaleTransitionItem(View view, Vector2 scale, bool isAppearing, TimePeriod timePeriod, AlphaFunction alphaFunction) : this(Interop.ScaleTransitionItem.New(view.SwigCPtr, scale.SwigCPtr, timePeriod.SwigCPtr), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ AppearingTransition = isAppearing;
+ AlphaFunction = alphaFunction;
+ }
+
+ internal ScaleTransitionItem(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+ {
+ }
+
+ internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ScaleTransitionItem obj)
+ {
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
+ }
+
+ internal ScaleTransitionItem(ScaleTransitionItem handle) : this(Interop.ScaleTransitionItem.NewScaleTransitionItem(ScaleTransitionItem.getCPtr(handle)), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ internal ScaleTransitionItem Assign(ScaleTransitionItem rhs)
+ {
+ ScaleTransitionItem ret = new ScaleTransitionItem(Interop.ScaleTransitionItem.Assign(SwigCPtr, ScaleTransitionItem.getCPtr(rhs)), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// To make ScaleTransition instance be disposed.
+ /// </summary>
+ protected override void Dispose(DisposeTypes type)
+ {
+ if (disposed)
+ {
+ return;
+ }
+ base.Dispose(type);
+ }
+
+ /// This will not be public opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
+ {
+ if (swigCPtr.Handle == IntPtr.Zero || this.HasBody() == false)
+ {
+ Tizen.Log.Fatal("NUI", $"[ERROR] ScaleTransitionItem ReleaseSwigCPtr()! IntPtr=0x{swigCPtr.Handle:X} HasBody={this.HasBody()}");
+ return;
+ }
+ Interop.ScaleTransitionItem.Delete(swigCPtr);
+ }
+ }
+}
--- /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
+{
+ using System;
+ using System.ComponentModel;
+ using Tizen.NUI.BaseComponents;
+
+ /// <summary>
+ /// ScaleTransition provides smoothly appearing/disappearing scale effects for target View.
+ /// If this transition is for appearing, the View comes out with the scale factor applied
+ /// and will be animated at its original scale.
+ /// If this transition is for disappearing, the View starts at its original size
+ /// but will become the scale of scale factor and vanished.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class ScaleTransition : TransitionBase
+ {
+ /// <summary>
+ /// Create a ScaleTransition.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ScaleTransition()
+ {
+ }
+
+ /// <summary>
+ /// Set/get Scale factor for this scale transition.
+ /// if AppearingTransition, transition starts from scaled by the ScaleFactor and is animated to the original size.
+ /// And if DisappearingTransition, transition is finished to the scaled state by the ScaleFactor.
+ ///
+ /// Default ScaleFactor is Vector2(0.5f, 0.5f).
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Vector2 ScaleFactor { get; set; } = new Vector2(0.5f, 0.5f);
+
+ internal override TransitionItemBase CreateTransition(View view, bool isAppearing)
+ {
+ ScaleTransitionItem scale = new ScaleTransitionItem(view, ScaleFactor, isAppearing, GetTimePeriod(), GetAlphaFunction());
+ return scale;
+ }
+ }
+}
{
BackgroundColor = Color.Transparent,
Content = mainRoot,
- DisappearingTransition = new SlideTransition()
+ DisappearingTransition = new ScaleTransition()
{
TimePeriod = new TimePeriod(500),
AlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default),
- Direction = SlideTransitionDirection.Top
+ ScaleFactor = new Vector2(0.5f, 1.5f)
},
AppearingTransition = new SlideTransition()
{
TimePeriod = new TimePeriod(500),
AlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default),
},
- DisappearingTransition = new FadeTransition()
+ DisappearingTransition = new SlideTransition()
{
TimePeriod = new TimePeriod(500),
AlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default),
+ Direction = SlideTransitionDirection.Left
},
};
return page;