2 * Copyright(c) 2021 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 using System.ComponentModel;
20 using Tizen.NUI.BaseComponents;
25 /// TransitionBase class is a base class for all Transition.
26 /// Each Transition child classes inherits this base class.
29 /// Transition changes propreties of View like Position, Scale, Orientation, and Opacity during transition.
31 /// <since_tizen> 9 </since_tizen>
32 public class TransitionBase : Disposable
34 private AlphaFunction alphaFunction = null;
35 private TimePeriod timePeriod = null;
38 /// Create a TransitionBase
40 /// <since_tizen> 9 </since_tizen>
41 public TransitionBase()
46 /// Set/Get the alpha function for a transition.
48 /// <since_tizen> 9 </since_tizen>
49 public AlphaFunction AlphaFunction
53 alphaFunction = value;
62 /// Set/Get time period that contains delay and duration.
64 /// <since_tizen> 9 </since_tizen>
65 public TimePeriod TimePeriod
77 internal TimePeriod GetTimePeriod()
79 return timePeriod ??= new TimePeriod(0);
82 internal AlphaFunction GetAlphaFunction()
84 return alphaFunction ??= new AlphaFunction(AlphaFunction.BuiltinFunctions.Default);
87 internal TransitionItemBase CreateTransition(View view, bool appearingTransition)
89 return CreateTransition(view, appearingTransition, GetTimePeriod(), GetAlphaFunction());
92 internal virtual TransitionItemBase CreateTransition(View view, bool appearingTransition, TimePeriod timePeriod, AlphaFunction alphaFunction)
94 return new TransitionItemBase(view, appearingTransition, timePeriod, alphaFunction);
97 [EditorBrowsable(EditorBrowsableState.Never)]
98 protected override void Dispose(DisposeTypes type)
100 alphaFunction?.Dispose();
101 timePeriod?.Dispose();