Signed-off-by: seungho <sbsh.baek@samsung.com>
/// The ContentPage class is a class which is a formatted full screen page.
/// ContentPage contains title app bar and content.
/// </summary>
/// The ContentPage class is a class which is a formatted full screen page.
/// ContentPage contains title app bar and content.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public class ContentPage : Page
{
private AppBar appBar = null;
public class ContentPage : Page
{
private AppBar appBar = null;
/// <summary>
/// Creates a new instance of a ContentPage.
/// </summary>
/// <summary>
/// Creates a new instance of a ContentPage.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public ContentPage() : base()
{
Layout = new AbsoluteLayout();
public ContentPage() : base()
{
Layout = new AbsoluteLayout();
/// Content is positioned below AppBar.
/// Content is resized to fill the full screen except AppBar.
/// </summary>
/// Content is positioned below AppBar.
/// Content is resized to fill the full screen except AppBar.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public View Content
{
get
public View Content
{
get
{
/// <summary>
/// The Navigator is a class which navigates pages with stack methods such as Push and Pop.
{
/// <summary>
/// The Navigator is a class which navigates pages with stack methods such as Push and Pop.
+ /// </summary>
+ /// <remarks>
/// With Transition class, Navigator supports smooth transition of View pair between two Pages
/// With Transition class, Navigator supports smooth transition of View pair between two Pages
- /// by using PushWithTransition(Page) and PopWithTransition() methods.
- /// If there is View pair of current top Page and next top Page those have same View.TransitionOptions.TransitionTag,
+ /// by using <see cref="PushWithTransition(Page)"/> and <see cref="PopWithTransition()"/> methods.
+ /// If current top Page and next top Page have <see cref="View"/>s those have same TransitionTag,
/// Navigator creates smooth transition motion for them.
/// Navigator.Transition property can be used to set properties of the Transition such as TimePeriod and AlphaFunction.
/// When all transitions are finished, Navigator calls a callback methods those connected on the "TransitionFinished" event.
/// Navigator creates smooth transition motion for them.
/// Navigator.Transition property can be used to set properties of the Transition such as TimePeriod and AlphaFunction.
/// When all transitions are finished, Navigator calls a callback methods those connected on the "TransitionFinished" event.
- /// Navigator.Transition = new Transition()
+ /// Navigator navigator = new Navigator()
- /// TimePeriod = new TimePeriod(0.5),
+ /// TimePeriod = new TimePeriod(500),
/// AlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseInOutSine)
/// AlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseInOutSine)
+ /// };
+ ///
+ /// View view = new View()
+ /// {
+ /// TransitionOptions = new TransitionOptions()
+ /// {
+ /// /* Set properties for the transition of this View */
+ /// }
+ /// };
+ ///
+ /// ContentPage newPage = new ContentPage()
+ /// {
+ /// Content = view,
+ /// };
///
/// Navigator.PushWithTransition(newPage);
/// </code>
/// </example>
///
/// Navigator.PushWithTransition(newPage);
/// </code>
/// </example>
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public class Navigator : Control
{
public class Navigator : Control
{
- private static readonly float DefaultTransitionDuration = 0.5f;
+ private static readonly int DefaultTransitionDuration = 500;
//This will be replaced with view transition class instance.
private Animation curAnimation = null;
//This will be replaced with view transition class instance.
private Animation curAnimation = null;
/// <summary>
/// Creates a new instance of a Navigator.
/// </summary>
/// <summary>
/// Creates a new instance of a Navigator.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public Navigator() : base()
{
Layout = new AbsoluteLayout();
}
/// <summary>
public Navigator() : base()
{
Layout = new AbsoluteLayout();
}
/// <summary>
- /// An event for the page disappearing signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// An event fired when Transition has been finished.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public event EventHandler<EventArgs> TransitionFinished;
/// <summary>
public event EventHandler<EventArgs> TransitionFinished;
/// <summary>
public List<Page> NavigationPages { get; } = new List<Page>();
/// <summary>
public List<Page> NavigationPages { get; } = new List<Page>();
/// <summary>
- /// Transition properties for the transition of View pair those have same transition tag.
+ /// Transition properties for the transition of View pair having same transition tag.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public Transition Transition
{
set
public Transition Transition
{
set
/// </summary>
/// <param name="page">The page to push to Navigator.</param>
/// <exception cref="ArgumentNullException">Thrown when the argument page is null.</exception>
/// </summary>
/// <param name="page">The page to push to Navigator.</param>
/// <exception cref="ArgumentNullException">Thrown when the argument page is null.</exception>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public void PushWithTransition(Page page)
{
if (!transitionFinished)
public void PushWithTransition(Page page)
{
if (!transitionFinished)
/// </summary>
/// <returns>The popped page.</returns>
/// <exception cref="InvalidOperationException">Thrown when there is no page in Navigator.</exception>
/// </summary>
/// <returns>The popped page.</returns>
/// <exception cref="InvalidOperationException">Thrown when there is no page in Navigator.</exception>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public Page PopWithTransition()
{
if (!transitionFinished)
public Page PopWithTransition()
{
if (!transitionFinished)
};
// default entering/exit transition - fast fade (half duration compaired with that of view pair transition)
};
// default entering/exit transition - fast fade (half duration compaired with that of view pair transition)
- float duration = (transition.TimePeriod.DurationSeconds + transition.TimePeriod.DelaySeconds) * 0.8f;
- Animation fade = new Animation(duration);
+ int duration = (transition.TimePeriod.DurationMilliseconds + transition.TimePeriod.DelayMilliseconds);
+ float durationSeconds = (float)duration / 1000.0f;
+ Animation fade = new Animation(0.8f * durationSeconds);
fade.AnimateTo(currentTopPage, "Opacity", 0.0f);
KeyFrames keyframes = new KeyFrames();
keyframes.Add(0.0f, 0.0f);
fade.AnimateTo(currentTopPage, "Opacity", 0.0f);
KeyFrames keyframes = new KeyFrames();
keyframes.Add(0.0f, 0.0f);
/// <summary>
/// The Page class is a class which is an element of navigation.
/// </summary>
/// <summary>
/// The Page class is a class which is an element of navigation.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public abstract class Page : Control
{
private Navigator navigator = null;
public abstract class Page : Control
{
private Navigator navigator = null;
/// <summary>
/// Creates a new instance of a Page.
/// </summary>
/// <summary>
/// Creates a new instance of a Page.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public Page() : base()
{
}
public Page() : base()
{
}
- using (var time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime)))
+ using (var time = new TimePeriod(startTime, endTime - startTime))
while (current != null)
{
var targetValue = current.RefineValue(relativeValue) ?? throw new ArgumentException("Invalid " + nameof(relativeValue));
while (current != null)
{
var targetValue = current.RefineValue(relativeValue) ?? throw new ArgumentException("Invalid " + nameof(relativeValue));
- using (var time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime)))
+ using (var time = new TimePeriod(startTime, endTime - startTime))
while (current != null)
{
var targetValue = current.RefineValue(destinationValue) ?? throw new ArgumentException("Invalid " + nameof(destinationValue));
while (current != null)
{
var targetValue = current.RefineValue(destinationValue) ?? throw new ArgumentException("Invalid " + nameof(destinationValue));
- using (var time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime)))
+ using (var time = new TimePeriod(startTime, endTime - startTime))
while (current != null)
{
// NOTE Do not dispose keyFrames object returned by GetRefinedKeyFrames() here.
while (current != null)
{
// NOTE Do not dispose keyFrames object returned by GetRefinedKeyFrames() here.
/// <since_tizen> 3 </since_tizen>
public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
{
/// <since_tizen> 3 </since_tizen>
public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
{
- TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
+ TimePeriod time = new TimePeriod(startTime, endTime - startTime);
if (alphaFunction == null)
{
Animate(view, path, forward, time);
if (alphaFunction == null)
{
Animate(view, path, forward, time);
/// <summary>
/// This TransitionOptions class is a class to control Transition motion.
/// This class includes multiple options for the Transition.
/// <summary>
/// This TransitionOptions class is a class to control Transition motion.
/// This class includes multiple options for the Transition.
- /// NUI supports a kind of Transitions such as App transition, Page transition, and so on.
- /// Some of options could be used only for the App transition or Page transition, but others could be used for multiple purpose.
+ /// NUI supports various kinds of Transitions such as App transition, Page transition, and so on.
/// </summary>
/// <seealso cref="NUIApplication.TransitionOptions" />
/// </summary>
/// <seealso cref="NUIApplication.TransitionOptions" />
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public class TransitionOptions : IDisposable
{
private bool disposed = false;
public class TransitionOptions : IDisposable
{
private bool disposed = false;
/// <summary>
/// Initializes the TransitionOptions class.
/// </summary>
/// <summary>
/// Initializes the TransitionOptions class.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public TransitionOptions()
{
}
public TransitionOptions()
{
}
- /// During the Page transition, if two Views each of on the old top Page
- /// and new top Page have same TransitionTag, the View on the old top Page
- /// will be transition to the one of new top Page.
+ /// String tag to find View pair to be used in Page transition.
+ /// If there is a View have same TransitionTag in a next or previous Page.
+ /// The View will be pair for transition.
+ /// This is property for Page Transition.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public string TransitionTag { set; get; } = null;
/// <summary>
public string TransitionTag { set; get; } = null;
/// <summary>
+ /// Property for Page transition.
/// A View could be transition with its child Views or without them.
/// Default value is false
/// </summary>
/// A View could be transition with its child Views or without them.
/// Default value is false
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public bool TransitionWithChild { set; get; } = false;
/// <summary>
public bool TransitionWithChild { set; get; } = false;
/// <summary>
/// <summary>
/// Set or Get TransitionOptions for the page transition.
/// <summary>
/// Set or Get TransitionOptions for the page transition.
+ /// This property is used to define how this view will be transition during Page switching.
- /// <remarks>
- /// Hidden-API (Inhouse-API).
- /// </remarks>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public TransitionOptions TransitionOptions
{
set
public TransitionOptions TransitionOptions
{
set
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <summary>
+ /// TimePeriod is used to define delay and duration of a process such as <see cref="Transition"/>.
+ /// TimePeriod is composed of Delay and Duration in milliseconds
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
public class TimePeriod : Disposable
{
internal TimePeriod(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
public class TimePeriod : Disposable
{
internal TimePeriod(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
Interop.TimePeriod.DeleteTimePeriod(swigCPtr);
}
Interop.TimePeriod.DeleteTimePeriod(swigCPtr);
}
- [EditorBrowsable(EditorBrowsableState.Never)]
- public TimePeriod(float durationSeconds) : this(Interop.TimePeriod.NewTimePeriod(durationSeconds), true)
+ /// <summary>
+ /// The constructor.
+ /// Creates an time peroid object with the user-defined alpha function.
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ public TimePeriod(int durationMilliSeconds) : this(Interop.TimePeriod.NewTimePeriod((float)durationMilliSeconds / 1000.0f), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- [EditorBrowsable(EditorBrowsableState.Never)]
- public TimePeriod(float delaySeconds, float durationSeconds) : this(Interop.TimePeriod.NewTimePeriod(delaySeconds, durationSeconds), true)
+ /// <summary>
+ /// The constructor.
+ /// Creates an time peroid object with the user-defined alpha function.
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ public TimePeriod(float delayMilliSeconds, float durationMilliSeconds) : this(Interop.TimePeriod.NewTimePeriod((float)delayMilliSeconds / 1000.0f, (float)durationMilliSeconds / 1000.0f), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- [EditorBrowsable(EditorBrowsableState.Never)]
- public float DelaySeconds
+ /// <summary>
+ /// A delay before the time period in milliseconds
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ public int DelayMilliseconds
- Interop.TimePeriod.DelaySecondsSet(SwigCPtr, value);
+ Interop.TimePeriod.DelaySecondsSet(SwigCPtr, MilliSecondsToSeconds(value));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
- float ret = Interop.TimePeriod.DelaySecondsGet(SwigCPtr);
+ int ret = SecondsToMilliSeconds(Interop.TimePeriod.DelaySecondsGet(SwigCPtr));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
- [EditorBrowsable(EditorBrowsableState.Never)]
- public float DurationSeconds
+ /// <summary>
+ /// The duration of the time period in milliseconds
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ public int DurationMilliseconds
- Interop.TimePeriod.DurationSecondsSet(SwigCPtr, value);
+ Interop.TimePeriod.DurationSecondsSet(SwigCPtr, MilliSecondsToSeconds(value));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
- float ret = Interop.TimePeriod.DurationSecondsGet(SwigCPtr);
+ int ret = SecondsToMilliSeconds(Interop.TimePeriod.DurationSecondsGet(SwigCPtr));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
+
+ private float MilliSecondsToSeconds(int millisec)
+ {
+ return (float)millisec / 1000.0f;
+ }
+
+ private int SecondsToMilliSeconds(float sec)
+ {
+ return (int)(sec * 1000);
+ }
using Tizen.NUI.BaseComponents;
/// <summary>
using Tizen.NUI.BaseComponents;
/// <summary>
- /// Transition class is a cluster of properties for the transition of View Pair.
- /// Transition class will be used as a property of Navigator.Transition.
- /// During page Transition each of View pair those have same TransitionTag will be move with same Navigator.Transition property.
+ /// Transition class is a cluster of properties for the transition of View pair.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public class Transition : TransitionBase
{
public class Transition : TransitionBase
{
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <summary>
+ /// Create a Transition for the View pair.
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
using Tizen.NUI.BaseComponents;
/// <summary>
using Tizen.NUI.BaseComponents;
/// <summary>
- /// TransitionBase class is a base class for each Transitions.
+ /// TransitionBase class is a base class for all Transition.
/// Each Transition child classes inherits this base class.
/// </summary>
/// Each Transition child classes inherits this base class.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public class TransitionBase : Disposable
{
public class TransitionBase : Disposable
{
- private static readonly float DefaultDuration = 0.5f;
- protected internal AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default);
- protected internal TimePeriod timePeriod = new TimePeriod(DefaultDuration);
+ private static readonly int DefaultDuration = 500;
+ private AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default);
+ private TimePeriod timePeriod = new TimePeriod(DefaultDuration);
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <summary>
+ /// Create a TransitionBase
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
public TransitionBase()
{
}
public TransitionBase()
{
}
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <summary>
+ /// Set/Get the alpha function for a transition.
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
public AlphaFunction AlphaFunction
{
set
public AlphaFunction AlphaFunction
{
set
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <summary>
+ /// Set/Get time period that contains delay and duration.
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
public TimePeriod TimePeriod
{
set
public TimePeriod TimePeriod
{
set
return new TransitionItemBase(target, isEntering, timePeriod, alphaFunction);
}
return new TransitionItemBase(target, isEntering, timePeriod, alphaFunction);
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
protected override void Dispose(DisposeTypes type)
{
alphaFunction.Dispose();
protected override void Dispose(DisposeTypes type)
{
alphaFunction.Dispose();
HeightResizePolicy = ResizePolicyType.FillToParent,
Transition = new Transition()
{
HeightResizePolicy = ResizePolicyType.FillToParent,
Transition = new Transition()
{
- TimePeriod = new TimePeriod(0.4f),
+ TimePeriod = new TimePeriod(400),
AlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseInOutSine),
},
};
AlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseInOutSine),
},
};