fd0b1dbb4210fc5963b6de3dfee2a51f33ca3cc1
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Transition / ScaleTransition.cs
1 /*
2  * Copyright(c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 namespace Tizen.NUI
19 {
20     using System;
21     using System.ComponentModel;
22     using Tizen.NUI.BaseComponents;
23
24     /// <summary>
25     /// ScaleTransition provides smoothly appearing/disappearing scale effects for target View.
26     /// If this transition is for appearing, the View comes out with the scale factor applied
27     /// and will be animated at its original scale.
28     /// If this transition is for disappearing, the View starts at its original size
29     /// but will become the scale of scale factor and vanished.
30     /// </summary>
31     /// <since_tizen> 9 </since_tizen>
32     public class ScaleTransition : TransitionBase
33     {
34         /// <summary>
35         /// Create a ScaleTransition.
36         /// </summary>
37         /// <since_tizen> 9 </since_tizen>
38         public ScaleTransition()
39         {
40         }
41
42         /// <summary>
43         /// Set/get Scale factor for this scale transition.
44         /// if AppearingTransition, transition starts from scaled by the ScaleFactor and is animated to the original size.
45         /// And if DisappearingTransition, transition is finished to the scaled state by the ScaleFactor.
46         ///
47         /// Default ScaleFactor is Vector2(0.0f, 0.0f).
48         /// </summary>
49         /// <since_tizen> 9 </since_tizen>
50         public Vector2 ScaleFactor { get; set; } = new Vector2(0.0f, 0.0f);
51
52         internal override TransitionItemBase CreateTransition(View view, bool isAppearing)
53         {
54             ScaleTransitionItem scale = new ScaleTransitionItem(view, ScaleFactor, isAppearing, GetTimePeriod(), GetAlphaFunction());
55             return scale;
56         }
57     }
58 }