/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * 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.
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal FrameBufferImage GetFrameBufferImage(string name)
- {
- FrameBufferImage ret = new FrameBufferImage(Interop.Builder.Builder_GetFrameBufferImage(swigCPtr, name), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
public Path GetPath(string name)
{
Path ret = new Path(Interop.Builder.Builder_GetPath(swigCPtr, name), true);
/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * 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.
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- public void SetUserImageAndOutputRenderTarget(Image inputImage, FrameBufferImage outputRenderTarget)
+ public void SetUserImageAndOutputRenderTarget(Texture inputTexture, FrameBuffer outputRenderTarget)
{
- Interop.GaussianBlurView.GaussianBlurView_SetUserImageAndOutputRenderTarget(swigCPtr, Image.getCPtr(inputImage), FrameBufferImage.getCPtr(outputRenderTarget));
+ Interop.GaussianBlurView.GaussianBlurView_SetUserImageAndOutputRenderTarget(swigCPtr, Texture.getCPtr(inputTexture), FrameBuffer.getCPtr(outputRenderTarget));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
public static extern void Adaptor_SetRenderRefreshRate(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2);
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Adaptor_SetUseHardwareVSync")]
- public static extern void Adaptor_SetUseHardwareVSync(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2);
-
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Adaptor_Get")]
public static extern global::System.IntPtr Adaptor_Get();
public static extern void Builder_CreateRenderTask(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Builder_GetFrameBufferImage")]
- public static extern global::System.IntPtr Builder_GetFrameBufferImage(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
-
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Builder_GetPath")]
public static extern global::System.IntPtr Builder_GetPath(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_PageTurnView_Property_PAGE_SIZE_get")]
- public static extern int PageTurnView_Property_PAGE_SIZE_get();
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_PageTurnView_Property_VIEW_PAGE_SIZE_get")]
+ public static extern int PageTurnView_Property_VIEW_PAGE_SIZE_get();
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_PageTurnView_Property_CURRENT_PAGE_ID_get")]
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_SWIGUpcast")]
public static extern global::System.IntPtr View_SWIGUpcast(global::System.IntPtr jarg1);
-
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_SetLayout")]
- public static extern void View_SetLayout(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_GetLayout")]
- public static extern global::System.IntPtr View_GetLayout(global::System.Runtime.InteropServices.HandleRef jarg1);
-
-
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_SetLayoutingRequired")]
- public static extern void View_SetLayoutingRequired(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2);
-
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_IsLayoutingRequired")]
- public static extern bool View_IsLayoutingRequired(global::System.Runtime.InteropServices.HandleRef jarg1);
-
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_IsResourceReady")]
public static extern bool IsResourceReady(global::System.Runtime.InteropServices.HandleRef jarg1);
-
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ResourceReadySignal")]
public static extern global::System.IntPtr ResourceReadySignal(global::System.Runtime.InteropServices.HandleRef jarg1);
--- /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;
+using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using System.Runtime.InteropServices;
+
+namespace Tizen.NUI
+{
+ /// <summary>
+ /// [Draft] This class implements a flex layout.
+ /// The flex layout implementation is based on open source Facebook Yoga layout engine.
+ /// 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
+ {
+ float Flex{ get; set;}
+ int AlignSelf{get; set;}
+
+ private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+ private bool swigCMemOwn;
+ private bool disposed;
+ private bool isDisposeQueued = false;
+
+ private IntPtr _rootFlex; // Pointer to the unmanged flex layout class.
+
+ public struct MeasuredSize
+ {
+ public MeasuredSize(float x, float y)
+ {
+ width = x;
+ height = y;
+ }
+ float width;
+ float height;
+ };
+
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ internal delegate MeasuredSize ChildMeasureCallback( global::System.IntPtr child, float width, int measureModeWidth, float height, int measureModeHeight );
+
+ event ChildMeasureCallback measureChildDelegate; // Stores a delegate to the child measure callback. Used for all children of this FlexLayout.
+
+ internal FlexLayout(global::System.IntPtr cPtr, bool cMemoryOwn)
+ {
+ swigCMemOwn = cMemoryOwn;
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ _rootFlex = Interop.FlexLayout.FlexLayout_New();
+ measureChildDelegate = new ChildMeasureCallback(measureChild);
+ }
+
+ internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FlexLayout obj)
+ {
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+ }
+
+ public void Dispose()
+ {
+ // Throw exception if Dispose() is called in separate thread.
+ if (!Window.IsInstalled())
+ {
+ throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
+ }
+
+ if (isDisposeQueued)
+ {
+ Dispose(DisposeTypes.Implicit);
+ }
+ else
+ {
+ Dispose(DisposeTypes.Explicit);
+ System.GC.SuppressFinalize(this);
+ }
+ }
+
+ protected virtual void Dispose(DisposeTypes type)
+ {
+ if (disposed)
+ {
+ return;
+ }
+
+ if (type == DisposeTypes.Explicit)
+ {
+ // Called by User
+ // Release your own managed resources here.
+ // You should release all of your own disposable objects here.
+
+ }
+
+ // Release your own unmanaged resources here.
+ // You should not access any managed member here except static instance.
+ // because the execution order of Finalizes is non-deterministic.
+ if (swigCPtr.Handle != global::System.IntPtr.Zero)
+ {
+ if (swigCMemOwn)
+ {
+ swigCMemOwn = false;
+ Interop.FlexLayout.delete_FlexLayout(swigCPtr);
+ }
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+ disposed = true;
+ }
+
+ /// <summary>
+ /// [Draft] Creates a FlexLayout object.
+ /// </summary>
+ public FlexLayout() : this(Interop.FlexLayout.FlexLayout_New(), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ internal static FlexLayout DownCast(BaseHandle handle)
+ {
+ FlexLayout ret = new FlexLayout(Interop.FlexLayout.FlexLayout_DownCast(BaseHandle.getCPtr(handle)), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal FlexLayout(FlexLayout other) : this(Interop.FlexLayout.new_FlexLayout__SWIG_1(FlexLayout.getCPtr(other)), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ internal FlexLayout Assign(FlexLayout other)
+ {
+ FlexLayout ret = new FlexLayout(Interop.FlexLayout.FlexLayout_Assign(swigCPtr, FlexLayout.getCPtr(other)), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal void SetFlexDirection(FlexLayout.FlexDirection flexDirection)
+ {
+ Interop.FlexLayout.FlexLayout_SetFlexDirection(swigCPtr, (int)flexDirection);
+ RequestLayout();
+ }
+
+ internal FlexLayout.FlexDirection GetFlexDirection()
+ {
+ FlexLayout.FlexDirection ret = (FlexLayout.FlexDirection)Interop.FlexLayout.FlexLayout_GetFlexDirection(swigCPtr);
+ return ret;
+
+ }
+
+ internal void SetFlexJustification(FlexLayout.FlexJustification flexJustification)
+ {
+ Interop.FlexLayout.FlexLayout_SetFlexJustification(swigCPtr, (int)flexJustification);
+ RequestLayout();
+ }
+
+ internal FlexLayout.FlexJustification GetFlexJustification()
+ {
+ FlexLayout.FlexJustification ret = (FlexLayout.FlexJustification)Interop.FlexLayout.FlexLayout_GetFlexJustification(swigCPtr);
+ return ret;
+ }
+
+ internal void SetFlexWrap(FlexLayout.FlexWrapType flexWrap)
+ {
+ Interop.FlexLayout.FlexLayout_SetFlexWrap(swigCPtr, (int)flexWrap);
+ RequestLayout();
+ }
+
+ internal FlexLayout.FlexWrapType GetFlexWrap()
+ {
+ FlexLayout.FlexWrapType ret = (FlexLayout.FlexWrapType)Interop.FlexLayout.FlexLayout_GetFlexWrap(swigCPtr);
+ return ret;
+ }
+
+ internal void SetFlexAlignment(FlexLayout.AlignmentType flexAlignment)
+ {
+ Interop.FlexLayout.FlexLayout_SetFlexAlignment(swigCPtr, (int)flexAlignment);
+ RequestLayout();
+ }
+
+ internal FlexLayout.AlignmentType GetFlexAlignment()
+ {
+ FlexLayout.AlignmentType ret = (FlexLayout.AlignmentType)Interop.FlexLayout.FlexLayout_GetFlexAlignment(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal void SetFlexItemsAlignment(FlexLayout.AlignmentType flexAlignment)
+ {
+ Interop.FlexLayout.FlexLayout_SetFlexItemsAlignment(swigCPtr, (int)flexAlignment);
+ RequestLayout();
+ }
+
+ internal FlexLayout.AlignmentType GetFlexItemsAlignment()
+ {
+ FlexLayout.AlignmentType ret = (FlexLayout.AlignmentType)Interop.FlexLayout.FlexLayout_GetFlexItemsAlignment(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// [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>
+ public FlexDirection Direction
+ {
+ get
+ {
+ return GetFlexDirection();
+ }
+ set
+ {
+ SetFlexDirection(value);
+ }
+ }
+
+ /// <summary>
+ /// [Draft] Get/Set the justification in the layout.
+ /// </summary>
+ public FlexJustification Justification
+ {
+ get
+ {
+ return GetFlexJustification();
+ }
+ set
+ {
+ SetFlexJustification(value);
+ }
+ }
+
+ /// <summary>
+ /// [Draft] Get/Set the wrap in the layout.
+ /// </summary>
+ public FlexWrapType WrapType
+ {
+ get
+ {
+ return GetFlexWrap();
+ }
+ set
+ {
+ SetFlexWrap(value);
+ }
+ }
+
+ /// <summary>
+ /// [Draft] Get/Set the alignment of the layout content.
+ /// </summary>
+ public AlignmentType Alignment
+ {
+ get
+ {
+ return GetFlexAlignment();
+ }
+ set
+ {
+ SetFlexAlignment(value);
+ }
+ }
+
+ /// <summary>
+ /// [Draft] Get/Set the alignment of the layout items.
+ /// </summary>
+ public AlignmentType ItemsAlignment
+ {
+ get
+ {
+ return GetFlexItemsAlignment();
+ }
+ set
+ {
+ SetFlexItemsAlignment(value);
+ }
+ }
+
+ /// <summary>
+ /// [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>
+ public enum FlexDirection
+ {
+ /// <summary>
+ /// The flexible items are displayed vertically as a column
+ /// </summary>
+ Column,
+ /// <summary>
+ /// The flexible items are displayed vertically as a column, but in reverse order
+ /// </summary>
+ ColumnReverse,
+ /// <summary>
+ /// The flexible items are displayed horizontally as a row
+ /// </summary>
+ Row,
+ /// <summary>
+ /// The flexible items are displayed horizontally as a row, but in reverse order
+ /// </summary>
+ RowReverse
+ }
+
+ /// <summary>
+ /// [Draft] Enumeration for the alignment of the flex items when the items do not use all available space on the main-axis.
+ /// </summary>
+ public enum FlexJustification
+ {
+ /// <summary>
+ /// Items are positioned at the beginning of the container
+ /// </summary>
+ FlexStart,
+ /// <summary>
+ /// Items are positioned at the center of the container
+ /// </summary>
+ Center,
+ /// <summary>
+ /// Items are positioned at the end of the container
+ /// </summary>
+ FlexEnd,
+ /// <summary>
+ /// Items are positioned with equal space between the lines
+ /// </summary>
+ SpaceBetween,
+ /// <summary>
+ /// Items are positioned with equal space before, between, and after the lines
+ /// </summary>
+ SpaceAround
+ }
+
+ /// <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>
+ public enum FlexWrapType
+ {
+ /// <summary>
+ /// Flex items laid out in single line (shrunk to fit the flex container along the main axis)
+ /// </summary>
+ NoWrap,
+ /// <summary>
+ /// Flex items laid out in multiple lines if needed
+ /// </summary>
+ Wrap
+ }
+
+ /// <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>
+ public enum AlignmentType
+ {
+ /// <summary>
+ /// Inherits the same alignment from the parent
+ /// </summary>
+ Auto,
+ /// <summary>
+ /// At the beginning of the container
+ /// </summary>
+ FlexStart,
+ /// <summary>
+ /// At the center of the container
+ /// </summary>
+ Center,
+ /// <summary>
+ /// At the end of the container
+ /// </summary>
+ FlexEnd,
+ /// <summary>
+ /// Stretch to fit the container
+ /// </summary>
+ Stretch
+ }
+
+ private MeasuredSize measureChild(global::System.IntPtr child, float width, int measureModeWidth, float height, int measureModeHeight)
+ {
+ View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
+ Size2D viewSize = new Size2D(8,8);
+ if(view)
+ {
+ viewSize = view.NaturalSize2D;
+ }
+ return new MeasuredSize(viewSize.Width,viewSize.Height);
+ }
+
+ void InsertChild( LayoutItem child )
+ {
+ // Store created node for child
+ Interop.FlexLayout.FlexLayout_AddChild(swigCPtr, View.getCPtr(child.Owner), measureChildDelegate, _children.Count-1);
+ }
+
+ protected override void OnChildAdd(LayoutItem child)
+ {
+ InsertChild(child);
+ }
+
+ 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.
+ // FlexLayout refers to the child as a View not LayoutItem.
+ Interop.FlexLayout.FlexLayout_RemoveChild(swigCPtr, child);
+ }
+
+ protected override void OnMeasure( MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec )
+ {
+ bool isLayoutRtl = Owner.LayoutDirection == ViewLayoutDirectionType.RTL;
+ Extents padding = Owner.Padding;
+ Extents margin = Owner.Margin;
+
+ Interop.FlexLayout.FlexLayout_SetMargin(swigCPtr, Extents.getCPtr(margin));
+ Interop.FlexLayout.FlexLayout_SetPadding(swigCPtr, Extents.getCPtr(padding));
+
+ float width = 0.0f;
+ float height = 0.0f;
+
+ if( widthMeasureSpec.Mode == MeasureSpecification.ModeType.Exactly || widthMeasureSpec.Mode == MeasureSpecification.ModeType.AtMost )
+ {
+ width = widthMeasureSpec.Size.AsDecimal();
+ }
+
+ if ( heightMeasureSpec.Mode == MeasureSpecification.ModeType.Exactly || heightMeasureSpec.Mode == MeasureSpecification.ModeType.AtMost )
+ {
+ height = heightMeasureSpec.Size.AsDecimal();
+ }
+
+ Interop.FlexLayout.FlexLayout_CalculateLayout( swigCPtr, width, height, isLayoutRtl );
+
+ SetMeasuredDimensions( GetDefaultSize( new LayoutLength( (float)Interop.FlexLayout.FlexLayout_GetWidth(swigCPtr) ), widthMeasureSpec ),
+ GetDefaultSize( new LayoutLength( (float)Interop.FlexLayout.FlexLayout_GetHeight(swigCPtr) ), heightMeasureSpec ) );
+ }
+
+ protected override void OnLayout( bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom )
+ {
+
+ bool isLayoutRtl = Owner.LayoutDirection == ViewLayoutDirectionType.RTL;
+ LayoutLength width = right - left;
+ LayoutLength height = bottom - top;
+
+ // 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;
+ for( int childIndex = 0; childIndex < count; childIndex++)
+ {
+ LayoutItem childLayout = _children[childIndex];
+ if( childLayout != null )
+ {
+ // Get the frame for the child, start, top, end, bottom.
+ Vector4 frame = new Vector4(Interop.FlexLayout.FlexLayout_GetNodeFrame(swigCPtr, childIndex ), true);
+ childLayout.Layout( new LayoutLength(frame.X), new LayoutLength(frame.Y), new LayoutLength(frame.Z), new LayoutLength(frame.W) );
+ }
+ }
+ }
+
+ } // FLexlayout
+} // namesspace Tizen.NUI
\ No newline at end of file
{
internal static partial class FlexLayout
{
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_New")]
+ public static extern global::System.IntPtr FlexLayout_New();
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SWIGUpcast")]
- public static extern global::System.IntPtr FlexLayout_SWIGUpcast(global::System.IntPtr jarg1);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetContext")]
+ public static extern global::System.IntPtr FlexLayout_SetContext( global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetMeasureFunction")]
+ public static extern global::System.IntPtr FlexLayout_SetMeasureFunction( global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_ChildProperty_FLEX_get")]
- public static extern int FlexLayout_ChildProperty_FLEX_get();
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_AddChild")]
+ public static extern void FlexLayout_AddChild( global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, Tizen.NUI.FlexLayout.ChildMeasureCallback jarg3, int jarg4);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_RemoveChild")]
+ public static extern global::System.IntPtr FlexLayout_RemoveChild( global::System.Runtime.InteropServices.HandleRef jarg1, LayoutItem jarg2);
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_ChildProperty_ALIGN_SELF_get")]
- public static extern int FlexLayout_ChildProperty_ALIGN_SELF_get();
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_CalculateLayout")]
+ public static extern global::System.IntPtr FlexLayout_CalculateLayout( global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2, float jarg3, bool jarg4);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_GetWidth")]
+ public static extern global::System.IntPtr FlexLayout_GetWidth(global::System.Runtime.InteropServices.HandleRef jarg1);
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_FlexLayout__SWIG_0")]
- public static extern global::System.IntPtr new_FlexLayout__SWIG_0();
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_GetHeight")]
+ public static extern global::System.IntPtr FlexLayout_GetHeight(global::System.Runtime.InteropServices.HandleRef jarg1);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_GetNodeFrame")]
+ public static extern global::System.IntPtr FlexLayout_GetNodeFrame(global::System.Runtime.InteropServices.HandleRef jarg1, int index);
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_New")]
- public static extern global::System.IntPtr FlexLayout_New();
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_MarkDirty")]
+ public static extern global::System.IntPtr FlexLayout_MarkDirty (global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetMargin")]
+ public static extern global::System.IntPtr FlexLayout_SetMargin( global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetPadding")]
+ public static extern global::System.IntPtr FlexLayout_SetPadding( global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_DownCast")]
public static extern global::System.IntPtr FlexLayout_DownCast(global::System.Runtime.InteropServices.HandleRef jarg1);
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_FlexLayout__SWIG_1")]
public static extern global::System.IntPtr new_FlexLayout__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1);
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_Assign")]
public static extern global::System.IntPtr FlexLayout_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_FlexLayout")]
public static extern void delete_FlexLayout(global::System.Runtime.InteropServices.HandleRef jarg1);
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetFlexDirection")]
public static extern void FlexLayout_SetFlexDirection(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_GetFlexDirection")]
public static extern int FlexLayout_GetFlexDirection(global::System.Runtime.InteropServices.HandleRef jarg1);
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetFlexJustification")]
public static extern void FlexLayout_SetFlexJustification(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_GetFlexJustification")]
public static extern int FlexLayout_GetFlexJustification(global::System.Runtime.InteropServices.HandleRef jarg1);
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetFlexWrap")]
public static extern void FlexLayout_SetFlexWrap(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_GetFlexWrap")]
public static extern int FlexLayout_GetFlexWrap(global::System.Runtime.InteropServices.HandleRef jarg1);
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetFlexAlignment")]
public static extern void FlexLayout_SetFlexAlignment(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_GetFlexAlignment")]
public static extern int FlexLayout_GetFlexAlignment(global::System.Runtime.InteropServices.HandleRef jarg1);
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetFlexItemsAlignment")]
public static extern void FlexLayout_SetFlexItemsAlignment(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_GetFlexItemsAlignment")]
public static extern int FlexLayout_GetFlexItemsAlignment(global::System.Runtime.InteropServices.HandleRef jarg1);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetMaximumWidth")]
+ public static extern void FlexLayout_SetFlexMaximumWidth(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetMaximumHeight")]
+ public static extern void FlexLayout_SetFlexMaximumHeight(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetMinimumWidth")]
+ public static extern void FlexLayout_SetFlexMinimumWidth(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetMinimumHeight")]
+ public static extern void FlexLayout_SetFlexMinimumHeight(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2);
}
}
}
{
if (rootNode.Layout != null)
{
- Log.Info("NUI", "Found root:" + rootNode.Name + "\n");
// rootNode has a layout, ensure all children have default layouts or layout items.
AutomaticallyAssignLayouts(rootNode);
// rootNode has a layout, start measuring and layouting from here.
MeasureSpecification.ModeType widthMode = MeasureSpecification.ModeType.AtMost;
MeasureSpecification.ModeType heightMode = MeasureSpecification.ModeType.AtMost;
- if (root.WidthSpecification >= 0 )
+ if ( root.WidthSpecification >= 0 )
{
// exact size provided so match width exactly
width = new LayoutLength(root.WidthSpecification);
}
else if (root.WidthSpecification == LayoutParamPolicies.MatchParent)
{
+
widthMode = MeasureSpecification.ModeType.Exactly;
}
/// </summary>
private void Process(int id)
{
- Layer defaultLayer = _window.GetDefaultLayer();
- for (uint i = 0; i < defaultLayer.ChildCount; i++)
+ // First layer in the Window should be the default layer (index 0 )
+ uint numberOfLayers = _window.LayerCount;
+ for (uint layerIndex = 0; layerIndex < numberOfLayers; layerIndex++)
{
- View view = defaultLayer.GetChildAt(i);
- FindRootLayouts(view);
+ Layer layer = _window.GetLayer(layerIndex);
+ for (uint i = 0; i < layer.ChildCount; i++)
+ {
+ View view = layer.GetChildAt(i);
+ FindRootLayouts(view);
+ }
}
}
/// <summary>
/// At the vertical center of the container
/// </summary>
- CenterVertical = 0x20
+ CenterVertical = 0x20,
+ /// <summary>
+ /// At the vertical and horizontal center of the container
+ /// </summary>
+ Center = 0x40
}
struct HeightAndWidthState
/// <summary>
/// [Draft] Get/Set the alignment in the layout
/// </summary>
- public LinearLayout.Alignment LinearAlignment{ get; set; } = Alignment.CenterVertical;
+ public LinearLayout.Alignment LinearAlignment{ get; set; } = Alignment.Top;
private float _totalLength = 0.0f;
private Size2D _cellPadding = new Size2D(0,0);
}
}
+
+ private void MeasureWeightedChild( LayoutItem childLayout, float remainingExcess, float remainingWeight, float childWeight,
+ MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec,
+ HeightAndWidthState childState, Orientation orientation )
+ {
+ bool horizontal = false;
+ if (orientation == Orientation.Horizontal)
+ {
+ horizontal = true;
+ }
+
+ float childsShare = ( childWeight * remainingExcess ) / remainingWeight;
+ remainingExcess -= childsShare;
+ remainingWeight -= childWeight;
+
+ float desiredWidth = childLayout.Owner.WidthSpecification;
+ float desiredHeight = childLayout.Owner.HeightSpecification;
+ float childLength = 0;
+
+ Extents layoutPadding = Padding;
+
+ // Always lay out weighted elements with intrinsic size regardless of the parent spec.
+ // for consistency between specs.
+ if( ( horizontal && ( desiredWidth == 0 )) || ( !horizontal && ( desiredHeight == 0 )) )
+ {
+ // This child needs to be laid out from scratch using
+ // only its share of excess space.
+ childLength = childsShare;
+ }
+ else
+ {
+ // This child had some intrinsic width to which we
+ // need to add its share of excess space.
+ if (horizontal)
+ {
+ childLength = childLayout.MeasuredWidth.Size.AsDecimal() + childsShare;
+ }
+ else
+ {
+ childLength = childLayout.MeasuredHeight.Size.AsDecimal() + childsShare;
+ }
+ }
+
+ MeasureSpecification childWidthMeasureSpec;
+ MeasureSpecification childHeightMeasureSpec;
+
+ if (horizontal)
+ {
+ childWidthMeasureSpec = new MeasureSpecification( new LayoutLength(childLength), MeasureSpecification.ModeType.Exactly );
+ childHeightMeasureSpec = GetChildMeasureSpecification( heightMeasureSpec,
+ new LayoutLength(layoutPadding.Top + layoutPadding.Bottom),
+ new LayoutLength(desiredHeight) );
+ }
+ else // vertical
+ {
+ childWidthMeasureSpec = GetChildMeasureSpecification( widthMeasureSpec,
+ new LayoutLength(Padding.Start + Padding.End),
+ new LayoutLength(desiredWidth) );
+
+ childHeightMeasureSpec = new MeasureSpecification( new LayoutLength(childLength), MeasureSpecification.ModeType.Exactly);
+ }
+
+ childLayout.Measure( childWidthMeasureSpec, childHeightMeasureSpec );
+
+ // Child may now not fit in horizontal dimension.
+ if( childLayout.MeasuredWidthAndState.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
+ {
+ childState.widthState = MeasuredSize.StateType.MeasuredSizeTooSmall;
+ }
+
+ // Child may now not fit in vertical dimension.
+ if( childLayout.MeasuredHeightAndState.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
+ {
+ childState.heightState = MeasuredSize.StateType.MeasuredSizeTooSmall;
+ }
+ }
+
private void MeasureHorizontal(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
{
var widthMode = widthMeasureSpec.Mode;
float weightedMaxHeight = 0.0f;
float totalWeight = 0.0f;
- // Reset total length
+ // Reset measure variables
_totalLength = 0.0f;
- LayoutLength usedExcessSpace = new LayoutLength(0);
-
+ float usedExcessSpace = 0.0f;
HeightAndWidthState childState = new HeightAndWidthState(MeasuredSize.StateType.MeasuredSizeOK,
MeasuredSize.StateType.MeasuredSizeOK);
- // Measure children, and determine if further resolution is required
-
// 1st phase:
// We cycle through all children and measure children with weight 0 (non weighted children) according to their specs
// to accumulate total used space in totalLength based on measured sizes and margins.
// 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 )
{
- LayoutLength childDesiredWidth = new LayoutLength(childLayout.Owner.WidthSpecification);
- LayoutLength childDesiredHeight = new LayoutLength(childLayout.Owner.HeightSpecification);
+ int childDesiredHeight = childLayout.Owner.HeightSpecification;
float childWeight = childLayout.Owner.Weight;
Extents childMargin = childLayout.Margin;
totalWeight += childWeight;
- bool useExcessSpace = (childDesiredWidth.AsRoundedValue() == 0 ) && (childWeight > 0);
+ bool useExcessSpace = (childLayout.Owner.WidthSpecification == 0 ) && (childWeight > 0);
if( isExactly && useExcessSpace )
{
+ // Children to be laid out with excess space can be measured later
_totalLength += childMargin.Start + childMargin.End;
}
else
{
- if( useExcessSpace )
+ if (useExcessSpace)
{
- // The widthMode is either UNSPECIFIED or AT_MOST, and
+ // The widthMode is either Unspecified or AtMost, and
// this child is only laid out using excess space. Measure
- // using WRAP_CONTENT so that we can find out the view's
+ // using WrapContent so that we can find out the view's
// optimal width.
- MeasureSpecification childWidthMeasureSpec = GetChildMeasureSpecification(widthMeasureSpec, new LayoutLength(childLayout.Padding.Start + childLayout.Padding.End),
- new LayoutLength(LayoutParamPolicies.WrapContent) );
- MeasureSpecification childHeightMeasureSpec = GetChildMeasureSpecification(heightMeasureSpec, new LayoutLength(childLayout.Padding.Top + childLayout.Padding.Bottom),
- childDesiredHeight);
+ MeasureSpecification childWidthMeasureSpec = GetChildMeasureSpecification(widthMeasureSpec,
+ new LayoutLength(childLayout.Padding.Start + childLayout.Padding.End),
+ new LayoutLength(LayoutParamPolicies.WrapContent));
+
+ MeasureSpecification childHeightMeasureSpec = GetChildMeasureSpecification(heightMeasureSpec,
+ new LayoutLength(childLayout.Padding.Top + childLayout.Padding.Bottom),
+ new LayoutLength(childDesiredHeight));
+
childLayout.Measure( childWidthMeasureSpec, childHeightMeasureSpec);
- usedExcessSpace += childLayout.MeasuredWidth.Size;
+ usedExcessSpace += childLayout.MeasuredWidth.Size.AsDecimal();
}
else
{
MeasureChild(childLayout, widthMeasureSpec, heightMeasureSpec);
}
- LayoutLength childWidth = childLayout.MeasuredWidth.Size;
+ LayoutLength childWidth = childLayout.MeasuredWidth.Size;
LayoutLength length = childWidth + childMargin.Start + childMargin.End;
- if( isExactly )
+
+ if (isExactly)
{
_totalLength += length.AsDecimal();
}
}
bool matchHeightLocally = false;
- if(heightMode != MeasureSpecification.ModeType.Exactly && (int)childDesiredHeight.AsRoundedValue() == LayoutParamPolicies.MatchParent)
+ if (heightMode != MeasureSpecification.ModeType.Exactly && childDesiredHeight == LayoutParamPolicies.MatchParent)
{
+ // A child has set to MatchParent on it's height.
// Will have to re-measure at least this child when we know exact height.
matchHeight = true;
matchHeightLocally = true;
}
- LayoutLength marginHeight = new LayoutLength(childMargin.Top + childMargin.Bottom);
- LayoutLength childHeight = childLayout.MeasuredHeight.Size + marginHeight;
+ float marginHeight = childMargin.Top + childMargin.Bottom;
+ float childHeight = childLayout.MeasuredHeight.Size.AsDecimal() + marginHeight;
- if( childLayout.MeasuredWidthAndState.State == MeasuredSize.StateType.MeasuredSizeTooSmall )
+ if (childLayout.MeasuredWidthAndState.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
{
childState.widthState = MeasuredSize.StateType.MeasuredSizeTooSmall;
}
- if( childLayout.MeasuredHeightAndState.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
+ if (childLayout.MeasuredHeightAndState.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
{
childState.heightState = MeasuredSize.StateType.MeasuredSizeTooSmall;
}
- maxHeight = Math.Max( maxHeight, childHeight.AsDecimal());
- allFillParent = ( allFillParent && childDesiredHeight.AsRoundedValue() == LayoutParamPolicies.MatchParent );
+ maxHeight = Math.Max( maxHeight, childHeight);
+ allFillParent = ( allFillParent && childDesiredHeight == LayoutParamPolicies.MatchParent);
- if( childWeight > 0 )
+ if (childWeight > 0)
{
- /*
- * Heights of weighted Views are bogus if we end up
- * remeasuring, so keep them separate.
- */
- weightedMaxHeight = Math.Max( weightedMaxHeight, matchHeightLocally ? marginHeight.AsDecimal() : childHeight.AsDecimal());
+ // Heights of weighted Views are invalid if we end up remeasuring, so store them separately.
+ weightedMaxHeight = Math.Max( weightedMaxHeight, matchHeightLocally ? marginHeight : childHeight);
}
else
{
- alternativeMaxHeight = Math.Max( alternativeMaxHeight, matchHeightLocally ? marginHeight.AsDecimal() : childHeight.AsDecimal() );
+ alternativeMaxHeight = Math.Max( alternativeMaxHeight, matchHeightLocally ? marginHeight : childHeight );
}
} // foreach
Extents padding = Padding;
_totalLength += padding.Start + padding.End;
- LayoutLength widthSize = new LayoutLength(_totalLength);
- widthSize = new LayoutLength( Math.Max( widthSize.AsDecimal(), SuggestedMinimumWidth.AsDecimal()));
- MeasuredSize widthSizeAndState = ResolveSizeAndState( widthSize, widthMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK);
- widthSize = widthSizeAndState.Size;
+
+ float widthSize = _totalLength;
+ widthSize = Math.Max( widthSize, SuggestedMinimumWidth.AsDecimal());
+ MeasuredSize widthSizeAndState = ResolveSizeAndState( new LayoutLength(widthSize), widthMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK);
+ widthSize = widthSizeAndState.Size.AsDecimal();
+
+ // 2nd phase:
+ // Expand children with weight to take up available space
+ // We cycle through weighted children now (children with weight > 0).
+ // The children are measured with exact size equal to their share of the available space based on their weights.
+ // _totalLength is updated to include weighted children measured sizes.
+ float remainingExcess = widthSize - _totalLength + usedExcessSpace;
+ if( remainingExcess != 0 && totalWeight > 0 )
+ {
+ float remainingWeight = totalWeight;
+ maxHeight = 0;
+ _totalLength = 0;
+
+ int numberOfChildren = _children.Count;
+ for( int i = 0; i < numberOfChildren; ++i )
+ {
+ LayoutItem childLayout = _children[i];
+
+ float desiredChildHeight = childLayout.Owner.HeightSpecification;
+
+ float childWeight = childLayout.Owner.Weight;
+ Extents childMargin = childLayout.Margin;
+
+ if( childWeight > 0 )
+ {
+ MeasureWeightedChild(childLayout, remainingExcess, remainingWeight, childWeight,
+ widthMeasureSpec, heightMeasureSpec, childState,
+ Orientation.Horizontal );
+ }
+
+ float length = childLayout.MeasuredWidth.Size.AsDecimal() + childMargin.Start + childMargin.End;
+ float cellPadding = i < numberOfChildren - 1 ? CellPadding.Width : 0;
+ if( isExactly )
+ {
+ _totalLength += length;
+ }
+ else
+ {
+ float totalLength = _totalLength;
+ _totalLength = Math.Max( _totalLength, _totalLength + length + cellPadding );
+ }
+
+ bool matchHeightLocally = (heightMode != MeasureSpecification.ModeType.Exactly) && (desiredChildHeight == LayoutParamPolicies.MatchParent);
+ float marginHeight = childMargin.Top + childMargin.Bottom;
+ float childHeight = childLayout.MeasuredHeight.Size.AsDecimal() + marginHeight;
+
+ maxHeight = Math.Max( maxHeight, childHeight );
+ alternativeMaxHeight = Math.Max( alternativeMaxHeight, matchHeightLocally ? marginHeight : childHeight );
+ allFillParent = (allFillParent && desiredChildHeight == LayoutParamPolicies.MatchParent);
+
+ _totalLength += padding.Start + padding.End;
+ } // for loop
+ }
+ else
+ {
+ // No excess space or no weighted children
+ alternativeMaxHeight = Math.Max( alternativeMaxHeight, weightedMaxHeight );
+ }
if (!allFillParent && heightMode != MeasureSpecification.ModeType.Exactly)
{
maxHeight = alternativeMaxHeight;
}
+
maxHeight += padding.Top + padding.Bottom;
maxHeight = Math.Max( maxHeight, SuggestedMinimumHeight.AsRoundedValue() );
if (matchHeight)
{
- ForceUniformHeight( _children.Count, widthMeasureSpec );
+ ForceUniformHeight(widthMeasureSpec);
}
- } // MeasureHorizontally
+ } // MeasureHorizontal
- void MeasureVertical( MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec )
+ private void MeasureVertical( MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec )
{
var widthMode = widthMeasureSpec.Mode;
var heightMode = heightMeasureSpec.Mode;
// Reset total length
_totalLength = 0.0f;
- LayoutLength usedExcessSpace = new LayoutLength(0);
+ float usedExcessSpace =0.0f;
HeightAndWidthState childState = new HeightAndWidthState(MeasuredSize.StateType.MeasuredSizeOK,
MeasuredSize.StateType.MeasuredSizeTooSmall);
// 1st phase:
// We cycle through all children and measure children with weight 0 (non weighted children) according to their specs
- // to accumulate total used space in mTotalLength based on measured sizes and margins.
- // Weighted children are not measured at this phase.
- // Available space for weighted children will be calculated in the phase 2 based on mTotalLength value.
+ // to accumulate total used space in _totalLength.
+ // 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 )
{
- LayoutLength childDesiredWidth = new LayoutLength(childLayout.Owner.WidthSpecification);
- LayoutLength childDesiredHeight = new LayoutLength(childLayout.Owner.HeightSpecification);
+ int childDesiredWidth = childLayout.Owner.WidthSpecification;
+ int childDesiredHeight = childLayout.Owner.HeightSpecification;
float childWeight = childLayout.Owner.Weight;
Extents childMargin = childLayout.Margin;
totalWeight += childWeight;
- bool useExcessSpace = (childDesiredHeight.AsRoundedValue() == 0) && (childWeight > 0);
+ bool useExcessSpace = (childDesiredHeight == 0) && (childWeight > 0);
if( isExactly && useExcessSpace )
{
- LayoutLength totalLength = new LayoutLength(_totalLength);
- _totalLength = Math.Max( totalLength.AsDecimal(), (totalLength + childMargin.Top + childMargin.Bottom).AsDecimal() );
+ _totalLength = Math.Max( _totalLength, (_totalLength + childMargin.Top + childMargin.Bottom) );
}
else
{
- LayoutLength childHeight = new LayoutLength(0);
+ float childHeight = 0.0f;
if( useExcessSpace )
{
// The heightMode is either Unspecified or AtMost, and
// this child is only laid out using excess space. Measure
// using WrapContent so that we can find out the view's
- // optimal height. We'll restore the original height of 0
- // after measurement.
+ // optimal height.
+ // We'll restore the original height of 0 after measurement.
MeasureSpecification childWidthMeasureSpec = GetChildMeasureSpecification( widthMeasureSpec,
new LayoutLength(childLayout.Padding.Start + childLayout.Padding.End),
- childDesiredWidth);
+ new LayoutLength(childDesiredWidth) );
MeasureSpecification childHeightMeasureSpec = GetChildMeasureSpecification( heightMeasureSpec,
new LayoutLength(childLayout.Padding.Top + childLayout.Padding.Bottom),
new LayoutLength(LayoutParamPolicies.WrapContent) );
childLayout.Measure( childWidthMeasureSpec, childHeightMeasureSpec );
- childHeight = childLayout.MeasuredHeight.Size;
+ childHeight = childLayout.MeasuredHeight.Size.AsDecimal();
usedExcessSpace += childHeight;
}
else
{
MeasureChild( childLayout, widthMeasureSpec, heightMeasureSpec );
- childHeight = childLayout.MeasuredHeight.Size;
+ childHeight = childLayout.MeasuredHeight.Size.AsDecimal();
}
- float length = (childHeight + childMargin.Top + childMargin.Bottom).AsDecimal();
+ 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)
}
bool matchWidthLocally = false;
- if( widthMode != MeasureSpecification.ModeType.Exactly && childDesiredWidth == new LayoutLength(LayoutParamPolicies.MatchParent) )
+ if( widthMode != MeasureSpecification.ModeType.Exactly && (childDesiredWidth == LayoutParamPolicies.MatchParent) )
{
// Will have to re-measure at least this child when we know exact height.
matchWidth = true;
}
float marginWidth = (childLayout.Margin.Start) + (childLayout.Margin.End);
- LayoutLength childWidth = new LayoutLength(childLayout.MeasuredWidth.Size.AsDecimal() + marginWidth);
+ float childWidth = childLayout.MeasuredWidth.Size.AsDecimal() + marginWidth;
- // was combineMeasuredStates()
if (childLayout.MeasuredWidthAndState.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
{
childState.widthState = MeasuredSize.StateType.MeasuredSizeTooSmall;
childState.heightState = MeasuredSize.StateType.MeasuredSizeTooSmall;
}
- maxWidth = (Math.Max( maxWidth, childWidth.AsDecimal()));
- allFillParent = (allFillParent && (childDesiredWidth == new LayoutLength(LayoutParamPolicies.MatchParent)));
+ maxWidth = Math.Max( maxWidth, childWidth);
+ allFillParent = (allFillParent && (childDesiredWidth == LayoutParamPolicies.MatchParent));
- float widthforWeight = childWidth.AsDecimal();
+ float widthforWeight = childWidth;
if (matchWidthLocally)
{
widthforWeight = marginWidth;
if (childWeight > 0)
{
- /*
- * Widths of weighted Views are bogus if we end up remeasuring, so keep them separate.
- */
+ // Widths of weighted Views are bogus if we end up remeasuring, so keep them separate.
weightedMaxWidth = Math.Max( weightedMaxWidth, widthforWeight);
}
else
{
alternativeMaxWidth = Math.Max( alternativeMaxWidth, widthforWeight);
}
+ index++;
} // foreach
MeasuredSize heightSizeAndState = ResolveSizeAndState( heightSize, heightMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK);
heightSize = heightSizeAndState.Size;
- // Either expand children with weight to take up available space or
- // shrink them if they extend beyond our current bounds. If we skipped
- // measurement on any children, we need to measure them now.
-
// 2nd phase:
// We cycle through weighted children now (children with weight > 0).
// The children are measured with exact size equal to their share of the available space based on their weights.
- // TotalLength is updated to include weighted children measured sizes.
-
- float remainingExcess = heightSize.AsDecimal() - _totalLength + usedExcessSpace.AsDecimal();
+ // _totalLength is updated to include weighted children measured sizes.
+ float remainingExcess = heightSize.AsDecimal() - _totalLength + usedExcessSpace;
if( remainingExcess != 0 && totalWeight > 0.0f )
{
- float remainingWeightSum = totalWeight;
+ float remainingWeight = totalWeight;
_totalLength = 0;
- foreach( LayoutItem childLayout in _children )
+ int numberOfChildren = _children.Count;
+ for( int i = 0; i < numberOfChildren; ++i )
{
- int desiredWidth = childLayout.Owner.WidthSpecification;
- int desiredHeight = childLayout.Owner.HeightSpecification;
+ LayoutItem childLayout = _children[i];
+
+ float desiredChildWidth = childLayout.Owner.WidthSpecification;
+
float childWeight = childLayout.Owner.Weight;
Extents childMargin = childLayout.Margin;
- float childHeight = 0;
if( childWeight > 0 )
{
- float share = ( childWeight * remainingExcess ) / remainingWeightSum;
- remainingExcess -= share;
- remainingWeightSum -= childWeight;
-
- // Always lay out weighted elements with intrinsic size regardless of the parent spec
- // for consistency between specs.
- if( desiredHeight == 0 )
- {
- // This child needs to be laid out from scratch using
- // only its share of excess space.
- childHeight = share;
- }
- else
- {
- // This child had some intrinsic width to which we
- // need to add its share of excess space.
- childHeight = childLayout.MeasuredHeight.Size.AsDecimal() + share;
- }
-
- MeasureSpecification childWidthMeasureSpec = GetChildMeasureSpecification( widthMeasureSpec,
- new LayoutLength(Padding.Start + Padding.End),
- new LayoutLength(desiredWidth) );
-
- MeasureSpecification childHeightMeasureSpec = new MeasureSpecification( new LayoutLength(childHeight), MeasureSpecification.ModeType.Exactly);
- childLayout.Measure( childWidthMeasureSpec, childHeightMeasureSpec );
-
- // Child may now not fit in vertical dimension.
- if( childLayout.MeasuredHeightAndState.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
- {
- childState.heightState = MeasuredSize.StateType.MeasuredSizeTooSmall;
- }
+ MeasureWeightedChild(childLayout, remainingExcess, remainingWeight, childWeight,
+ widthMeasureSpec, heightMeasureSpec, childState,
+ Orientation.Vertical);
}
bool matchWidthLocally = false;
- if( widthMode != MeasureSpecification.ModeType.Exactly && desiredWidth == (int)ChildLayoutData.MatchParent )
+ if( widthMode != MeasureSpecification.ModeType.Exactly && desiredChildWidth == LayoutParamPolicies.MatchParent)
{
// Will have to re-measure at least this child when we know exact height.
matchWidth = true;
float marginWidth = childMargin.Start + childMargin.End;
float childWidth = childLayout.MeasuredWidth.Size.AsDecimal() + marginWidth;
maxWidth = Math.Max( maxWidth, childWidth );
- allFillParent = allFillParent && desiredWidth == (int)ChildLayoutData.MatchParent;
-
+ allFillParent = allFillParent && desiredChildWidth == LayoutParamPolicies.MatchParent;
+ float childHeight = childLayout.MeasuredHeight.Size.AsDecimal();
+ float childLength = childHeight + childMargin.Top + childMargin.Bottom;
+ float cellPadding = i < numberOfChildren - 1 ? CellPadding.Height : 0.0f;
+ _totalLength = _totalLength + childLength + cellPadding;
alternativeMaxWidth = Math.Max( alternativeMaxWidth, matchWidthLocally ? marginWidth : childWidth );
-
- childHeight = childLayout.MeasuredHeight.Size.AsDecimal();
- 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)
- {
- cellPadding = 0.0f;
- }
- _totalLength = Math.Max( _totalLength, _totalLength + length + cellPadding );
- } // foreach
+ } // for loop
// Add in our padding
- _totalLength += Padding.Top + Padding.Bottom;
+ _totalLength += padding.Top + padding.Bottom;
}
else
{
SetMeasuredDimensions( ResolveSizeAndState( new LayoutLength(maxWidth), widthMeasureSpec, childState.widthState ),
heightSizeAndState );
- if( matchWidth )
+ if (matchWidth)
{
- ForceUniformWidth( _children.Count, heightMeasureSpec );
+ ForceUniformWidth(heightMeasureSpec );
}
- } // MeasureVertically
+ } // MeasureVertical
- void LayoutHorizontal(LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
+ private void LayoutHorizontal(LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
{
bool isLayoutRtl = Owner.LayoutDirection == ViewLayoutDirectionType.RTL;
switch (LinearAlignment)
{
- case Alignment.Begin:
- default:
+ case Alignment.End:
// totalLength contains the padding already
- // In case of RTL map BEGIN alignment to the right edge
+ // In case of RTL map END alignment to the left edge
if (isLayoutRtl)
{
- childLeft = new LayoutLength(Padding.Start + right.AsDecimal() - left.AsDecimal() - _totalLength);
+ childLeft = new LayoutLength(Padding.Start);
}
else
{
- childLeft = new LayoutLength(Padding.Start);
+ childLeft = new LayoutLength(Padding.Start + right.AsDecimal() - left.AsDecimal() - _totalLength);
}
break;
- case Alignment.End:
+ case Alignment.CenterHorizontal: // FALL THROUGH
+ case Alignment.Center:
// totalLength contains the padding already
- // In case of RTL map END alignment to the left edge
+ childLeft = new LayoutLength(Padding.Start + (right.AsDecimal() - left.AsDecimal() - _totalLength) / 2.0f);
+ break;
+ case Alignment.Begin: // FALL THROUGH (default)
+ default:
+ // totalLength contains the padding already
+ // In case of RTL map BEGIN alignment to the right edge
if (isLayoutRtl)
{
- childLeft = new LayoutLength(Padding.Start);
+ childLeft = new LayoutLength(Padding.Start + right.AsDecimal() - left.AsDecimal() - _totalLength);
}
else
{
- childLeft = new LayoutLength(Padding.Start + right.AsDecimal() - left.AsDecimal() - _totalLength);
+ childLeft = new LayoutLength(Padding.Start);
}
break;
- case Alignment.CenterHorizontal:
- // totalLength contains the padding already
- childLeft = new LayoutLength(Padding.Start + (right.AsDecimal() - left.AsDecimal() - _totalLength) / 2.0f);
- break;
}
int start = 0;
switch ( LinearAlignment )
{
- case Alignment.Top:
- childTop = new LayoutLength(Padding.Top + childMargin.Top);
- break;
case Alignment.Bottom:
childTop = new LayoutLength(height - Padding.Bottom - childHeight - childMargin.Bottom);
break;
- case Alignment.CenterVertical: // FALLTHROUGH
- default:
+ case Alignment.CenterVertical:
+ case Alignment.Center: // FALLTHROUGH
childTop = new LayoutLength(Padding.Top + ( ( childSpace - childHeight ).AsDecimal() / 2.0f ) + childMargin.Top - childMargin.Bottom);
break;
+ case Alignment.Top: // FALLTHROUGH default
+ default:
+ childTop = new LayoutLength(Padding.Top + childMargin.Top);
+ break;
}
childLeft += childMargin.Start;
childLayout.Layout(childLeft, childTop, childLeft + childWidth, childTop + childHeight);
}
} // LayoutHorizontally
- void LayoutVertical(LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
+ private void LayoutVertical(LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
{
LayoutLength childTop = new LayoutLength(Padding.Top);
LayoutLength childLeft = new LayoutLength(Padding.Start);
switch (LinearAlignment)
{
- case Alignment.Top:
- // totalLength contains the padding already
- childTop = new LayoutLength( Padding.Top );
- break;
case Alignment.Bottom:
// totalLength contains the padding already
childTop = new LayoutLength( Padding.Top + bottom.AsDecimal() - top.AsDecimal() - _totalLength);
break;
- case Alignment.CenterVertical:
- default:
+ case Alignment.CenterVertical: // FALL THROUGH
+ case Alignment.Center:
// totalLength contains the padding already
childTop = new LayoutLength(Padding.Top + ( bottom.AsDecimal() - top.AsDecimal() - _totalLength ) / 2.0f);
break;
+ case Alignment.Top: // FALL THROUGH (default)
+ default:
+ // totalLength contains the padding already
+ childTop = new LayoutLength( Padding.Top );
+ break;
}
for( int i = 0; i < count; i++)
break;
}
case Alignment.CenterHorizontal:
+ case Alignment.Center: // FALL THROUGH
{
childLeft = new LayoutLength(Padding.Start + (( childSpace - childWidth ).AsDecimal() / 2.0f) + childMargin.Start - childMargin.End);
break;
}
} // LayoutVertical
- void ForceUniformHeight( int count, MeasureSpecification widthMeasureSpec )
+ private void ForceUniformHeight(MeasureSpecification widthMeasureSpec)
{
// Pretend that the linear layout has an exact size. This is the measured height of
// 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);
- for (int i = 0; i < count; ++i)
+ foreach (LayoutItem childLayout in _children)
{
- LayoutItem childLayout = _children[i];
- if (childLayout != null)
- {
- LayoutLength desiredWidth = new LayoutLength(childLayout.Owner.WidthSpecification);
- LayoutLength desiredHeight = new LayoutLength(Owner.WidthSpecification );
+ int desiredChildHeight = childLayout.Owner.HeightSpecification;
+ int desiredChildWidth = childLayout.Owner.WidthSpecification;
- if (desiredHeight.AsRoundedValue() == LayoutParamPolicies.MatchParent)
- {
- // Temporarily force children to reuse their old measured width
- LayoutLength oldWidth = desiredWidth;
+ if (desiredChildHeight == LayoutParamPolicies.MatchParent)
+ {
+ // Temporarily force children to reuse their original measured width
+ int originalWidth = desiredChildWidth;
childLayout.Owner.WidthSpecification = (int)childLayout.MeasuredWidth.Size.AsRoundedValue();
// Remeasure with new dimensions
MeasureChildWithMargins( childLayout, widthMeasureSpec, new LayoutLength(0),
uniformMeasureSpec, new LayoutLength(0) );
-
- childLayout.Owner.WidthSpecification = (int)oldWidth.AsRoundedValue();
+ // Restore width specification
+ childLayout.Owner.WidthSpecification = originalWidth;
}
- }
}
}
- void ForceUniformWidth( int count, MeasureSpecification heightMeasureSpec )
+ private void ForceUniformWidth(MeasureSpecification heightMeasureSpec)
{
// Pretend that the linear layout has an exact size.
MeasureSpecification uniformMeasureSpec = new MeasureSpecification( MeasuredWidth.Size, MeasureSpecification.ModeType.Exactly);
- for (int i = 0; i < count; ++i)
+ foreach (LayoutItem childLayout in _children)
{
- LayoutItem childLayout = _children[i];
- if (childLayout != null)
- {
- LayoutLength desiredWidth = new LayoutLength(childLayout.Owner.WidthSpecification);
- LayoutLength desiredHeight = new LayoutLength(Owner.WidthSpecification );
+ int desiredChildWidth = childLayout.Owner.WidthSpecification;
+ int desiredChildHeight = childLayout.Owner.WidthSpecification;
- if( desiredWidth.AsRoundedValue() == LayoutParamPolicies.MatchParent)
- {
- // Temporarily force children to reuse their old measured height
- LayoutLength oldHeight = desiredHeight;
- childLayout.Owner.HeightSpecification = (int)childLayout.MeasuredHeight.Size.AsRoundedValue();
-
- // Remeasure with new dimensions
- MeasureChildWithMargins( childLayout, uniformMeasureSpec, new LayoutLength(0),
- heightMeasureSpec, new LayoutLength(0));
-
- childLayout.Owner.HeightSpecification = (int)oldHeight.AsRoundedValue();
- }
+ if (desiredChildWidth == LayoutParamPolicies.MatchParent)
+ {
+ // Temporarily force children to reuse their original measured height
+ int originalHeight = desiredChildHeight;
+ childLayout.Owner.HeightSpecification = (int)childLayout.MeasuredHeight.Size.AsRoundedValue();
+
+ // Remeasure with new dimensions
+ MeasureChildWithMargins( childLayout, uniformMeasureSpec, new LayoutLength(0),
+ heightMeasureSpec, new LayoutLength(0));
+ // Restore height specification
+ childLayout.Owner.HeightSpecification = originalHeight;
}
}
}
}
/// <since_tizen> 3 </since_tizen>
- public static readonly int PAGE_SIZE = Interop.PageTurnView.PageTurnView_Property_PAGE_SIZE_get();
+ public static readonly int VIEW_PAGE_SIZE = Interop.PageTurnView.PageTurnView_Property_VIEW_PAGE_SIZE_get();
/// <since_tizen> 3 </since_tizen>
public static readonly int CURRENT_PAGE_ID = Interop.PageTurnView.PageTurnView_Property_CURRENT_PAGE_ID_get();
/// <since_tizen> 3 </since_tizen>
get
{
Vector2 temp = new Vector2(0.0f, 0.0f);
- GetProperty(PageTurnView.Property.PAGE_SIZE).Get(temp);
+ GetProperty(PageTurnView.Property.VIEW_PAGE_SIZE).Get(temp);
return temp;
}
set
{
- SetProperty(PageTurnView.Property.PAGE_SIZE, new Tizen.NUI.PropertyValue(value));
+ SetProperty(PageTurnView.Property.VIEW_PAGE_SIZE, new Tizen.NUI.PropertyValue(value));
}
}
public int CurrentPageId
}
/// <summary>
- /// Sets whether the frame count per render is managed using the hardware vsync or manually timed.
- /// </summary>
- /// <param name="useHardware">True if the hardware vsync should be used.</param>
- internal void SetUseHardwareVSync(bool useHardware)
- {
- Interop.Adaptor.Adaptor_SetUseHardwareVSync(swigCPtr, useHardware);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
- /// <summary>
/// Calls this method to notify DALi when a scene is created and initialized.
/// Notify the adaptor that the scene has been created.
/// </summary>
set
{
SetValue(TextProperty, value);
- NotifyPropertyChanged();
+ NotifyPropertyChangedAndRequestLayout();
}
}
set
{
SetValue(FontFamilyProperty, value);
- NotifyPropertyChanged();
+ NotifyPropertyChangedAndRequestLayout();
}
}
set
{
SetValue(FontStyleProperty, value);
- NotifyPropertyChanged();
+ NotifyPropertyChangedAndRequestLayout();
}
}
set
{
SetValue(PointSizeProperty, value);
- NotifyPropertyChanged();
+ NotifyPropertyChangedAndRequestLayout();
}
}
set
{
SetValue(MultiLineProperty, value);
- NotifyPropertyChanged();
+ NotifyPropertyChangedAndRequestLayout();
}
}
set
{
SetValue(LineSpacingProperty, value);
- NotifyPropertyChanged();
+ NotifyPropertyChangedAndRequestLayout();
}
}
set
{
SetValue(PixelSizeProperty, value);
- NotifyPropertyChanged();
+ NotifyPropertyChangedAndRequestLayout();
}
}
Text = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(e.Value.Replace("_", "-")));
}
+ private void NotifyPropertyChangedAndRequestLayout()
+ {
+ NotifyPropertyChanged();
+ Layout?.RequestLayout();
+ }
+
internal new class Property
{
internal static readonly int RENDERING_BACKEND = Interop.TextLabel.TextLabel_Property_RENDERING_BACKEND_get();
/// The required policy for this dimension, ChildLayoutData 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)]
public int WidthSpecification
{
if (_widthPolicy >= 0)
{
_measureSpecificationWidth = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
- Size2D.Width = _widthPolicy;
+ Tizen.NUI.Object.SetProperty(swigCPtr, View.Property.SIZE_WIDTH, new Tizen.NUI.PropertyValue(value));
}
_layout?.RequestLayout();
}
/// The required policy for this dimension, ChildLayoutData 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>
[EditorBrowsable(EditorBrowsableState.Never)]
public int HeightSpecification
{
if (_heightPolicy >= 0)
{
_measureSpecificationHeight = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
- Size2D.Height = _heightPolicy;
+ Tizen.NUI.Object.SetProperty(swigCPtr, View.Property.SIZE_HEIGHT, new Tizen.NUI.PropertyValue(value));
}
_layout?.RequestLayout();
}
}
/// <summary>
- /// Child property to specify desired width
- /// </summary>
- internal int LayoutWidthSpecificationFixed
- {
- get
- {
- return _widthPolicy;
- }
- set
- {
- _widthPolicy = value;
- _measureSpecificationWidth = new MeasureSpecification(new LayoutLength(value), MeasureSpecification.ModeType.Exactly);
- Size2D.Width = value;
- _layout?.RequestLayout();
- }
- }
-
- /// <summary>
- /// Child property to specify desired height
- /// </summary>
- internal int LayoutHeightSpecificationFixed
- {
- get
- {
- return _heightPolicy;
- }
- set
- {
- _heightPolicy = value;
- _measureSpecificationHeight = new MeasureSpecification(new LayoutLength(value), MeasureSpecification.ModeType.Exactly);
- Size2D.Height = value;
- _layout?.RequestLayout();
- }
- }
-
- /// <summary>
/// Child property to specify desired width, use MatchParent/WrapContent)
/// </summary>
internal ChildLayoutData LayoutWidthSpecification
set
{
_weight = value;
- _layout.RequestLayout();
+ _layout?.RequestLayout();
}
}
public override void Add(View child)
{
bool hasLayout = (_layout != null);
- Log.Info("NUI", "Add:" + child.Name + " to View:" + Name + "which has layout[" + hasLayout + "] + \n");
+ Log.Info("NUI", "Add:" + child.Name + " to View:" + Name + " which has layout[" + hasLayout + "] + \n");
if (null == child)
{
/// </summary>
/// <returns>The default Window.</returns>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
[EditorBrowsable(EditorBrowsableState.Never)]
public static Window GetDefaultWindow()
{
//Called by User
//Release your own managed resources here.
//You should release all of your own disposable objects here.
+
_rootLayer.Dispose();
localController.Dispose();