* [NUI] Padding bug in LayoutGroup fixed (#1136)
LayoutGroup measuring child without using the parent's padding.
Resulted in LinearLayout not reducing the childs size when padding applied to parent
* [NUI] Prevent Height and Width specs being overwritten (#1142)
When setting the WidthSpecification or HeightSpecification with an exact value
the Size.Width or Size.Height is set but this in turns triggers a callback which
sets Size(width,height) but uses the stored height or width value which may not be
the set Width or Height Specification hence sets them to 0;
Change-Id: I80a4e1166f35e4c09c116916262ac965de54b048
* [NUI] Workaround: fix CustomAlgorithmInterface crash error occurred only in emulator, will be removed later after a proper solution is found (#1144)
- fix CSharp_Dali_GetOriginalImageSize spelling error- fix CSharp_Dali_GetOriginalImageSize spelling error
- add "GetOriginalImageSizeTest.cs" as sample APP.
* [NUI] Publish LottieAnimationView : TCSACR-293 (#1129)
* Revert "[NUI] Publish LottieAnimationView : TCSACR-293 (#1129)"
This reverts commit
3860d0bc8135ba980c3cc63da61ff670e281eb00.
private global::System.IntPtr SwigDirectorGetNextFocusableView(global::System.IntPtr current, global::System.IntPtr proposed, int direction)
{
- View currentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View;
- View proposedView = Registry.GetManagedBaseHandleFromNativePtr(proposed) as View;
+ if (current == global::System.IntPtr.Zero && proposed == global::System.IntPtr.Zero)
+ {
+ return global::System.IntPtr.Zero;
+ }
+
+ try
+ {
+ View currentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View;
+ View proposedView = Registry.GetManagedBaseHandleFromNativePtr(proposed) as View;
- return View.getCPtr(GetNextFocusableView(currentView, proposedView, (View.FocusDirection)direction)).Handle;
+ return View.getCPtr(GetNextFocusableView(currentView, proposedView, (View.FocusDirection)direction)).Handle;
+ }
+ catch (global::System.Exception ex)
+ {
+ Tizen.Log.Error("NUI","Registry Error: "+ ex);
+ }
+ return global::System.IntPtr.Zero;
}
internal delegate global::System.IntPtr SwigDelegateCustomAlgorithmInterface_0(global::System.IntPtr current, global::System.IntPtr proposed, int direction);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GetClosestImageSize__SWIG_4")]
public static extern global::System.IntPtr GetClosestImageSize__SWIG_4(string jarg1);
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GetOriginalImageSPize")]
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GetOriginalImageSize")]
public static extern global::System.IntPtr GetOriginalImageSize(string jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DownloadImageSynchronously__SWIG_0")]
if (_widthPolicy >= 0)
{
_measureSpecificationWidth = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
- Size2D.Width = _widthPolicy;
+ if(_heightPolicy>=0) // Policy an exact value
+ {
+ Size2D.Width = _widthPolicy;
+ }
+ else
+ {
+ // Store _heightPolicy in the Size2D memember as will be reset to 0 by a Size2D callback.
+ // Size2D height will store the specification value (negative number) this will then be applied to the
+ // HeightSpecification when the Size2D callback is invoked.
+ Size2D = new Size2D(_widthPolicy,_heightPolicy);
+ }
}
_layout?.RequestLayout();
}
if (_heightPolicy >= 0)
{
_measureSpecificationHeight = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
- Size2D.Height = _heightPolicy;
+
+ if(_widthPolicy>=0) // Policy an exact value
+ {
+ Size2D.Height = _heightPolicy;
+ }
+ else
+ {
+ // Store widthPolicy in the Size2D memember as will be reset to 0 by a Size2D callback.
+ // Size2D height will store the specification value (negative number) this will then be applied to the
+ // HeightSpecification when the Size2D callback is invoked.
+ Size2D = new Size2D(_widthPolicy,_heightPolicy);
+ }
}
_layout?.RequestLayout();
{
View childOwner = child.Owner;
- Extents padding = child.Padding; // Padding of this layout's owner, not of the child being measured.
+ Extents padding = Padding; // Padding of this layout's owner, not of the child being measured.
MeasureSpecification childWidthMeasureSpec = GetChildMeasureSpecification( parentWidthMeasureSpec,
new LayoutLength(padding.Start + padding.End ),
--- /dev/null
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using mypath = Tizen.Applications.Application.Current;
+
+namespace mytest
+{
+ public class myTestApp : NUIApplication
+ {
+ public myTestApp() : base()
+ {
+ }
+ public myTestApp(string styleSheet) : base(styleSheet)
+ {
+ }
+
+ Window win;
+ protected override void OnCreate()
+ {
+ base.OnCreate();
+ win = Window.Instance;
+ win.BackgroundColor = Color.Cyan;
+ View v1 = new View();
+ v1.Size2D = new Size2D(100, 100);
+ v1.BackgroundColor = Color.Blue;
+ win.GetDefaultLayer().Add(v1);
+
+ ImageView iv = new ImageView();
+ iv.ResourceUrl = mypath.DirectoryInfo.Resource + @"/images/Dali/DaliDemo/Logo-for-demo.png";
+ iv.Position2D = new Position2D(50, 200);
+ win.GetDefaultLayer().Add(iv);
+
+ Size2D imageSize = ImageLoading.GetOriginalImageSize(iv.ResourceUrl);
+ TextLabel tl = new TextLabel();
+ tl.Position2D = new Position2D(iv.Position2D.X, iv.Position2D.Y + imageSize.Height);
+ tl.MultiLine = true;
+ tl.Text = $"ResourceUrl: {iv.ResourceUrl} \nOriginalImageSize: W({imageSize.Width}), H({imageSize.Height})";
+ win.GetDefaultLayer().Add(tl);
+
+ //==================
+ iv = new ImageView();
+ iv.ResourceUrl = mypath.DirectoryInfo.Resource + @"/images/Dali/DaliDemo/demo-tile-texture.9.png";
+ iv.Position2D = new Position2D(50, 600);
+ win.GetDefaultLayer().Add(iv);
+
+ imageSize = ImageLoading.GetOriginalImageSize(iv.ResourceUrl);
+ tl = new TextLabel();
+ tl.Position2D = new Position2D(iv.Position2D.X, iv.Position2D.Y + imageSize.Height);
+ tl.MultiLine = true;
+ tl.Text = $"ResourceUrl: {iv.ResourceUrl} \nOriginalImageSize: W({imageSize.Width}), H({imageSize.Height})";
+ win.GetDefaultLayer().Add(tl);
+ }
+
+ //[STAThread]
+ //static void Main(string[] args)
+ //{
+ // new myTestApp().Run(args);
+ //}
+ }
+}