+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Tizen.NUI
-{
- internal static partial class Interop
- {
- internal static partial class MeasureSpec
- {
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_MeasureSpec__SWIG_0")]
- public static extern global::System.IntPtr new_MeasureSpec__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_MeasureSpec__SWIG_1")]
- public static extern global::System.IntPtr new_MeasureSpec__SWIG_1(int jarg1);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_MeasureSpec")]
- public static extern void delete_MeasureSpec(global::System.Runtime.InteropServices.HandleRef jarg1);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasureSpec_Assign")]
- public static extern global::System.IntPtr MeasureSpec_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasureSpec_EqualTo")]
- public static extern bool MeasureSpec_EqualTo(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasureSpec_NotEqualTo")]
- public static extern bool MeasureSpec_NotEqualTo(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasureSpec_GetMode")]
- public static extern int MeasureSpec_GetMode(global::System.Runtime.InteropServices.HandleRef jarg1);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasureSpec_GetSize")]
- public static extern int MeasureSpec_GetSize(global::System.Runtime.InteropServices.HandleRef jarg1);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasureSpec_Adjust")]
- public static extern global::System.IntPtr MeasureSpec_Adjust(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasureSpec_mSize_set")]
- public static extern void MeasureSpec_mSize_set(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasureSpec_mSize_get")]
- public static extern int MeasureSpec_mSize_get(global::System.Runtime.InteropServices.HandleRef jarg1);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasureSpec_mMode_set")]
- public static extern void MeasureSpec_mMode_set(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasureSpec_mMode_get")]
- public static extern int MeasureSpec_mMode_get(global::System.Runtime.InteropServices.HandleRef jarg1);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Tizen.NUI
-{
- internal static partial class Interop
- {
- internal static partial class MeasuredSize
- {
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_MeasuredSize__SWIG_0")]
- public static extern global::System.IntPtr new_MeasuredSize__SWIG_0();
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_MeasuredSize__SWIG_1")]
- public static extern global::System.IntPtr new_MeasuredSize__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_MeasuredSize__SWIG_2")]
- public static extern global::System.IntPtr new_MeasuredSize__SWIG_2(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_MeasuredSize")]
- public static extern void delete_MeasuredSize(global::System.Runtime.InteropServices.HandleRef jarg1);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasuredSize_Assign__SWIG_0")]
- public static extern global::System.IntPtr MeasuredSize_Assign__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasuredSize_Assign__SWIG_1")]
- public static extern global::System.IntPtr MeasuredSize_Assign__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasuredSize_EqualTo")]
- public static extern bool MeasuredSize_EqualTo(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasuredSize_NotEqualTo")]
- public static extern bool MeasuredSize_NotEqualTo(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasuredSize_SetState")]
- public static extern void MeasuredSize_SetState(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasuredSize_GetState")]
- public static extern int MeasuredSize_GetState(global::System.Runtime.InteropServices.HandleRef jarg1);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasuredSize_SetSize")]
- public static extern void MeasuredSize_SetSize(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MeasuredSize_GetSize")]
- public static extern global::System.IntPtr MeasuredSize_GetSize(global::System.Runtime.InteropServices.HandleRef jarg1);
- }
- }
-}
\ No newline at end of file
*
*/
-using System.Collections.Generic;
-using System;
-using System.ComponentModel;
-
namespace Tizen.NUI
{
/// <summary>
- /// The conditions for transitions.
- /// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
- [FlagsAttribute] public enum TransitionCondition
- {
- /// <summary>
- /// Default when a condition has not been set.
- /// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
- Unspecified = 0,
- /// <summary>
- /// Animate changing layout to another layout.
- /// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
- LayoutChanged = 1,
- /// <summary>
- /// Animate adding item.
- /// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
- Add = 2,
- /// <summary>
- /// Animate removing item.
- /// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
- Remove = 4,
- /// <summary>
- /// Animation when an item changes due to a sibbling being added.
- /// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
- ChangeOnAdd = 8,
- /// <summary>
- /// Animation when an item changes due to a sibbling being removed.
- /// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
- ChangeOnRemove = 16
- }
-
- /// <summary>
/// [Draft] Class to hold layout animation and position data
/// </summary>
internal struct LayoutData
+++ /dev/null
-/*
- * Copyright (c) 2019 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI
-{
- /// <summary>
- /// [Draft] This class represents a layout size (width and height), non mutable.
- /// </summary>
- internal struct LayoutSize
- {
- /// <summary>
- /// [Draft] Constructor from width and height
- /// </summary>
- /// <param name="width">Int to initialize with.</param>
- /// <param name="height">Int to initialize with.</param>
- public LayoutSize(int width, int height)
- {
- Width = width;
- Height = height;
- }
-
- /// <summary>
- /// Computes a hash code for this LayoutSize for use in hash based collections.
- /// </summary>
- /// <returns>A non unique hash code .</returns>
- public override int GetHashCode()
- {
- return Width ^ Height;
- }
-
- /// <summary>
- /// Whether the values of two LayoutSize objects are equals
- /// </summary>
- /// <param name="obj">Object to be compared against.</param>
- /// <returns>true if obj is equal to this LayoutSize.</returns>
- public override bool Equals(object obj)
- {
- if (obj is LayoutSize)
- {
- LayoutSize layoutSize = (LayoutSize)obj;
- return ((layoutSize.Width == Width) && (layoutSize.Height == Height));
- }
- return false;
- }
-
- /// <summary>
- /// Compares whether the two LayoutSize instances are equal.
- /// </summary>
- /// <param name="lhs">A LayoutSize instance.</param>
- /// <param name="rhs">A LayoutSize instance.</param>
- /// <returns>true if the two LayoutSize instances have equal values.</returns>
- public static bool operator ==(LayoutSize lhs, LayoutSize rhs)
- {
- return ((lhs.Width == rhs.Width) && (lhs.Height == rhs.Height));
- }
-
-
- /// <summary>
- /// Compares whether the two LayoutSize instances are same or not.
- /// </summary>
- /// <param name="lhs">A LayoutSize instance.</param>
- /// <param name="rhs">A LayoutSize instance.</param>
- /// <returns>true if the two LayoutSize instances have do not have equal values.</returns>
- public static bool operator !=(LayoutSize lhs, LayoutSize rhs)
- {
- return ((lhs.Width != rhs.Width) || (lhs.Height != rhs.Height));
- }
-
- /// <summary>
- /// [Draft] Get the width value of this layout
- /// </summary>
- public int Width{ get; private set; }
-
- /// <summary>
- /// [Draft] Get the height value of this layout
- /// </summary>
- public int Height{ get; private set; }
-
- }
-}
return temp;
});
+
/// 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 static readonly BindableProperty UpdateSizeHintProperty = BindableProperty.Create("UpdateSizeHint", typeof(Vector2), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
return temp;
});
+
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty XamlStyleProperty = BindableProperty.Create("XamlStyle", typeof(Style), typeof(View), default(Style), propertyChanged: (bindable, oldvalue, newvalue) => ((View)bindable)._mergedStyle.Style = (Style)newvalue);
"Like: " +
"View view = new View(); " +
"view.PivotPoint = PivotPoint.Center; " +
- "view.PositionUsesPivotPoint = true;" +
+ "view.PositionUsesPivotPoint = true;" +
" Deprecated in API5: Will be removed in API8")]
[EditorBrowsable(EditorBrowsableState.Never)]
public bool PositionUsesAnchorPoint
}
/// <summary>
- /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead!
+ /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead!
/// </summary>
/// <since_tizen> 3 </since_tizen>
[Obsolete("Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! " +
///<summary>
/// The required policy for this dimension, LayoutParamPolicies enum or exact value.
///</summary>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- /// <remarks>
- /// Previously named LayoutWidthSpecification
- /// </remarks>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
public int WidthSpecification
{
get
///<summary>
/// The required policy for this dimension, LayoutParamPolicies enum or exact value.
///</summary>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- /// <remarks>
- /// Previously named LayoutHeightSpecification
- /// </remarks>
+ /// <since_tizen> 6 </since_tizen>
[EditorBrowsable(EditorBrowsableState.Never)]
public int HeightSpecification
{
///<summary>
/// Gets the List of transitions for this View.
///</summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
{
get
}
}
- internal LayoutTransition LayoutTransition
+ ///<summary>
+ /// Set a layout transitions for this View.
+ ///</summary>
+ /// <remarks>
+ /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
+ /// </remarks>
+ /// <since_tizen> 6 </since_tizen>
+ public LayoutTransition LayoutTransition
{
set
{
}
}
+
/// <summary>
- /// The color mode of View.
- /// This specifies whether the View uses its own color, or inherits its parent color.
- /// The default is ColorMode.UseOwnMultiplyParentColor.
+ /// Set the layout on this View. Replaces any existing Layout.
/// </summary>
- internal ColorMode ColorMode
+ /// <since_tizen> 6 </since_tizen>
+ public LayoutItem Layout
{
- set
+ get
{
- SetColorMode(value);
+ return _layout;
}
- get
+ set
{
- return GetColorMode();
+ // Do nothing if layout provided is already set on this View.
+ if (value == _layout)
+ {
+ return;
+ }
+
+ Log.Info("NUI", "Setting Layout on:" + Name + "\n");
+ layoutingDisabled = false;
+ layoutSet = true;
+
+ // If new layout being set already has a owner then that owner receives a replacement default layout.
+ // First check if the layout to be set already has a owner.
+ if (value?.Owner != null)
+ {
+ // Previous owner of the layout gets a default layout as a replacement.
+ value.Owner.Layout = new LayoutGroup();
+
+ // Copy Margin and Padding to replacement LayoutGroup.
+ value.Owner.Layout.Margin = value.Margin;
+ value.Owner.Layout.Padding = value.Padding;
+ }
+
+ // Copy Margin and Padding to new layout being set or restore padding and margin back to
+ // View if no replacement. Previously margin and padding values would have been moved from
+ // the View to the layout.
+ if (_layout != null ) // Existing layout
+ {
+ if (value != null)
+ {
+ // Existing layout being replaced so copy over margin and padding values.
+ value.Margin = _layout.Margin;
+ value.Padding = _layout.Padding;
+ }
+ else
+ {
+ // Layout not being replaced so restore margin and padding to View.
+ SetValue(MarginProperty, _layout.Margin);
+ SetValue(PaddingProperty, _layout.Padding);
+ NotifyPropertyChanged();
+ }
+ }
+ else
+ {
+ // First Layout to be added to the View hence copy
+
+ // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
+ if (value !=null)
+ {
+ if (Margin.Top != 0 || Margin.Bottom !=0 || Margin.Start !=0 || Margin.End != 0)
+ {
+ // If View already has a margin set then store it in Layout instead.
+ value.Margin = Margin;
+ SetValue(MarginProperty, new Extents(0,0,0,0));
+ NotifyPropertyChanged();
+ }
+
+ if (Padding.Top != 0 || Padding.Bottom !=0 || Padding.Start !=0 || Padding.End != 0)
+ {
+ // If View already has a padding set then store it in Layout instead.
+ value.Padding = Padding;
+ SetValue(PaddingProperty, new Extents(0,0,0,0));
+ NotifyPropertyChanged();
+ }
+ }
+ }
+
+ // Remove existing layout from it's parent layout group.
+ _layout?.Unparent();
+
+ // Set layout to this view
+ SetLayout(value);
}
}
- internal float Weight
+ /// <summary>
+ /// The weight of the View, used to share available space in a layout with siblings.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ public float Weight
{
get
{
}
}
+
+ /// <summary>
+ /// The color mode of View.
+ /// This specifies whether the View uses its own color, or inherits its parent color.
+ /// The default is ColorMode.UseOwnMultiplyParentColor.
+ /// </summary>
+ internal ColorMode ColorMode
+ {
+ set
+ {
+ SetColorMode(value);
+ }
+ get
+ {
+ return GetColorMode();
+ }
+ }
+
/// <summary>
/// Whether to load the BackgroundImage synchronously.
/// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
}
}
- /// <summary>
- /// Set the layout on this View. Replaces any existing Layout.
- /// </summary>
- internal LayoutItem Layout
- {
- get
- {
- return _layout;
- }
- set
- {
- // Do nothing if layout provided is already set on this View.
- if (value == _layout)
- {
- return;
- }
-
- Log.Info("NUI", "Setting Layout on:" + Name + "\n");
- layoutingDisabled = false;
- layoutSet = true;
-
- // If new layout being set already has a owner then that owner receives a replacement default layout.
- // First check if the layout to be set already has a owner.
- if (value?.Owner != null)
- {
- Log.Info("NUI", "Set layout already in use by another View: " + value.Owner.Name + "will get a LayoutGroup\n");
- // Previous owner of the layout gets a default layout as a replacement.
- value.Owner.Layout = new LayoutGroup();
-
- // Copy Margin and Padding to replacement LayoutGroup.
- value.Owner.Layout.Margin = value.Margin;
- value.Owner.Layout.Padding = value.Padding;
- }
-
- // Copy Margin and Padding to new layout being set or restore padding and margin back to
- // View if no replacement. Previously margin and padding values would have been moved from
- // the View to the layout.
- if (_layout != null ) // Existing layout
- {
- if (value != null)
- {
- // Existing layout being replaced so copy over margin and padding values.
- value.Margin = _layout.Margin;
- value.Padding = _layout.Padding;
- }
- else
- {
- // Layout not being replaced so restore margin and padding to View.
- SetValue(MarginProperty, _layout.Margin);
- SetValue(PaddingProperty, _layout.Padding);
- NotifyPropertyChanged();
- }
- }
- else
- {
- // First Layout to be added to the View hence copy
-
- // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
- if (value !=null)
- {
- if (Margin.Top != 0 || Margin.Bottom !=0 || Margin.Start !=0 || Margin.End != 0)
- {
- // If View already has a margin set then store it in Layout instead.
- value.Margin = Margin;
- SetValue(MarginProperty, new Extents(0,0,0,0));
- NotifyPropertyChanged();
- }
-
- if (Padding.Top != 0 || Padding.Bottom !=0 || Padding.Start !=0 || Padding.End != 0)
- {
- // If View already has a padding set then store it in Layout instead.
- value.Padding = Padding;
- SetValue(PaddingProperty, new Extents(0,0,0,0));
- NotifyPropertyChanged();
- }
- }
- }
-
- // Remove existing layout from it's parent layout group.
- _layout?.Unparent();
-
- // Set layout to this view
- SetLayout(value);
- }
- }
-
internal void SetLayout(LayoutItem layout)
{
_layout = layout;
View view = GetParent()?.FindCurrentChildById(id);
//If we can't find the parent's children, find in the top layer.
- if (!view)
+ if (!view)
{
Container parent = GetParent();
while ((parent is View) && (parent != null))
/// [Draft] This class implements a absolute layout, allowing explicit positioning of children.
/// Positions are from the top left of the layout and can be set using the Actor::Property::POSITION and alike.
/// </summary>
- internal class AbsoluteLayout : LayoutGroup
+ public class AbsoluteLayout : LayoutGroup
{
/// <summary>
/// Struct to store Measured states of height and width.
/// <summary>
/// [Draft] Constructor
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public AbsoluteLayout()
{
}
+ /// <summary>
+ /// Measure the layout and its content to determine the measured width and the measured height.<br />
+ /// </summary>
+ /// <param name="widthMeasureSpec">horizontal space requirements as imposed by the parent.</param>
+ /// <param name="heightMeasureSpec">vertical space requirements as imposed by the parent.</param>
+ /// <since_tizen> 6 </since_tizen>
protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
{
float totalHeight = 0.0f;
float maxPositionY = 0.0f;
// measure children
- foreach( LayoutItem childLayout in _children )
+ foreach( LayoutItem childLayout in LayoutChildren )
{
if (childLayout != null)
{
totalWidth = maxPositionX - minPositionX;
totalHeight = maxPositionY - minPositionY;
- if (childLayout.MeasuredWidthAndState.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
+ if (childLayout.MeasuredWidth.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
{
childState.widthState = MeasuredSize.StateType.MeasuredSizeTooSmall;
}
- if (childLayout.MeasuredWidthAndState.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
+ if (childLayout.MeasuredWidth.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
{
childState.heightState = MeasuredSize.StateType.MeasuredSizeTooSmall;
}
ResolveSizeAndState( new LayoutLength(totalHeight), heightMeasureSpec, childState.heightState ) );
}
+ /// <summary>
+ /// Assign a size and position to each of its children.<br />
+ /// </summary>
+ /// <param name="changed">This is a new size or position for this layout.</param>
+ /// <param name="left">Left position, relative to parent.</param>
+ /// <param name="top"> Top position, relative to parent.</param>
+ /// <param name="right">Right position, relative to parent.</param>
+ /// <param name="bottom">Bottom position, relative to parent.</param>
+ /// <since_tizen> 6 </since_tizen>
protected override void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
{
// Absolute layout positions it's children at their Actor positions.
// Children could overlap or spill outside the parent, as is the nature of absolute positions.
- foreach( LayoutItem childLayout in _children )
+ foreach( LayoutItem childLayout in LayoutChildren )
{
if( childLayout != null )
{
/// For more information about the flex layout API and how to use it please refer to https://yogalayout.com/docs/
/// We implement the subset of the API in the class below.
/// </summary>
- internal class FlexLayout : LayoutGroup, global::System.IDisposable
+ public class FlexLayout : LayoutGroup, global::System.IDisposable
{
float Flex{ get; set;}
int AlignSelf{get; set;}
private IntPtr _rootFlex; // Pointer to the unmanged flex layout class.
- public struct MeasuredSize
+ internal struct MeasuredSize
{
public MeasuredSize(float x, float y)
{
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
+ /// <summary>
+ /// Dispose.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
public void Dispose()
{
// Throw exception if Dispose() is called in separate thread.
}
}
+ /// <summary>
+ /// Dispose.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
protected virtual void Dispose(DisposeTypes type)
{
if (disposed)
/// <summary>
/// [Draft] Creates a FlexLayout object.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public FlexLayout() : this(Interop.FlexLayout.FlexLayout_New(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
/// [Draft] Get/Set the flex direction in the layout.
/// The direction of the main-axis which determines the direction that flex items are laid out.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public FlexDirection Direction
{
get
/// <summary>
/// [Draft] Get/Set the justification in the layout.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public FlexJustification Justification
{
get
/// <summary>
/// [Draft] Get/Set the wrap in the layout.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public FlexWrapType WrapType
{
get
/// <summary>
/// [Draft] Get/Set the alignment of the layout content.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public AlignmentType Alignment
{
get
/// <summary>
/// [Draft] Get/Set the alignment of the layout items.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public AlignmentType ItemsAlignment
{
get
/// [Draft] Enumeration for the direction of the main axis in the flex container.
/// This determines the direction that flex items are laid out in the flex container.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public enum FlexDirection
{
/// <summary>
/// <summary>
/// [Draft] Enumeration for the alignment of the flex items when the items do not use all available space on the main-axis.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public enum FlexJustification
{
/// <summary>
/// <summary>
/// [Draft] Enumeration for the wrap type of the flex container when there is no enough room for all the items on one flex line.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public enum FlexWrapType
{
/// <summary>
/// <summary>
/// [Draft] Enumeration for the alignment of the flex items or lines when the items or lines do not use all the available space on the cross-axis.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public enum AlignmentType
{
/// <summary>
void InsertChild( LayoutItem child )
{
// Store created node for child
- Interop.FlexLayout.FlexLayout_AddChild(swigCPtr, View.getCPtr(child.Owner), measureChildDelegate, _children.Count-1);
+ Interop.FlexLayout.FlexLayout_AddChild(swigCPtr, View.getCPtr(child.Owner), measureChildDelegate, LayoutChildren.Count-1);
}
+ /// <summary>
+ /// Callback when child is added to container.<br />
+ /// Derived classes can use this to set their own child properties on the child layout's owner.<br />
+ /// </summary>
+ /// <param name="child">The Layout child.</param>
+ /// <since_tizen> 6 </since_tizen>
protected override void OnChildAdd(LayoutItem child)
{
InsertChild(child);
}
+ /// <summary>
+ /// Callback when child is removed from container.<br />
+ /// </summary>
+ /// <param name="child">The Layout child.</param>
+ /// <since_tizen> 6 </since_tizen>
protected override void OnChildRemove(LayoutItem child)
{
// When child View is removed from it's parent View (that is a Layout) then remove it from the layout too.
Interop.FlexLayout.FlexLayout_RemoveChild(swigCPtr, child);
}
+ /// <summary>
+ /// Measure the layout and its content to determine the measured width and the measured height.<br />
+ /// </summary>
+ /// <param name="widthMeasureSpec">horizontal space requirements as imposed by the parent.</param>
+ /// <param name="heightMeasureSpec">vertical space requirements as imposed by the parent.</param>
+ /// <since_tizen> 6 </since_tizen>
protected override void OnMeasure( MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec )
{
bool isLayoutRtl = Owner.LayoutDirection == ViewLayoutDirectionType.RTL;
GetDefaultSize( new LayoutLength( (float)Interop.FlexLayout.FlexLayout_GetHeight(swigCPtr) ), heightMeasureSpec ) );
}
+ /// <summary>
+ /// Assign a size and position to each of its children.<br />
+ /// </summary>
+ /// <param name="changed">This is a new size or position for this layout.</param>
+ /// <param name="left">Left position, relative to parent.</param>
+ /// <param name="top"> Top position, relative to parent.</param>
+ /// <param name="right">Right position, relative to parent.</param>
+ /// <param name="bottom">Bottom position, relative to parent.</param>
+ /// <since_tizen> 6 </since_tizen>
protected override void OnLayout( bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom )
{
// Call to FlexLayout implementation to calculate layout values for later retrieval.
Interop.FlexLayout.FlexLayout_CalculateLayout( swigCPtr, width.AsDecimal(), height.AsDecimal(), isLayoutRtl );
- int count = _children.Count;
+ int count = LayoutChildren.Count;
for( int childIndex = 0; childIndex < count; childIndex++)
{
- LayoutItem childLayout = _children[childIndex];
+ LayoutItem childLayout = LayoutChildren[childIndex];
if( childLayout != null )
{
// Get the frame for the child, start, top, end, bottom.
/// <summary>
/// [Draft] This class implements a grid layout
/// </summary>
- internal class GridLayout : LayoutGroup
+ public class GridLayout : LayoutGroup
{
const int AUTO_FIT = -1;
private int _columns = 1;
/// [draft] GridLayout Constructor/>
/// </summary>
/// <returns> New Grid object.</returns>
+ /// <since_tizen> 6 </since_tizen>
public GridLayout()
{
_locations = new GridLocations();
}
- // <summary>
- // [Draft] Get/Set the number of columns in the grid
- // </summary>
+ /// <summary>
+ /// [Draft] Get/Set the number of columns in the grid
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
public int Columns
{
get
}
}
+ /// <summary>
+ /// Measure the layout and its content to determine the measured width and the measured height.<br />
+ /// </summary>
+ /// <param name="widthMeasureSpec">horizontal space requirements as imposed by the parent.</param>
+ /// <param name="heightMeasureSpec">vertical space requirements as imposed by the parent.</param>
+ /// <since_tizen> 6 </since_tizen>
protected override void OnMeasure( MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec )
{
var gridWidthMode = widthMeasureSpec.Mode;
Extents gridLayoutPadding = Padding;
- var childCount = _children.Count;
+ var childCount = LayoutChildren.Count;
// WIDTH SPECIFICATIONS
if (childCount > 0)
{
- LayoutItem childLayoutItem = _children[0];
+ LayoutItem childLayoutItem = LayoutChildren[0];
View childOwner = childLayoutItem.Owner;
MeasureChild( childLayoutItem, widthMeasureSpec, heightMeasureSpec );
ResolveSizeAndState( new LayoutLength(heightSize), heightMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK ) );
}
+ /// <summary>
+ /// Assign a size and position to each of its children.<br />
+ /// </summary>
+ /// <param name="changed">This is a new size or position for this layout.</param>
+ /// <param name="left">Left position, relative to parent.</param>
+ /// <param name="top"> Top position, relative to parent.</param>
+ /// <param name="right">Right position, relative to parent.</param>
+ /// <param name="bottom">Bottom position, relative to parent.</param>
+ /// <since_tizen> 6 </since_tizen>
protected override void OnLayout( bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom )
{
List<GridLocations.Cell> locations = _locations.GetLocations();
Extents childMargins = new Extents();
// Margin for all children dependant on if set on first child
- if( _children.Count > 0 )
+ if( LayoutChildren.Count > 0 )
{
- childMargins = _children[0]?.Margin;
+ childMargins = LayoutChildren[0]?.Margin;
}
int index = 0;
- foreach( LayoutItem childLayout in _children )
+ foreach( LayoutItem childLayout in LayoutChildren )
{
// for each child
if( childLayout != null )
/// [Draft]
/// Interface that defines a layout Parent. Enables a layout child to access methods on its parent, e.g. Remove (during unparenting)
/// </summary>
- internal interface ILayoutParent
+ public interface ILayoutParent
{
/// <summary>
/// Add this child to the parent.
/// </summary>
/// <param name="layoutItem">The layout child to add.</param>
+ /// <since_tizen> 6 </since_tizen>
void Add(LayoutItem layoutItem);
/// <summary>
/// Remove this child from the parent
/// </summary>
/// <param name="layoutItem">The layout child to add.</param>
+ /// <since_tizen> 6 </since_tizen>
void Remove(LayoutItem layoutItem);
}
}
/// <summary>
/// [Draft] LayoutGroup class providing container functionality.
/// </summary>
- internal class LayoutGroup : LayoutItem, ILayoutParent
+ public class LayoutGroup : LayoutItem, ILayoutParent
{
- protected List<LayoutItem> _children{ get;} // Children of this LayoutGroup
+ /// <summary>
+ /// [Draft] List of child layouts in this container.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ protected List<LayoutItem> LayoutChildren{ get;} // Children of this LayoutGroup
/// <summary>
/// [Draft] Constructor
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public LayoutGroup()
{
- _children = new List<LayoutItem>();
+ LayoutChildren = new List<LayoutItem>();
}
/// <summary>
- /// [Draft] Constructor setting the owner of this LayoutGroup.
- /// </summary>
- /// <param name="owner">Owning View of this layout, currently a View but may be extending for Windows/Layers.</param>
- public LayoutGroup(View owner) : base(owner)
- {
- _children = new List<LayoutItem>();
- }
-
- /// <summary>
/// From ILayoutParent.<br />
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// <param name="childLayout">LayoutItem to add to the layout group.</param>
public virtual void Add(LayoutItem childLayout)
{
- _children.Add(childLayout);
+ LayoutChildren.Add(childLayout);
childLayout.SetParent(this);
// Child added to use a Add transition.
childLayout.ConditionForAnimation = ConditionForAnimation | TransitionCondition.Add;
/// <summary>
/// Remove all layout children.<br />
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public void RemoveAll()
{
- foreach( LayoutItem childLayout in _children )
+ foreach( LayoutItem childLayout in LayoutChildren )
{
childLayout.ConditionForAnimation = ConditionForAnimation | TransitionCondition.Remove;
childLayout.Owner = null;
}
- _children.Clear();
+ LayoutChildren.Clear();
// todo ensure child LayoutItems are still not parented to this group.
RequestLayout();
}
/// <summary>
/// From ILayoutParent
/// </summary>
+ /// <param name="layoutItem">LayoutItem to remove from the layout group.</param>
+ /// <since_tizen> 6 </since_tizen>
public virtual void Remove(LayoutItem layoutItem)
{
bool childRemoved = false;
- foreach( LayoutItem childLayout in _children.ToList() )
+ foreach( LayoutItem childLayout in LayoutChildren.ToList() )
{
if( childLayout == layoutItem )
{
Window.Instance.LayoutController.AddToRemovalStack(childLayout);
- _children.Remove(childLayout);
+ LayoutChildren.Remove(childLayout);
childLayout.ConditionForAnimation = childLayout.ConditionForAnimation | TransitionCondition.Remove;
// Add LayoutItem to the transition stack so can animate it out.
Window.Instance.LayoutController.AddTransitionDataEntry(new LayoutData(layoutItem, ConditionForAnimation, 0,0,0,0));
/// </summary>
private void SetConditionsForAnimationOnLayoutGroup( TransitionCondition conditionToSet)
{
- foreach( LayoutItem childLayout in _children )
+ foreach( LayoutItem childLayout in LayoutChildren )
{
switch( conditionToSet )
{
/// </summary>
/// <param name="widthMeasureSpec">horizontal space requirements as imposed by the parent.</param>
/// <param name="heightMeasureSpec">vertical space requirements as imposed by the parent.</param>
+ /// <since_tizen> 6 </since_tizen>
protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
{
LayoutLength measuredWidth = new LayoutLength(0.0f);
LayoutLength measuredHeight = new LayoutLength(0.0f);
// Layout takes size of largest child width and largest child height dimensions
- foreach( LayoutItem childLayout in _children )
+ foreach( LayoutItem childLayout in LayoutChildren )
{
if( childLayout != null )
{
}
}
- if( 0 == _children.Count )
+ if( 0 == LayoutChildren.Count )
{
// Must be a leaf as has no children
measuredWidth = GetDefaultSize( SuggestedMinimumWidth, widthMeasureSpec );
/// <param name="top"> Top position, relative to parent.</param>
/// <param name="right">Right position, relative to parent.</param>
/// <param name="bottom">Bottom position, relative to parent.</param>
+ /// <since_tizen> 6 </since_tizen>
protected override void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
{
- foreach( LayoutItem childLayout in _children )
+ foreach( LayoutItem childLayout in LayoutChildren )
{
if( childLayout !=null )
{
}
/// <summary>
- /// Overridden method called when the layout size changes.<br />
- /// </summary>
- /// <param name="newSize">The new size of the layout.</param>
- /// <param name="oldSize">The old size of the layout.</param>
- protected override void OnSizeChanged(LayoutSize newSize, LayoutSize oldSize)
- {
- // Do nothing
- }
-
- /// <summary>
/// Overridden method called when the layout is attached to an owner.<br />
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
protected override void OnAttachedToOwner()
{
// Layout takes ownership of it's owner's children.
/// Derived classes can use this to set their own child properties on the child layout's owner.<br />
/// </summary>
/// <param name="child">The Layout child.</param>
+ /// <since_tizen> 6 </since_tizen>
protected virtual void OnChildAdd(LayoutItem child)
{
}
/// Callback when child is removed from container.<br />
/// </summary>
/// <param name="child">The Layout child.</param>
+ /// <since_tizen> 6 </since_tizen>
protected virtual void OnChildRemove(LayoutItem child)
{
}
/// </summary>
/// <param name="widthMeasureSpec">The width requirements for this view.</param>
/// <param name="heightMeasureSpec">The height requirements for this view.</param>
+ /// <since_tizen> 6 </since_tizen>
protected virtual void MeasureChildren(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
{
- foreach( LayoutItem childLayout in _children )
+ foreach( LayoutItem childLayout in LayoutChildren )
{
MeasureChild( childLayout, widthMeasureSpec, heightMeasureSpec );
}
/// <summary>
/// Ask one of the children of this view to measure itself, taking into
/// account both the MeasureSpec requirements for this view and its padding.<br />
- /// The heavy lifting is done in GetChildMeasureSpec.<br />
+ /// The heavy lifting is done in GetChildMeasureSpecification.<br />
/// </summary>
/// <param name="child">The child to measure.</param>
/// <param name="parentWidthMeasureSpec">The width requirements for this view.</param>
/// <param name="parentHeightMeasureSpec">The height requirements for this view.</param>
+ /// <since_tizen> 6 </since_tizen>
protected virtual void MeasureChild(LayoutItem child, MeasureSpecification parentWidthMeasureSpec, MeasureSpecification parentHeightMeasureSpec)
{
View childOwner = child.Owner;
/// <param name="widthUsed">Extra space that has been used up by the parent horizontally (possibly by other children of the parent).</param>
/// <param name="parentHeightMeasureSpec">The height requirements for this view.</param>
/// <param name="heightUsed">Extra space that has been used up by the parent vertically (possibly by other children of the parent).</param>
+ /// <since_tizen> 6 </since_tizen>
protected virtual void MeasureChildWithMargins(LayoutItem child, MeasureSpecification parentWidthMeasureSpec, LayoutLength widthUsed, MeasureSpecification parentHeightMeasureSpec, LayoutLength heightUsed)
{
View childOwner = child.Owner;
/// [Draft] Base class for layouts. It is used to layout a View
/// It can be laid out by a LayoutGroup.
/// </summary>
- internal class LayoutItem
+ public class LayoutItem
{
static bool LayoutDebugFrameData = false; // Debug flag
private MeasureSpecification OldWidthMeasureSpec; // Store measure specification to compare against later
private Extents _padding;
private Extents _margin;
- public TransitionCondition ConditionForAnimation{get; set;}
-
/// <summary>
- /// [Draft] The View that this Layout has been assigned to.
+ /// [Draft] Condition event that is causing this Layout to transition.
/// </summary>
- public View Owner{get; set;} // Should not keep a View alive.
+ internal TransitionCondition ConditionForAnimation{get; set;}
/// <summary>
- /// [Draft] Is this Layout set to animate its content.
+ /// [Draft] The View that this Layout has been assigned to.
/// </summary>
- public bool Animate{get; set;}
+ /// <since_tizen> 6 </since_tizen>
+ public View Owner{get; set;} // Should not keep a View alive.
/// <summary>
/// [Draft] Margin for this LayoutItem
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public Extents Margin
{
get
/// <summary>
/// [Draft] Padding for this LayoutItem
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public Extents Padding
{
get
/// <summary>
/// [Draft] Constructor
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public LayoutItem()
{
Initialize();
}
/// <summary>
- /// [Draft] Constructor setting the owner of this LayoutItem.
- /// </summary>
- /// <param name="owner">Owning View of this layout, currently a View but may be extending for Windows/Layers.</param>
- public LayoutItem(View owner)
- {
- Owner = owner;
- Initialize();
- }
-
- /// <summary>
/// [Draft] Set parent to this layout.
/// </summary>
/// <param name="parent">Parent to set on this Layout.</param>
- public void SetParent( ILayoutParent parent)
+ internal void SetParent( ILayoutParent parent)
{
Parent = parent as LayoutGroup;
}
/// <summary>
/// Unparent this layout from it's owner, and remove any layout children in derived types. <br />
/// </summary>
- public void Unparent()
+ internal void Unparent()
{
// Enable directly derived types to first remove children
OnUnparent();
}
/// <summary>
- /// Get the View owning this LayoutItem
- /// </summary>
- internal View GetOwner()
- {
- return Owner;
- }
-
- /// <summary>
/// Initialize the layout and allow derived classes to also perform any operations
/// </summary>
/// <param name="owner">Owner of this Layout.</param>
/// </summary>
/// <param name="widthMeasureSpec"> Horizontal space requirements as imposed by the parent.</param>
/// <param name="heightMeasureSpec">Vertical space requirements as imposed by the parent.</param>
- internal void Measure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
+ /// <since_tizen> 6 </since_tizen>
+ public void Measure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
{
// Check if relayouting is required.
bool specChanged = (widthMeasureSpec.Size != OldWidthMeasureSpec.Size) ||
/// <param name="top">Top position, relative to parent.</param>
/// <param name="right">Right position, relative to parent.</param>
/// <param name="bottom">Bottom position, relative to parent.</param>
+ /// <since_tizen> 6 </since_tizen>
public void Layout(LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
{
bool changed = SetFrame(left.AsRoundedValue(),
/// <param name="size"> Default size for this layout.</param>
/// <param name="measureSpecification"> Constraints imposed by the parent.</param>
/// <returns>The size this layout should be.</returns>
+ /// <since_tizen> 6 </since_tizen>
public static LayoutLength GetDefaultSize(LayoutLength size, MeasureSpecification measureSpecification)
{
LayoutLength result = size;
return result;
}
+ /// <summary>
+ /// Get the Layouts parent
+ /// </summary>
+ /// <returns>Layout parent with an LayoutParent interface</returns>
+ /// <since_tizen> 6 </since_tizen>
public ILayoutParent GetParent()
{
return Parent;
/// Request that this layout is re-laid out.<br />
/// This will make this layout and all it's parent layouts dirty.<br />
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public void RequestLayout()
{
Flags = Flags | LayoutFlags.ForceLayout;
/// <summary>
/// Predicate to determine if this layout has been requested to re-layout.<br />
/// </summary>
- public bool LayoutRequested
+
+ internal bool LayoutRequested
{
get
{
/// Get the measured width (without any measurement flags).<br />
/// This method should be used only during measurement and layout calculations.<br />
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public MeasuredSize MeasuredWidth{ get; set; } = new MeasuredSize( new LayoutLength(-3), MeasuredSize.StateType.MeasuredSizeOK);
/// <summary>
/// Get the measured height (without any measurement flags).<br />
/// This method should be used only during measurement and layout calculations.<br />
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public MeasuredSize MeasuredHeight{ get; set; } = new MeasuredSize( new LayoutLength(-3), MeasuredSize.StateType.MeasuredSizeOK);
/// <summary>
- /// Get the measured width and state.<br />
- /// This method should be used only during measurement and layout calculations.<br />
- /// </summary>
- public MeasuredSize MeasuredWidthAndState
- {
- get
- {
- return MeasuredWidth; // Not bitmasking State unless proven to be required.
- }
- }
-
-
- /// <summary>
- /// Get the measured height and state.<br />
- /// This method should be used only during measurement and layout calculations.<br />
- /// </summary>
- public MeasuredSize MeasuredHeightAndState
- {
- get
- {
- return MeasuredHeight; // Not bitmasking State unless proven to be required.
- }
- }
-
- /// <summary>
/// Returns the suggested minimum width that the layout should use.<br />
/// This returns the maximum of the layout's minimum width and the owner's natural width.<br />
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public LayoutLength SuggestedMinimumWidth
{
get
/// Returns the suggested minimum height that the layout should use.<br />
/// This returns the maximum of the layout's minimum height and the owner's natural height.<br />
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public LayoutLength SuggestedMinimumHeight
{
get
/// 2. If the owner's View.WidthSpecification is set to View.LayoutParamPolicies.WrapContent, then the view's width is set based on the suggested minimum width. (@see GetSuggestedMinimumWidth()).<br />
/// 3. If the owner's View.WidthSpecification is set to View.LayoutParamPolicies.MatchParent, then the parent width takes precedence over the minimum width.<br />
/// </summary>
- public LayoutLength MinimumWidth {get; set;}
+ internal LayoutLength MinimumWidth {get; set;}
/// <summary>
/// Sets the minimum height of the layout.<br />
/// 2. If the owner's View.HeightSpecification is set to View.LayoutParamPolicies.WrapContent, then the view's height is set based on the suggested minimum height. (@see GetSuggestedMinimumHeight()).<br />
/// 3. If the owner's View.HeightSpecification is set to View.LayoutParamPolicies.MatchParent, then the parent height takes precedence over the minimum height.<br />
/// </summary>
- public LayoutLength MinimumHeight {get; set;}
+ internal LayoutLength MinimumHeight {get; set;}
///<summary>
/// Utility to reconcile a desired size and state, with constraints imposed by a MeasureSpecification.
/// <param name="measureSpecification"> Constraints imposed by the parent.</param>
/// <param name="childMeasuredState"> Size information bit mask for the layout's children.</param>
/// <returns> A measured size, which may indicate that it is too small. </returns>
+ /// <since_tizen> 6 </since_tizen>
protected MeasuredSize ResolveSizeAndState( LayoutLength size, MeasureSpecification measureSpecification, MeasuredSize.StateType childMeasuredState )
{
var specMode = measureSpecification.Mode;
/// </summary>
/// <param name="measuredWidth">The measured width of this layout.</param>
/// <param name="measuredHeight">The measured height of this layout.</param>
+ /// <since_tizen> 6 </since_tizen>
protected void SetMeasuredDimensions( MeasuredSize measuredWidth, MeasuredSize measuredHeight )
{
MeasuredWidth = measuredWidth;
/// </summary>
/// <param name="widthMeasureSpec">horizontal space requirements as imposed by the parent.</param>
/// <param name="heightMeasureSpec">vertical space requirements as imposed by the parent.</param>
+ /// <since_tizen> 6 </since_tizen>
protected virtual void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
{
// GetDefaultSize will limit the MeasureSpec to the suggested minimumWidth and minimumHeight
/// <param name="top">Top position, relative to parent.</param>
/// <param name="right">Right position, relative to parent.</param>
/// <param name="bottom">Bottom position, relative to parent.</param>
+ /// <since_tizen> 6 </since_tizen>
protected virtual void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
{
}
/// <summary>
- /// Virtual method to inform derived classes when the layout size changed. <br />
- /// </summary>
- /// <param name="newSize">The new size of the layout.</param>
- /// <param name="oldSize">The old size of the layout.</param>
- protected virtual void OnSizeChanged(LayoutSize newSize, LayoutSize oldSize)
- {
- }
-
- /// <summary>
/// Virtual method to allow derived classes to remove any children before it is removed from
/// its parent.
/// </summary>
- public virtual void OnUnparent()
+ /// <since_tizen> 6 </since_tizen>
+ protected virtual void OnUnparent()
{
}
/// Virtual method called when this Layout is attached to it's owner.
/// Allows derived layouts to take ownership of child Views and connect to any Owner signals required.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
protected virtual void OnAttachedToOwner()
{
}
/// <summary>
/// [Draft] A type that represents a layout length. Currently, this implies pixels, but could be extended to handle device dependant sizes, etc.
/// </summary>
- internal struct LayoutLength
+ public struct LayoutLength
{
private float _value;
/// [Draft] Constructor from an int
/// </summary>
/// <param name="value">Int to initialize with.</param>
+ /// <since_tizen> 6 </since_tizen>
public LayoutLength(int value)
{
_value = value;
/// [Draft] Constructor from a float
/// </summary>
/// <param name="value">Float to initialize with.</param>
+ /// <since_tizen> 6 </since_tizen>
public LayoutLength(float value)
{
_value = value;
/// [Draft] Constructor from a LayoutLength
/// </summary>
/// <param name="layoutLength">LayoutLength object to initialize with.</param>
+ /// <since_tizen> 6 </since_tizen>
public LayoutLength(LayoutLength layoutLength)
{
_value = layoutLength._value;
/// [Draft] Return value as rounded value (whole number), best used as final output
/// </summary>
/// <returns>The layout length value as a rounded whole number.</returns>
+ /// <since_tizen> 6 </since_tizen>
public float AsRoundedValue()
{
return (float)Math.Round((decimal)_value, MidpointRounding.AwayFromZero);
/// [Draft] Return value as the raw decimal value, best used for calculations
/// </summary>
/// <returns>The layout length value as the raw decimal value.</returns>
+ /// <since_tizen> 6 </since_tizen>
public float AsDecimal()
{
return _value;
/// <param name="arg1">The first value.</param>
/// <param name="arg2">The second value</param>
/// <returns>true if LayoutLengths are equal</returns>
+ /// <since_tizen> 6 </since_tizen>
public static bool operator ==(LayoutLength arg1, LayoutLength arg2)
{
return arg1.Equals(arg2);
/// <param name="arg1">The first value.</param>
/// <param name="arg2">The second value</param>
/// <returns>true if LayoutLengths are not equal</returns>
+ /// <since_tizen> 6 </since_tizen>
public static bool operator !=(LayoutLength arg1, LayoutLength arg2)
{
return !arg1.Equals(arg2);
/// </summary>
/// <param name="obj">The object to compare with the current object.</param>
/// <returns>true if equal LayoutLength, else false.</returns>
+ /// <since_tizen> 6 </since_tizen>
public override bool Equals(object obj)
{
if (obj is LayoutLength)
/// </summary>
/// <param name="layoutLength">The LayoutLength to compare with the current LayoutLength.</param>
/// <returns>true if equal LayoutLengths, else false.</returns>
+ /// <since_tizen> 6 </since_tizen>
public bool Equals(LayoutLength layoutLength)
{
return (Math.Abs(_value - layoutLength._value ) <= float.Epsilon);
/// <summary>
/// A hash code for the current object.
/// </summary>
+ /// <returns>Calculated hash code.</returns>
+ /// <since_tizen> 6 </since_tizen>
public override int GetHashCode()
{
return (int)Math.Ceiling(_value);
/// <param name="arg1">The first value.</param>
/// <param name="arg2">The second value.</param>
/// <returns>The LayoutLength containing the result of the addition.</returns>
+ /// <since_tizen> 6 </since_tizen>
public static LayoutLength operator +(LayoutLength arg1, LayoutLength arg2)
{
return new LayoutLength( arg1._value + arg2._value );
/// <param name="arg1">The first value.</param>
/// <param name="arg2">The second value.</param>
/// <returns>The LayoutLength containing the result of the addition.</returns>
+ /// <since_tizen> 6 </since_tizen>
public static LayoutLength operator +(LayoutLength arg1, int arg2)
{
return new LayoutLength(arg1._value + (float)arg2);
/// <param name="arg1">The first value.</param>
/// <param name="arg2">The second value.</param>
/// <returns>The LayoutLength containing the result of the subtraction.</returns>
+ /// <since_tizen> 6 </since_tizen>
public static LayoutLength operator -(LayoutLength arg1, LayoutLength arg2)
{
return new LayoutLength(arg1._value - arg2._value);
/// <param name="arg1">The first value.</param>
/// <param name="arg2">The second value.</param>
/// <returns>The LayoutLength containing the result of the subtraction.</returns>
+ /// <since_tizen> 6 </since_tizen>
public static LayoutLength operator -(LayoutLength arg1, int arg2)
{
return new LayoutLength(arg1._value - (float)arg2);
/// <param name="arg1">The first value.</param>
/// <param name="arg2">The second value.</param>
/// <returns>The LayoutLength containing the result of the multiplication.</returns>
+ /// <since_tizen> 6 </since_tizen>
public static LayoutLength operator *(LayoutLength arg1, LayoutLength arg2)
{
return new LayoutLength(arg1._value * arg2._value);
/// <param name="arg1">The first value.</param>
/// <param name="arg2">The int value to scale the LayoutLength.</param>
/// <returns>The LayoutLength containing the result of the scaling.</returns>
+ /// <since_tizen> 6 </since_tizen>
public static LayoutLength operator *(LayoutLength arg1, int arg2)
{
return new LayoutLength(arg1._value * arg2);
/// <param name="arg1">The first value.</param>
/// <param name="arg2">The second value.</param>
/// <returns>The LayoutLength containing the result of the division.</returns>
+ /// <since_tizen> 6 </since_tizen>
public static LayoutLength operator /(LayoutLength arg1, LayoutLength arg2)
{
return new LayoutLength(arg1._value / arg2._value);
/// <param name="arg1">The first value.</param>
/// <param name="arg2">The int value to scale the vector by.</param>
/// <returns>The LayoutLength containing the result of the scaling.</returns>
+ /// <since_tizen> 6 </since_tizen>
public static LayoutLength operator /(LayoutLength arg1, int arg2)
{
return new LayoutLength(arg1._value / (float)arg2);
using System.Collections.Generic;
using System;
-using System.ComponentModel;
namespace Tizen.NUI
{
/// <summary>
/// Define a List of LayoutTransitions
/// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
public class TransitionList : List<LayoutTransition> {}
/// <summary>
+ /// The conditions for transitions.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ [FlagsAttribute] public enum TransitionCondition
+ {
+ /// <summary>
+ /// Default when a condition has not been set.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ Unspecified = 0,
+ /// <summary>
+ /// Animate changing layout to another layout.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+
+ LayoutChanged = 1,
+ /// <summary>
+ /// Animate adding item.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+
+ Add = 2,
+ /// <summary>
+ /// Animate removing item.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+
+ Remove = 4,
+ /// <summary>
+ /// Animation when an item changes due to a being added.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+
+ ChangeOnAdd = 8,
+ /// <summary>
+ /// Animation when an item changes due to a being removed.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+
+ ChangeOnRemove = 16
+ }
+
+ /// <summary>
/// The properties that can be animated.
/// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
public enum AnimatableProperties
{
/// <summary>
/// Position property.
/// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
+
Position,
/// <summary>
/// Size property.
/// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
+
Size,
/// <summary>
/// Opacity property.
/// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
+
Opacity
}
/// <summary>
/// Parts of the transition that can be configured to provide a custom effect.
/// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
public class TransitionComponents
{
/// <summary>
/// TransitionComponents default constructor.
/// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
public TransitionComponents()
{
Delay = 0;
/// TransitionComponents constructor. Stores delay, duration and AlphaFunction.
/// </summary>
/// <param name="delay">The delay before the animator starts.</param>
- /// <param name="duration">the duration fo the animator.</param>
+ /// <param name="duration">the duration of the animator.</param>
/// <param name="alphaFunction">alpha function to use .</param>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
+
public TransitionComponents(int delay, int duration, AlphaFunction alphaFunction)
{
Delay = delay;
}
/// <summary>
- /// Time the transition should execute. Milliseconds.
+ /// Get, Set the time transition should execute for . Milliseconds.
/// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
public int Duration;
/// <summary>
- /// Delay before the transition executes. Milliseconds.
+ /// Get, Set the delay before the transition executes. Milliseconds.
/// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
public int Delay;
/// <summary>
- /// Function to alter the transition path over time.
+ /// Get, Set the function to alter the transition path over time.
/// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
public AlphaFunction AlphaFunction;
}
/// <summary>
- /// LayoutTransition stores the aninmation setting for a transition conidition.
+ /// LayoutTransition stores the animation setting for a transition conidition.
/// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
public class LayoutTransition
{
/// <summary>
/// LayoutTransition default constructor.
/// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
public LayoutTransition()
{
Condition = TransitionCondition.Unspecified;
/// <param name="animatableProperty">the property to animate.</param>
/// <param name="targetValue">target value of the property.</param>
/// <param name="animator">Components to define the animator.</param>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
public LayoutTransition( TransitionCondition condition,
AnimatableProperties animatableProperty,
object targetValue,
/// <summary>
/// Condition for this Transition
/// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
+
public TransitionCondition Condition{get; set;}
/// <summary>
/// Property to animate.
/// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
+
public AnimatableProperties AnimatableProperty{get; set;}
/// <summary>
/// Components of the Animator.
/// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
+
public TransitionComponents Animator{get; set;}
/// <summary>
/// Target value to animate to.
/// </summary>
- /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 6 </since_tizen>
+
public object TargetValue{get; set;}
}
/// <summary>
/// [Draft] This class implements a linear box layout, automatically handling right to left or left to right direction change.
/// </summary>
- internal class LinearLayout : LayoutGroup
+ public class LinearLayout : LayoutGroup
{
/// <summary>
/// [Draft] Enumeration for the direction in which the content is laid out
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public enum Orientation
{
/// <summary>
/// <summary>
/// [Draft] Enumeration for the alignment of the linear layout items
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public enum Alignment
{
/// <summary>
/// <summary>
/// [Draft] Get/Set the orientation in the layout
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public LinearLayout.Orientation LinearOrientation
{
get
/// <summary>
/// [Draft] Get/Set the padding between cells in the layout
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public Size2D CellPadding
{
get
/// <summary>
/// [Draft] Get/Set the alignment in the layout
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public LinearLayout.Alignment LinearAlignment{ get; set; } = Alignment.Top;
private float _totalLength = 0.0f;
/// <summary>
/// [Draft] Constructor
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public LinearLayout()
{
}
+ /// <summary>
+ /// Measure the layout and its content to determine the measured width and the measured height.
+ /// </summary>
+ /// <param name="widthMeasureSpec">horizontal space requirements as imposed by the parent.</param>
+ /// <param name="heightMeasureSpec">vertical space requirements as imposed by the parent.</param>
+ /// <since_tizen> 6 </since_tizen>
protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
{
if (_linearOrientation == Orientation.Horizontal)
}
}
+ /// <summary>
+ /// Layout should assign a size and position to each of its children.<br />
+ /// </summary>
+ /// <param name="changed">This is a new size or position for this layout.</param>
+ /// <param name="left">Left position, relative to parent.</param>
+ /// <param name="top"> Top position, relative to parent.</param>
+ /// <param name="right">Right position, relative to parent.</param>
+ /// <param name="bottom">Bottom position, relative to parent.</param>
+ /// <since_tizen> 6 </since_tizen>
protected override void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
{
if (_linearOrientation == Orientation.Horizontal)
childLayout.Measure( childWidthMeasureSpec, childHeightMeasureSpec );
// Child may now not fit in horizontal dimension.
- if( childLayout.MeasuredWidthAndState.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
+ if( childLayout.MeasuredWidth.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
{
childState.widthState = MeasuredSize.StateType.MeasuredSizeTooSmall;
}
// Child may now not fit in vertical dimension.
- if( childLayout.MeasuredHeightAndState.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
+ if( childLayout.MeasuredHeight.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
{
childState.heightState = MeasuredSize.StateType.MeasuredSizeTooSmall;
}
// Weighted children are not measured at this phase.
// Available space for weighted children will be calculated in the phase 2 based on totalLength value.
// Max height of children is stored.
- foreach( LayoutItem childLayout in _children )
+ foreach( LayoutItem childLayout in LayoutChildren )
{
int childDesiredHeight = childLayout.Owner.HeightSpecification;
float childWeight = childLayout.Owner.Weight;
float marginHeight = childMargin.Top + childMargin.Bottom;
float childHeight = childLayout.MeasuredHeight.Size.AsDecimal() + marginHeight;
- if (childLayout.MeasuredWidthAndState.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
+ if (childLayout.MeasuredWidth.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
{
childState.widthState = MeasuredSize.StateType.MeasuredSizeTooSmall;
}
- if (childLayout.MeasuredHeightAndState.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
+ if (childLayout.MeasuredHeight.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
{
childState.heightState = MeasuredSize.StateType.MeasuredSizeTooSmall;
}
maxHeight = 0;
_totalLength = 0;
- int numberOfChildren = _children.Count;
+ int numberOfChildren = LayoutChildren.Count;
for( int i = 0; i < numberOfChildren; ++i )
{
- LayoutItem childLayout = _children[i];
+ LayoutItem childLayout = LayoutChildren[i];
float desiredChildHeight = childLayout.Owner.HeightSpecification;
// Weighted children are not measured in this phase.
// Available space for weighted children will be calculated in the phase 2 based on _totalLength value.
uint index = 0;
- foreach( LayoutItem childLayout in _children )
+ foreach( LayoutItem childLayout in LayoutChildren )
{
int childDesiredWidth = childLayout.Owner.WidthSpecification;
int childDesiredHeight = childLayout.Owner.HeightSpecification;
float length = childHeight + childMargin.Top + childMargin.Bottom;
float cellPadding = CellPadding.Height;
// No need to add cell padding to the end of last item.
- if (index>=_children.Count-1)
+ if (index>=LayoutChildren.Count-1)
{
cellPadding = 0.0f;
}
float marginWidth = (childLayout.Margin.Start) + (childLayout.Margin.End);
float childWidth = childLayout.MeasuredWidth.Size.AsDecimal() + marginWidth;
- if (childLayout.MeasuredWidthAndState.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
+ if (childLayout.MeasuredWidth.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
{
childState.widthState = MeasuredSize.StateType.MeasuredSizeTooSmall;
}
- if (childLayout.MeasuredHeightAndState.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
+ if (childLayout.MeasuredHeight.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
{
childState.heightState = MeasuredSize.StateType.MeasuredSizeTooSmall;
}
_totalLength = 0;
- int numberOfChildren = _children.Count;
+ int numberOfChildren = LayoutChildren.Count;
for( int i = 0; i < numberOfChildren; ++i )
{
- LayoutItem childLayout = _children[i];
+ LayoutItem childLayout = LayoutChildren[i];
float desiredChildWidth = childLayout.Owner.WidthSpecification;
// Space available for child
LayoutLength childSpace = new LayoutLength( height - Padding.Top - Padding.Bottom);
- int count = _children.Count;
+ int count = LayoutChildren.Count;
switch (LinearAlignment)
{
{
int childIndex = start + dir * i;
// Get a reference to the childLayout at the given index
- LayoutItem childLayout = _children[childIndex];
+ LayoutItem childLayout = LayoutChildren[childIndex];
if( childLayout != null )
{
LayoutLength childWidth = childLayout.MeasuredWidth.Size;
// Space available for child
LayoutLength childSpace = new LayoutLength( width - Padding.Start - Padding.End);
- int count = _children.Count;
+ int count = LayoutChildren.Count;
switch (LinearAlignment)
{
for( int i = 0; i < count; i++)
{
- LayoutItem childLayout = _children[i];
+ LayoutItem childLayout = LayoutChildren[i];
if( childLayout != null )
{
LayoutLength childWidth = childLayout.MeasuredWidth.Size;
// ourselves. The measured height should be the max height of the children, changed
// to accommodate the heightMeasureSpec from the parent
MeasureSpecification uniformMeasureSpec = new MeasureSpecification( MeasuredHeight.Size, MeasureSpecification.ModeType.Exactly);
- foreach (LayoutItem childLayout in _children)
+ foreach (LayoutItem childLayout in LayoutChildren)
{
int desiredChildHeight = childLayout.Owner.HeightSpecification;
int desiredChildWidth = childLayout.Owner.WidthSpecification;
{
// Pretend that the linear layout has an exact size.
MeasureSpecification uniformMeasureSpec = new MeasureSpecification( MeasuredWidth.Size, MeasureSpecification.ModeType.Exactly);
- foreach (LayoutItem childLayout in _children)
+ foreach (LayoutItem childLayout in LayoutChildren)
{
int desiredChildWidth = childLayout.Owner.WidthSpecification;
int desiredChildHeight = childLayout.Owner.WidthSpecification;
/// [Draft] A MeasureSpecification is used during the Measure pass by a LayoutGroup to inform it's children how to be measured.
/// For instance, it may measure a child with an exact width and an unspecified height in order to determine height for width.
/// </summary>
- internal struct MeasureSpecification
+ public struct MeasureSpecification
{
/// <summary>
/// MeasureSpecification Size value.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public LayoutLength Size;
/// <summary>
/// MeasureSpecification Mode.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public MeasureSpecification.ModeType Mode;
/// <summary>
/// Constructor taking size and mode type.
/// </summary>
/// <param name="size">size value.</param>
- /// <param name="mode">mode vaue.</param>
+ /// <param name="mode">mode value.</param>
+ /// <since_tizen> 6 </since_tizen>
public MeasureSpecification(LayoutLength size, MeasureSpecification.ModeType mode)
{
Size = size;
Mode = mode;
}
+ /// <summary>
+ /// Size mode for this MeasureSpecification
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
public enum ModeType
{
/// <summary>
/// <summary>
/// [Draft] Class that encodes a measurement and a measure state, which is set if the measured size is too small.
/// </summary>
- internal struct MeasuredSize
+ public struct MeasuredSize
{
/// <summary>
/// Constructor
/// </summary>
/// <param name="measuredSize">size parameter</param>
/// <param name="state">State</param>
+ /// <since_tizen> 6 </since_tizen>
public MeasuredSize(LayoutLength measuredSize, MeasuredSize.StateType state)
{
Size = measuredSize;
/// Creates a MeasuredSize from a LayoutLength
/// </summary>
/// <param name="measuredSize">LayoutLength to create </param>
+ /// <since_tizen> 6 </since_tizen>
+ /// <returns> Returns a MeasuredSize object</returns>
public static implicit operator MeasuredSize(LayoutLength measuredSize)
{
return new MeasuredSize(measuredSize, StateType.MeasuredSizeOK);
/// <summary>
/// LayoutLength size property
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public LayoutLength Size{ get; set;}
/// <summary>
/// Measured state for this size.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public StateType State{ get; set; }
/// <summary>
/// Measured states for a Size value.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
public enum StateType
{
/// <summary>
}
}
+ /// <summary>
+ /// Get the LayoutController for this Window.
+ /// </summary>
internal LayoutController LayoutController
{
get
var center = childIncrement / 2;
// Check layout direction
- var view = GetOwner();
+ var view = Owner;
ViewLayoutDirectionType layoutDirection = view.LayoutDirection;
for (uint i = 0; i < count; i++)
var center = childIncrement / 2;
// Check layout direction
- var view = GetOwner();
+ var view = Owner;
ViewLayoutDirectionType layoutDirection = view.LayoutDirection;
// this is needed, otherwise the child's LayoutItem is garbage collected!
}
var center = childIncrement / 2;
- var view = GetOwner();
+ var view = Owner;
ViewLayoutDirectionType layoutDirection = view.LayoutDirection;
for (uint i = 0; i < ChildCount; ++i)
var center = childIncrement / 2;
// Check layout direction
- var view = GetOwner();
+ var view = Owner;
ViewLayoutDirectionType layoutDirection = view.LayoutDirection;
// this is needed, otherwise the child's LayoutItem is garbage collected!
}
var center = childIncrement / 2;
- var view = GetOwner();
+ var view = Owner;
ViewLayoutDirectionType layoutDirection = view.LayoutDirection;
for (uint i = 0; i < ChildCount; ++i)
var center = childIncrement / 2;
// Check layout direction
- var view = GetOwner();
+ var view = Owner;
ViewLayoutDirectionType layoutDirection = view.LayoutDirection;
for (uint i = 0; i < count; i++)
var center = childIncrement / 2;
// Check layout direction
- var view = GetOwner();
+ var view = Owner;
ViewLayoutDirectionType layoutDirection = view.LayoutDirection;
for (uint i = 0; i < count; i++)