/// <summary>
/// ScrollEventArgs is a class to record scroll event arguments which will sent to user.
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public class ScrollEventArgs : EventArgs
{
- Position position;
+ private Position position;
/// <summary>
/// Default constructor.
/// </summary>
/// <param name="position">Current scroll position</param>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ /// <since_tizen> 8 </since_tizen>
public ScrollEventArgs(Position position)
{
this.position = position;
}
/// <summary>
- /// [Draft] Current scroll position.
+ /// Current position of ContentContainer.
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public Position Position
{
get
}
/// <summary>
- /// [Draft] This class provides a View that can scroll a single View with a layout. This View can be a nest of Views.
+ /// This class provides a View that can scroll a single View with a layout. This View can be a nest of Views.
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public class ScrollableBase : Control
{
static bool LayoutDebugScrollableBase = false; // Debug flag
/// <summary>
/// The direction axis to scroll.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public enum Direction
{
/// <summary>
/// Horizontal axis.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
+ /// <since_tizen> 8 </since_tizen>
Horizontal,
/// <summary>
/// Vertical axis.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
+ /// <since_tizen> 8 </since_tizen>
Vertical
}
/// <summary>
- /// [Draft] Scrolling direction mode.
+ /// Scrolling direction mode.
/// Default is Vertical scrolling.
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public Direction ScrollingDirection
{
get
}
/// <summary>
- /// [Draft] Enable or disable scrolling.
+ /// Enable or disable scrolling.
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public bool ScrollEnabled
{
get
}
/// <summary>
- /// [Draft] Pages mode, enables moving to the next or return to current page depending on pan displacement.
+ /// Pages mode, enables moving to the next or return to current page depending on pan displacement.
/// Default is false.
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public bool SnapToPage { set; get; } = false;
/// <summary>
- /// [Draft] Get current page.
- /// Working propery with SnapToPage property.
+ /// Get current page.
+ /// Working property with SnapToPage property.
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public int CurrentPage { get; private set; } = 0;
/// <summary>
- /// [Draft] Duration of scroll animation.
+ /// Duration of scroll animation.
+ /// Default value is 125ms.
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
-
+ /// <since_tizen> 8 </since_tizen>
public int ScrollDuration { set; get; } = 125;
+
/// <summary>
- /// [Draft] Scroll Available area.
+ /// Scroll Available area.
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public Vector2 ScrollAvailableArea { set; get; }
/// <summary>
/// An event emitted when user starts dragging ScrollableBase, user can subscribe or unsubscribe to this event handler.<br />
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public event EventHandler<ScrollEventArgs> ScrollDragStarted;
/// <summary>
/// An event emitted when user stops dragging ScrollableBase, user can subscribe or unsubscribe to this event handler.<br />
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public event EventHandler<ScrollEventArgs> ScrollDragEnded;
/// <summary>
/// An event emitted when the scrolling slide animation starts, user can subscribe or unsubscribe to this event handler.<br />
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public event EventHandler<ScrollEventArgs> ScrollAnimationStarted;
/// <summary>
/// An event emitted when the scrolling slide animation ends, user can subscribe or unsubscribe to this event handler.<br />
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public event EventHandler<ScrollEventArgs> ScrollAnimationEnded;
/// <summary>
/// An event emitted when scrolling, user can subscribe or unsubscribe to this event handler.<br />
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public event EventHandler<ScrollEventArgs> Scrolling;
/// <summary>
- /// Scrollbar for ScrollableBase.<br />
+ /// Scrollbar for ScrollableBase.
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public ScrollbarBase Scrollbar
{
get
}
/// <summary>
- /// [Draft] Always hide Scrollbar.
+ /// Always hide Scrollbar.
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool HideScrollBar
+ /// <since_tizen> 8 </since_tizen>
+ public bool HideScrollbar
{
get
{
/// <summary>
/// Container which has content of ScrollableBase.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public View ContentContainer { get; private set; }
/// <summary>
/// Set the layout on this View. Replaces any existing Layout.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public new LayoutItem Layout
{
get
/// <summary>
/// List of children of Container.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public new List<View> Children
{
get
/// <summary>
/// Deceleration rate of scrolling by finger.
- /// Rate should be 0 < rate < 1.
+ /// Rate should be bigger than 0 and smaller than 1.
+ /// Default value is 0.998f;
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public float DecelerationRate
{
get
/// <summary>
/// Page will be changed when velocity of panning is over threshold.
+ /// The unit of threshold is pixel per milisec.
/// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public float PageFlickThreshold { get; set; } = 0.4f;
/// <summary>
private PropertyNotification propertyNotification;
private float noticeAnimationEndBeforePosition = 0.0f;
private bool readyToNotice = false;
+
+ /// <summary>
+ /// Notice before animation is finished.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
// Let's consider more whether this needs to be set as protected.
public float NoticeAnimationEndBeforePosition { get => noticeAnimationEndBeforePosition; set => noticeAnimationEndBeforePosition = value; }
-
// Let's consider more whether this needs to be set as protected.
private float finalTargetPosition;
private float decelerationRate = 0.0f;
/// <summary>
- /// [Draft] Constructor
+ /// Default Constructor
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public ScrollableBase() : base()
{
DecelerationRate = 0.998f;
/// Called after a child has been added to the owning view.
/// </summary>
/// <param name="view">The child which has been added.</param>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public override void Add(View view)
{
ContentContainer.Add(view);
/// Called after a child has been removed from the owning view.
/// </summary>
/// <param name="view">The child which has been removed.</param>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public override void Remove(View view)
{
if (SnapToPage && CurrentPage == Children.IndexOf(view) && CurrentPage == Children.Count - 1)
/// The composition of a Scrollbar can vary depending on how you use ScrollableBase.
/// Set the composition that will go into the ScrollableBase according to your ScrollableBase.
/// </summary>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
+ /// <since_tizen> 8 </since_tizen>
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void SetScrollbar()
{
/// Scrolls to the item at the specified index.
/// </summary>
/// <param name="index">Index of item.</param>
- /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public void ScrollToIndex(int index)
{
if (ContentContainer.ChildCount - 1 < index || index < 0)
/// </summary>
/// <param name="position">Destination.</param>
/// <param name="animate">Scroll with or without animation</param>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public void ScrollTo(float position, bool animate)
{
float currentPositionX = ContentContainer.CurrentPosition.X != 0 ? ContentContainer.CurrentPosition.X : ContentContainer.Position.X;
}
else
{
- Decelerating((ScrollingDirection == Direction.Horizontal) ? e.PanGesture.Velocity.X : e.PanGesture.Velocity.Y);
+ Decelerating((ScrollingDirection == Direction.Horizontal) ? e.PanGesture.Velocity.X : e.PanGesture.Velocity.Y, scrollAnimation);
}
totalDisplacementForPan = 0;
}
}
- private void Decelerating(float velocity)
+ /// <summary>
+ /// you can override it to custom your decelerating
+ /// </summary>
+ /// <param name="velocity">Velocity of current pan.</param>
+ /// <param name="animation">Scroll animation.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected virtual void Decelerating(float velocity, Animation animation)
{
// Decelerating using deceleration equation ===========
//
finalTargetPosition = destination;
customScrollAlphaFunction = new UserAlphaFunctionDelegate(CustomScrollAlphaFunction);
- scrollAnimation.DefaultAlphaFunction = new AlphaFunction(customScrollAlphaFunction);
+ animation.DefaultAlphaFunction = new AlphaFunction(customScrollAlphaFunction);
GC.KeepAlive(customScrollAlphaFunction);
- scrollAnimation.Duration = (int)panAnimationDuration;
- scrollAnimation.AnimateTo(ContentContainer, (ScrollingDirection == Direction.Horizontal) ? "PositionX" : "PositionY", destination);
- scrollAnimation.Play();
- }
-
- protected void OnTapGestureDetected(object source, TapGestureDetector.DetectedEventArgs e)
- {
-
+ animation.Duration = (int)panAnimationDuration;
+ animation.AnimateTo(ContentContainer, (ScrollingDirection == Direction.Horizontal) ? "PositionX" : "PositionY", destination);
+ animation.Play();
}
private void ScrollAnimationFinished(object sender, EventArgs e)