/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2020 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.
/// <summary>
/// Pagination shows the number of pages available and the currently active page.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public class Pagination: Control
{
private VisualView container;
/// <summary>
/// Creates a new instance of a Pagination.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public Pagination() : base()
{
Initialize();
/// <summary>
/// Creates a new instance of a Pagination using style.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <param name="style">The string to initialize the Pagination</param>
+ /// <since_tizen> 8 </since_tizen>
public Pagination(string style) : base(style)
{
Initialize();
/// <summary>
/// Creates a new instance of a Pagination using style.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <param name="paginationStyle">The style object to initialize the Pagination</param>
+ /// <since_tizen> 8 </since_tizen>
public Pagination(PaginationStyle paginationStyle) : base(paginationStyle)
{
Initialize();
/// <summary>
/// Get style of pagination.
/// </summary>
- /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public new PaginationStyle Style => ViewStyle as PaginationStyle;
/// <summary>
/// Gets or sets the size of the indicator.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public Size IndicatorSize
{
get
/// <summary>
/// Gets or sets the background resource of indicator.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Selector<string> IndicatorImageURL
+ /// <since_tizen> 8 </since_tizen>
+ public Selector<string> IndicatorImageUrl
{
get
{
- return Style?.IndicatorImageURL;
+ return Style?.IndicatorImageUrl;
}
set
{
{
return;
}
- Style.IndicatorImageURL = value;
+ Style.IndicatorImageUrl = value;
UpdateVisual();
}
}
/// <summary>
/// Gets or sets the space of the indicator.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public int IndicatorSpacing
{
get
/// <summary>
/// Gets or sets the count of the pages/indicators.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public int IndicatorCount
{
get
container.RemoveVisual("Indicator" + i);
}
indicatorList.RemoveRange(value, indicatorCount - value);
- //if(value <= 0)
- //{
- // container.RemoveVisual("SelectIndicator");
- //}
- //else
+
if (selectedIndex >= value)
{
selectedIndex = 0;
/// <summary>
/// Gets or sets the index of the select indicator.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
public int SelectedIndex
{
get
/// Retrieves the position of a indicator by index.
/// </summary>
/// <param name="index">Indicator index</param>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <returns>The position of a indicator by index.</returns>
+ /// <since_tizen> 8 </since_tizen>
public Position GetIndicatorPosition(int index)
{
if (index < 0 || index >= indicatorList.Count)
/// You can override it to do your select out operation.
/// </summary>
/// <param name="selectOutIndicator">The indicator will be selected out</param>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
protected virtual void SelectOut(VisualMap selectOutIndicator)
{
if (!(selectOutIndicator is ImageVisual visual)) return;
- visual.URL = Style?.IndicatorImageURL.Normal;
+ visual.URL = Style?.IndicatorImageUrl.Normal;
visual.Opacity = 0.5f;
}
/// You can override it to do your select in operation.
/// </summary>
/// <param name="selectInIndicator">The indicator will be selected in</param>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
protected virtual void SelectIn(VisualMap selectInIndicator)
{
if (!(selectInIndicator is ImageVisual visual)) return;
- visual.URL = Style?.IndicatorImageURL.Selected;
+ visual.URL = Style?.IndicatorImageUrl.Selected;
visual.Opacity = 1.0f;
}
/// <summary>
/// you can override it to create your own default style.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <returns>The default pagination style.</returns>
+ /// <since_tizen> 8 </since_tizen>
protected override ViewStyle CreateViewStyle()
{
return new PaginationStyle();
/// you can override it to clean-up your own resources.
/// </summary>
/// <param name="type">DisposeTypes</param>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 8 </since_tizen>
protected override void Dispose(DisposeTypes type)
{
if (disposed)
}
ImageVisual indicator = new ImageVisual
{
- URL = Style.IndicatorImageURL.Normal,
+ URL = Style.IndicatorImageUrl.Normal,
Size = new Size2D((int)Style.IndicatorSize.Width, (int)Style.IndicatorSize.Height),
Opacity = 0.5f,
};
- indicator.Position = new Position2D((int)(Style.IndicatorSize.Width + Style.IndicatorSpacing) * indicatorList.Count, 0);
+ indicator.Position = new Vector2((int)(Style.IndicatorSize.Width + Style.IndicatorSpacing) * indicatorList.Count, 0);
container.AddVisual("Indicator" + indicatorList.Count, indicator);
indicatorList.Add(indicator);
}
private void UpdateVisual()
{
if (null == Style.IndicatorSize) return;
- if (null == Style.IndicatorImageURL) return;
+ if (null == Style.IndicatorImageUrl) return;
if (indicatorCount < 0) return;
for (int i = 0; i < indicatorList.Count; i++)
{
ImageVisual indicator = indicatorList[i];
- indicator.URL = Style.IndicatorImageURL.Normal;
+ indicator.URL = Style.IndicatorImageUrl.Normal;
indicator.Size = new Size2D((int)Style.IndicatorSize.Width, (int)Style.IndicatorSize.Height);
- indicator.Position = new Position2D((int)(Style.IndicatorSize.Width + Style.IndicatorSpacing) * i, 0);
+ indicator.Position = new Vector2((int)(Style.IndicatorSize.Width + Style.IndicatorSpacing) * i, 0);
}
}
}
/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2020 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.
/// <summary>
/// PaginationStyle used to config the pagination represent.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will 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 PaginationStyle : ControlStyle
{
static PaginationStyle() { }
/// <summary>
/// Creates a new instance of a PaginationStyle.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will 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 PaginationStyle() : base() { }
/// <summary>
/// Creates a new instance of a PaginationStyle using style.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <param name="style">Create PaginationStyle by style customized by user.</param>
+ /// <since_tizen> 8 </since_tizen>
public PaginationStyle(PaginationStyle style) : base(style)
{
if (null == style) return;
/// <summary>
/// Gets or sets the size of the indicator.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will 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 Size IndicatorSize { get; set; }
/// <summary>
/// Gets or sets the resource of indicator.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Selector<string> IndicatorImageURL { get; set; } = new Selector<string>();
+ /// <since_tizen> 8 </since_tizen>
+ public Selector<string> IndicatorImageUrl { get; set; } = new Selector<string>();
/// <summary>
/// Gets or sets the space of the indicator.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will 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 IndicatorSpacing { get; set; }
/// <summary>
/// Retrieves a copy of PaginationStyle.
/// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <param name="bindableObject">The style that need to copy.</param>
+ /// <since_tizen> 8 </since_tizen>
public override void CopyFrom(BindableObject bindableObject)
{
base.CopyFrom(bindableObject);
{
IndicatorSize = new Size(paginationStyle.IndicatorSize.Width, paginationStyle.IndicatorSize.Height);
}
- if (null != paginationStyle.IndicatorImageURL)
+ if (null != paginationStyle.IndicatorImageUrl)
{
- IndicatorImageURL?.Clone(paginationStyle.IndicatorImageURL);
+ IndicatorImageUrl?.Clone(paginationStyle.IndicatorImageUrl);
}
IndicatorSpacing = paginationStyle.IndicatorSpacing;
}