[4.0][NUISamples] Add some examples for nui 91/164591/2
authorxb.teng <xb.teng@samsung.com>
Wed, 20 Dec 2017 01:40:53 +0000 (09:40 +0800)
committerXianbing Teng <xb.teng@samsung.com>
Wed, 20 Dec 2017 01:38:06 +0000 (01:38 +0000)
Here are some changes:
1. Add geometry-test.cs, image-visual-test.cs, orientation-test.cs
2. Add resize-policy-test.cs, text-direction-test.cs, texture-set-sample.cs
3. Fix dali-test.cs, test1.cs, text-test.cs, visual-view-test2.cs
4. Add Tizen.NUI projects as reference to support new features

Change-Id: I06bce9cdae0b5c5ccf8a5ae2aca2e9dd06b9582c

13 files changed:
test/NUITestSample/NUITestSample.sln
test/NUITestSample/NUITestSample/NUITestSample.csproj
test/NUITestSample/NUITestSample/examples/dali-test.cs
test/NUITestSample/NUITestSample/examples/flex-container.cs
test/NUITestSample/NUITestSample/examples/geometry-test.cs [new file with mode: 0755]
test/NUITestSample/NUITestSample/examples/image-visual-test.cs [new file with mode: 0755]
test/NUITestSample/NUITestSample/examples/orientation-test.cs [new file with mode: 0755]
test/NUITestSample/NUITestSample/examples/resize-policy-test.cs [new file with mode: 0755]
test/NUITestSample/NUITestSample/examples/test1.cs
test/NUITestSample/NUITestSample/examples/text-direction-test.cs [new file with mode: 0755]
test/NUITestSample/NUITestSample/examples/text-test.cs
test/NUITestSample/NUITestSample/examples/texture-set-sample.cs [new file with mode: 0755]
test/NUITestSample/NUITestSample/examples/visual-view-test2.cs

index f89637e..fff6bc8 100755 (executable)
@@ -1,9 +1,19 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 15
-VisualStudioVersion = 15.0.27004.2006
+VisualStudioVersion = 15.0.26730.10
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NUITestSample", "NUITestSample\NUITestSample.csproj", "{848AFBC8-7318-4856-8FA5-51AFA4919838}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NUITestSample", "NUITestSample\NUITestSample.csproj", "{848AFBC8-7318-4856-8FA5-51AFA4919838}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI", "..\..\src\Tizen.NUI\Tizen.NUI.csproj", "{473C3BEC-2F67-4285-85FC-BF4E96BFFF1C}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "..\..\src\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj", "{8D71B1B6-9901-436F-8914-9F812E1B10A7}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\..\src\Tizen\Tizen.csproj", "{33B7EFD5-0050-416D-A2D1-8F18F26F106D}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\..\src\Tizen.Log\Tizen.Log.csproj", "{1C550C1F-9370-42FF-86FA-EDCD6262B258}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\..\src\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{2AEDCAA7-543F-48A1-BEA3-CF3E14F6EDC2}"
 EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -15,6 +25,26 @@ Global
                {848AFBC8-7318-4856-8FA5-51AFA4919838}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {848AFBC8-7318-4856-8FA5-51AFA4919838}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {848AFBC8-7318-4856-8FA5-51AFA4919838}.Release|Any CPU.Build.0 = Release|Any CPU
+               {473C3BEC-2F67-4285-85FC-BF4E96BFFF1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {473C3BEC-2F67-4285-85FC-BF4E96BFFF1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {473C3BEC-2F67-4285-85FC-BF4E96BFFF1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {473C3BEC-2F67-4285-85FC-BF4E96BFFF1C}.Release|Any CPU.Build.0 = Release|Any CPU
+               {8D71B1B6-9901-436F-8914-9F812E1B10A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {8D71B1B6-9901-436F-8914-9F812E1B10A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {8D71B1B6-9901-436F-8914-9F812E1B10A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {8D71B1B6-9901-436F-8914-9F812E1B10A7}.Release|Any CPU.Build.0 = Release|Any CPU
+               {33B7EFD5-0050-416D-A2D1-8F18F26F106D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {33B7EFD5-0050-416D-A2D1-8F18F26F106D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {33B7EFD5-0050-416D-A2D1-8F18F26F106D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {33B7EFD5-0050-416D-A2D1-8F18F26F106D}.Release|Any CPU.Build.0 = Release|Any CPU
+               {1C550C1F-9370-42FF-86FA-EDCD6262B258}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {1C550C1F-9370-42FF-86FA-EDCD6262B258}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {1C550C1F-9370-42FF-86FA-EDCD6262B258}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {1C550C1F-9370-42FF-86FA-EDCD6262B258}.Release|Any CPU.Build.0 = Release|Any CPU
+               {2AEDCAA7-543F-48A1-BEA3-CF3E14F6EDC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {2AEDCAA7-543F-48A1-BEA3-CF3E14F6EDC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {2AEDCAA7-543F-48A1-BEA3-CF3E14F6EDC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {2AEDCAA7-543F-48A1-BEA3-CF3E14F6EDC2}.Release|Any CPU.Build.0 = Release|Any CPU
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index df7cfc8..d231cd4 100755 (executable)
   </PropertyGroup>
 
   <ItemGroup>
-    <Folder Include="lib\"/>
-    <Folder Include="res\"/>
+    <Folder Include="lib\" />
+    <Folder Include="res\" />
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="Tizen.NET" Version="4.0.0" >
-      <ExcludeAssets>Runtime</ExcludeAssets>
-    </PackageReference>
     <PackageReference Include="Tizen.NET.Sdk" Version="1.0.0" />
   </ItemGroup>
 
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\src\Tizen.NUI\Tizen.NUI.csproj" />
+  </ItemGroup>
+
 </Project>
 
index 08aadd6..3ed69b5 100755 (executable)
@@ -563,7 +563,7 @@ namespace DaliTest
             Window.Instance.Add(button);
             button.Clicked += (sender, e) =>
             {
-                if (label.Visible)
+                if (label.Visibility)
                 {
                     label.Hide();
                 }
index f753255..b7fa313 100755 (executable)
@@ -36,7 +36,7 @@ namespace FlexContainerTest
             container = new FlexContainer();
             container.Size2D = new Size2D(Window.Instance.Size.Width, Window.Instance.Size.Height);
             container.PivotPoint = PivotPoint.TopLeft;
-            container.Padding = new Vector4(100, 100, 100, 100);
+            container.Padding = new Extents(100, 100, 100, 100);
 
             container.FlexWrap = FlexContainer.WrapType.Wrap;
             container.FlexDirection = FlexContainer.FlexDirectionType.Column;
@@ -157,7 +157,7 @@ namespace FlexContainerTest
                     break;
                 case View.FocusDirection.Down:
                     index = (index + 2) % numOfSamples; //changed
-                    Tizen.Log.Debug("NUI", "pushbutton1 Visible=" + pushButton1.Visible + "  pushbutton2 Visible=" + pushButton2.Visible); //added
+                    Tizen.Log.Debug("NUI", "pushbutton1 Visible=" + pushButton1.Visibility + "  pushbutton2 Visible=" + pushButton2.Visibility); //added
                     break;
                 case View.FocusDirection.Left:
                     //added
diff --git a/test/NUITestSample/NUITestSample/examples/geometry-test.cs b/test/NUITestSample/NUITestSample/examples/geometry-test.cs
new file mode 100755 (executable)
index 0000000..9367fc0
--- /dev/null
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2017 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.Runtime.InteropServices;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Constants;
+using System.Linq;
+
+namespace GeometryTest
+{
+    class Example : NUIApplication
+    {
+        public Example():base()
+        {
+        }
+
+        protected override void OnCreate()
+        {
+            base.OnCreate();
+            Initialize();
+        }
+
+               [StructLayout(LayoutKind.Sequential)]
+               public struct Vec2
+               {
+                       float x;
+                       float y;
+                       public Vec2(float xIn, float yIn)
+                       {
+                               x = xIn;
+                               y = yIn;
+                       }
+               }
+
+               public struct TexturedQuadVertex
+               {
+                       public Vec2 position;
+                       // public Vec2 textureCoordinates;
+               };
+
+               public static byte[] Struct2Bytes(TexturedQuadVertex[] obj)
+               {
+                       int size = Marshal.SizeOf(obj);
+                       byte[] bytes = new byte[size];
+                       IntPtr ptr = Marshal.AllocHGlobal(size);
+                       Marshal.StructureToPtr(obj, ptr, false);
+                       Marshal.Copy(ptr, bytes, 0, size);
+                       Marshal.FreeHGlobal(ptr);
+                       return bytes;
+               }
+               
+        private void Initialize()
+        {
+            // Connect the signal callback for window touched signal
+            Window window = Window.Instance;
+                       window.BackgroundColor = Color.White;
+
+                       /* Vertex shader */
+                       const string VERTEX_SHADER = "" +
+                               "attribute mediump vec2 aPosition;\n" +
+                               "uniform   mediump mat4 uMvpMatrix;\n" +
+                               "uniform   mediump vec3 uSize;\n" +
+                               "\n" +
+                               "void main()\n" +
+                               "{\n" +
+                                       "mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n" +
+                                       "vertexPosition.xyz *= uSize;\n"+
+                                       "gl_Position = uMvpMatrix * vertexPosition;\n" +
+                               "}\n";
+
+                       /* Fragment shader */
+                       const string FRAGMENT_SHADER = "" +
+                               "uniform mediump vec4 uColor;\n" +
+                               "\n" +
+                               "void main()\n" +
+                               "{\n" +
+                                       "gl_FragColor = uColor;\n" +
+                               "}\n";
+
+                       TexturedQuadVertex vertex1 = new TexturedQuadVertex();
+                       vertex1.position = new Vec2(-1.0f, -1.0f);
+                       TexturedQuadVertex vertex2 = new TexturedQuadVertex();
+                       vertex2.position = new Vec2(1.0f, 1.0f);
+
+                       TexturedQuadVertex[] texturedQuadVertexData;
+                       texturedQuadVertexData = new TexturedQuadVertex[2] { vertex1, vertex2 };
+
+                       int lenght = Marshal.SizeOf(vertex1);
+                       IntPtr pA = Marshal.AllocHGlobal(lenght * 2);
+
+                       for (int i = 0; i < 2; i++)
+                       {
+                               Marshal.StructureToPtr(texturedQuadVertexData[i], pA + i * lenght, true);
+                       }
+
+                       /* Create Shader */
+            Shader shader = new Shader(VERTEX_SHADER, FRAGMENT_SHADER);
+                       
+                       /* Create Property buffer */
+                       PropertyMap vertexFormat = new PropertyMap();
+                       vertexFormat.Add("aPosition", new PropertyValue((int)PropertyType.Vector2));
+
+                       PropertyBuffer vertexBuffer = new PropertyBuffer( vertexFormat );
+                       vertexBuffer.SetData(pA, 4);
+
+                       /* Create geometry */
+                       Geometry geometry = new Geometry();
+                       geometry.AddVertexBuffer(vertexBuffer);
+                       geometry.SetType(Geometry.Type.LINES);
+
+                       /* Create renderer */
+                       Renderer renderer = new Renderer(geometry, shader);
+
+                       /* Create view */
+                       View view = new View()
+                       {
+                               Size2D = new Size2D(300, 300),
+                               ParentOrigin = ParentOrigin.Center,
+                               PivotPoint = PivotPoint.Center,
+                               PositionUsesPivotPoint = true,
+                               BackgroundColor = Color.Black,
+                       };
+                       view.AddRenderer(renderer);
+
+            window.Add(view);
+        }
+
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
+        [STAThread]
+        static void _Main(string[] args)
+        {
+            Example example = new Example();
+            example.Run(args);
+        }
+    }
+}
diff --git a/test/NUITestSample/NUITestSample/examples/image-visual-test.cs b/test/NUITestSample/NUITestSample/examples/image-visual-test.cs
new file mode 100755 (executable)
index 0000000..3654004
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2017 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.Runtime.InteropServices;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Constants;
+
+namespace ImageVisualTest
+{
+    class Example : NUIApplication
+    {
+        private const string _resPath = "/home/owner/apps_rw/NUISamples/res";
+
+        private VisualView _contentView;
+        private ImageVisual _icon;
+
+        public Example() : base()
+        {
+        }
+
+        public Example(string stylesheet) : base(stylesheet)
+        {
+        }
+
+        public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode)
+        {
+        }
+
+        protected override void OnCreate()
+        {
+            base.OnCreate();
+            Initialize();
+        }
+
+        public void Initialize()
+        {
+            Window window = Window.Instance;
+            window.BackgroundColor = Color.White;
+
+            // make visual position animation
+            _contentView = new VisualView();
+            _contentView.ParentOrigin = ParentOrigin.Center;
+            _contentView.PivotPoint = PivotPoint.Center;
+            _contentView.Size2D = new Size2D(500, 500);
+            _contentView.BackgroundImage = _resPath + "/images/background-blocks.jpg";
+
+            _icon = new ImageVisual();
+            _icon.URL = _resPath + "/images/button-up.9.png";
+            _icon.AuxiliaryImageURL = _resPath + "application-icon-0.png";
+            _icon.AuxiliaryImageAlpha = 0.9f;
+            _icon.Size = new Size2D(450, 450);
+            _icon.SizePolicy = VisualTransformPolicyType.Absolute;
+            _icon.Position = new Position2D(25, 25);
+            _icon.PositionPolicy = VisualTransformPolicyType.Absolute;
+            _icon.Origin = Visual.AlignType.TopBegin;
+            _icon.AnchorPoint = Visual.AlignType.TopBegin;
+            //_icon.MixColor = new Color(0, 1, 0, 0.5f);
+            //_icon.Opacity = 0.5f;
+            _contentView.AddVisual("icon_visual", _icon);
+
+            window.Add(_contentView);
+        }
+
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
+        [STAThread]
+        static void _Main(string[] args)
+        {
+            Example example = new Example();
+            example.Run(args);
+        }
+    }
+}
diff --git a/test/NUITestSample/NUITestSample/examples/orientation-test.cs b/test/NUITestSample/NUITestSample/examples/orientation-test.cs
new file mode 100755 (executable)
index 0000000..2f10555
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2017 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.Runtime.InteropServices;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Constants;
+
+namespace OrientationTest
+{
+    class Example : NUIApplication
+    {
+        private const string resources = "/home/owner/apps_rw/NUISamples/res";
+
+        private ImageView _imageView;
+        private PushButton _pushButton1, _pushButton2;
+        private Window window;
+
+        public Example() : base()
+        {
+        }
+
+        public Example(string stylesheet) : base(stylesheet)
+        {
+        }
+
+        public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode)
+        {
+        }
+
+        protected override void OnCreate()
+        {
+            base.OnCreate();
+            Initialize();
+        }
+
+        public void Initialize()
+        {
+            window = Window.Instance;
+            window.BackgroundColor = Color.White;
+
+            _imageView = new ImageView()
+            {
+                ResourceUrl = resources + "/images/gallery-0.jpg",
+                ParentOrigin = ParentOrigin.Center,
+                PivotPoint = PivotPoint.Center, //CenterLeft/TopLeft/BottomLeft(left)
+                Size2D = new Size2D(400, 300),
+            };
+            window.Add(_imageView);
+
+            _pushButton1 = new PushButton()
+            {
+                ParentOrigin = ParentOrigin.TopLeft,
+                PivotPoint = PivotPoint.TopLeft,
+                LabelText = "left rotate",
+                Focusable = true,
+                Position = new Vector3(window.Size.Width * 0.1f, window.Size.Height * 0.1f, 0.0f),
+            };
+            _pushButton1.Clicked += OnPushButtonClicked1;
+            window.Add(_pushButton1);
+
+            _pushButton2 = new PushButton()
+            {
+                ParentOrigin = ParentOrigin.TopLeft,
+                PivotPoint = PivotPoint.TopLeft,
+                LabelText = "right rotate",
+                Focusable = true,
+                Position = new Vector3(window.Size.Width * 0.2f, window.Size.Height * 0.1f, 0.0f),
+            };
+            _pushButton2.Clicked += OnPushButtonClicked2;
+            window.Add(_pushButton2);
+
+            FocusManager.Instance.SetCurrentFocusView(_pushButton1);
+            _pushButton1.RightFocusableView = _pushButton2;
+            _pushButton2.LeftFocusableView = _pushButton1;
+        }
+
+        public bool OnPushButtonClicked2(object sender, EventArgs e)
+        {
+            _imageView.Orientation = new Rotation(new Radian(new Degree(360.0f)), new Vector3(0.0f, 1.0f, 0.0f));
+            return true;
+        }
+
+        public bool OnPushButtonClicked1(object sender, EventArgs e)
+        {
+            _imageView.Orientation = new Rotation(new Radian(new Degree(180.0f)), new Vector3(0.0f, 1.0f, 0.0f));
+            return true;
+        }
+    }
+}
diff --git a/test/NUITestSample/NUITestSample/examples/resize-policy-test.cs b/test/NUITestSample/NUITestSample/examples/resize-policy-test.cs
new file mode 100755 (executable)
index 0000000..95014af
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2017 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.Runtime.InteropServices;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Constants;
+
+namespace ResizePolicyTest
+{
+    class Example : NUIApplication
+    {
+        View parent;
+        View child;
+
+        public Example() : base()
+        {
+        }
+
+        public Example(string stylesheet) : base(stylesheet)
+        {
+        }
+
+        public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode)
+        {
+        }
+
+        protected override void OnCreate()
+        {
+            base.OnCreate();
+            Initialize();
+        }
+
+
+        public void Initialize()
+        {
+            Window window = Window.Instance;
+            window.BackgroundColor = Color.White;
+
+            parent = new View()
+            {
+                ParentOrigin = ParentOrigin.Center,
+                PivotPoint = PivotPoint.Center,
+                PositionUsesPivotPoint = true,
+                BackgroundColor = Color.Green,
+                Size2D = new Size2D(100, 100),
+            };
+
+            child = new View()
+            {
+                HeightResizePolicy = ResizePolicyType.FillToParent,
+                WidthResizePolicy = ResizePolicyType.FillToParent,
+                BackgroundColor = Color.Blue,
+            };
+            parent.Add(child);
+
+            Tizen.Log.Fatal("NUI", "After view create! ");
+            Tizen.Log.Fatal("NUI", "parent size width: " + parent.SizeWidth);
+            Tizen.Log.Fatal("NUI", "child  size width: " + child.SizeWidth);
+
+            PushButton button = new PushButton()
+            {
+                LabelText = "ChangeSize",
+                ParentOrigin = ParentOrigin.BottomCenter,
+                PivotPoint = PivotPoint.BottomCenter,
+                PositionUsesPivotPoint = true,
+                Focusable = true,
+            };
+
+            button.Clicked += (obj, arg) =>
+            {
+                Tizen.Log.Fatal("NUI", "Before view size change! ");
+                Tizen.Log.Fatal("NUI", "parent size width: " + parent.SizeWidth);
+                Tizen.Log.Fatal("NUI", "child  size width: " + child.SizeWidth);
+
+                parent.Size2D = new Size2D(200, 200);
+                Tizen.Log.Fatal("NUI", "After view size change! ");
+                Tizen.Log.Fatal("NUI", "parent size width: " + parent.SizeWidth);
+                Tizen.Log.Fatal("NUI", "child  size width: " + child.SizeWidth);
+                return true;
+            };
+
+            window.Add(parent);
+            window.Add(button);
+            FocusManager.Instance.SetCurrentFocusView(button);
+        }
+
+        [STAThread]
+        static void _Main(string[] args)
+        {
+            Example example = new Example();
+            example.Run(args);
+        }
+    }
+}
index 583784d..3360ffb 100755 (executable)
@@ -203,9 +203,9 @@ namespace Test1
                 textMap1.Insert(TextVisualProperty.Text, new PropertyValue("Hello"));
                 textMap1.Insert(TextVisualProperty.PointSize, new PropertyValue(10.0f));
 
-                PropertyMap textMap2 = new PropertyMap();
-                VisualBase textVisual1 = visualfactory.CreateVisual(textMap1);
-                textVisual1.Creation = textMap2;
+                //PropertyMap textMap2 = new PropertyMap();
+                //VisualBase textVisual1 = visualfactory.CreateVisual(textMap1);
+                //textVisual1.Creation = textMap2;
             }
             catch (Exception e)
             {
diff --git a/test/NUITestSample/NUITestSample/examples/text-direction-test.cs b/test/NUITestSample/NUITestSample/examples/text-direction-test.cs
new file mode 100755 (executable)
index 0000000..b51a922
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2017 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.Runtime.InteropServices;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Constants;
+
+namespace TextDirectionTest
+{
+    class Example : NUIApplication
+    {
+        TextLabel label1;
+        TextLabel label2;
+
+        public Example() : base()
+        {
+        }
+
+        public Example(string stylesheet) : base(stylesheet)
+        {
+        }
+
+        public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode)
+        {
+        }
+
+        protected override void OnCreate()
+        {
+            base.OnCreate();
+            Initialize();
+        }
+
+
+        public void Initialize()
+        {
+            Window window = Window.Instance;
+            window.BackgroundColor = Color.Cyan;
+
+            label1 = new TextLabel()
+            {
+                Text = "Hello world",
+                PixelSize = 32.0f,
+                Size2D = new Size2D(500, 100),
+                ParentOrigin = ParentOrigin.TopLeft,
+                PivotPoint = PivotPoint.TopLeft,
+                PositionUsesPivotPoint = true,
+                BackgroundColor = Color.Green,
+                HorizontalAlignment = HorizontalAlignment.End,
+            };
+            //if (label1.TextDirection == TextDirection.LeftToRight)
+            //{
+            //    label1.HorizontalAlignment = HorizontalAlignment.Begin;
+            //}
+
+            label2 = new TextLabel()
+            {
+                Text = "لوحة المفاتيح العربية",
+                PixelSize = 32.0f,
+                ParentOrigin = ParentOrigin.TopLeft,
+                PivotPoint = PivotPoint.TopLeft,
+                PositionUsesPivotPoint = true,
+                Size2D = new Size2D(500, 100),
+                Position2D = new Position2D(0, 200),
+                BackgroundColor = Color.Green,
+            };
+
+            //Tizen.Log.Fatal("NUI", "Text label1 direction: " + label1.TextDirection);
+
+            PushButton button = new PushButton()
+            {
+                LabelText = "Click",
+                ParentOrigin = ParentOrigin.TopLeft,
+                PivotPoint = PivotPoint.TopLeft,
+                PositionUsesPivotPoint = true,
+                Position2D = new Position2D(0, 500),
+                Focusable = true,
+            };
+            //Tizen.Log.Fatal("NUI", "Text label2 direction: " + label2.TextDirection);
+
+            button.Clicked += (obj, arg) =>
+            {
+                Tizen.Log.Fatal("NUI", "Text label1 direction: " + label1.TextDirection);
+                Tizen.Log.Fatal("NUI", "Text label2 direction: " + label2.TextDirection);
+                return true;
+            };
+
+            window.Add(label1);
+            window.Add(label2);
+            window.Add(button);
+            FocusManager.Instance.SetCurrentFocusView(button);
+            //Tizen.Log.Fatal("NUI", "Text label1 direction: " + label1.TextDirection);
+            //Tizen.Log.Fatal("NUI", "Text label2 direction: " + label2.TextDirection);
+        }
+
+        [STAThread]
+        static void _Main(string[] args)
+        {
+            Example example = new Example();
+            example.Run(args);
+        }
+    }
+}
index 40fcb22..cbf6e45 100755 (executable)
@@ -167,7 +167,7 @@ namespace TextTest
             editor.UpFocusableView = field;
             field.DownFocusableView = editor;
 
-            NUILog.Debug($"### field.EnableShiftSelection={field.EnableShiftSelection}, editor.EnableShiftSelection={editor.EnableShiftSelection}");
+            Tizen.Log.Debug("NUI", $"### field.EnableShiftSelection={field.EnableShiftSelection}, editor.EnableShiftSelection={editor.EnableShiftSelection}");
 
         }
 
diff --git a/test/NUITestSample/NUITestSample/examples/texture-set-sample.cs b/test/NUITestSample/NUITestSample/examples/texture-set-sample.cs
new file mode 100755 (executable)
index 0000000..63ebd4f
--- /dev/null
@@ -0,0 +1,166 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+
+namespace TextureSetSample
+{
+    class Example: NUIApplication
+    {
+               [StructLayout(LayoutKind.Sequential)]
+        public struct Vec2
+        {
+            float x;
+            float y;
+            public Vec2(float xIn, float yIn)
+            {
+                x = xIn;
+                y = yIn;
+            }
+        }
+
+        public struct Vertex
+        {
+            public Vec2 position;
+            public Vec2 texCoord;
+            public Vertex(Vec2 p, Vec2 t)
+            {
+                position = p;
+                texCoord = t;
+            }
+        };
+
+        private List<string> Image_Path = new List<string>();
+        private string ResourcePath = "/home/owner/apps_rw/NUISamples/res/";
+
+
+        public Example() : base()
+        {
+            Tizen.Log.Fatal("NUISamples", "TextureSetSample constructor");
+        }
+
+        protected override void OnCreate()
+        {
+            Tizen.Log.Fatal("NUISamples", "TextureSetSample OnCreate");
+            base.OnCreate();
+            Initialize();
+        }
+               public static byte[] Struct2Bytes(Vertex[] obj)
+               {
+                       int size = Marshal.SizeOf(obj);
+                       byte[] bytes = new byte[size];
+                       IntPtr ptr = Marshal.AllocHGlobal(size);
+                       Marshal.StructureToPtr(obj, ptr, false);
+                       Marshal.Copy(ptr, bytes, 0, size);
+                       Marshal.FreeHGlobal(ptr);
+                       return bytes;
+               }
+
+        public void Initialize()
+        {
+            const string VERTEX_SHADER = "" +
+                "attribute mediump vec2 aPosition;\n" +
+                "attribute   highp vec2 aTexCoord;\n" +
+                "varying   mediump vec2 vTexCoord;\n" +
+                "uniform   mediump mat4 uMvpMatrix;\n" +
+                "uniform   mediump vec3 uSize;\n" +
+                "uniform   lowp    vec4 uFadeColor;\n" +
+                "\n" +
+                "void main()\n" +
+                "{\n" +
+                    "mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n" +
+                    "vertexPosition.xyz *= uSize;\n" +
+                    "vertexPosition = uMvpMatrix * vertexPosition;\n" +
+                    "vTexCoord = aTexCoord;\n" +
+                    "gl_Position = vertexPosition;\n" +
+                "}\n";
+
+            const string FRAGMENT_SHADER =
+                "varying mediump vec2 vTexCoord;\n" +
+                "uniform    lowp vec4 uColor;\n" +
+                "uniform    sampler2D sTexture;\n" +
+                "uniform    lowp vec4 uFadeColor;\n" +
+                "\n" +
+                "void main()\n" +
+                "{\n" +
+                    "gl_FragColor = texture2D(sTexture, vTexCoord) * uColor * uFadeColor;\n" +
+                "}\n";
+
+            Tizen.Log.Fatal("NUISamples", "TextureSetSample Initialize");
+            Image_Path.Add(ResourcePath + "/images/gallery-0.jpg");
+            Image_Path.Add(ResourcePath + "/images/gallery-1.jpg");
+            Image_Path.Add(ResourcePath + "/images/gallery-2.jpg");
+            Image_Path.Add(ResourcePath + "/images/gallery-3.jpg");
+            Image_Path.Add(ResourcePath + "/images/gallery-4.jpg");
+            Image_Path.Add(ResourcePath + "/images/gallery-5.jpg");
+
+            Vertex vertex1 = new Vertex(new Vec2(-0.5f, -0.5f), new Vec2(0.0f, 0.0f));
+            Vertex vertex2 = new Vertex(new Vec2(0.5f, -0.5f), new Vec2(1.0f, 0.0f));
+            Vertex vertex3 = new Vertex(new Vec2(-0.5f, 0.5f), new Vec2(0.0f, 1.0f));
+            Vertex vertex4 = new Vertex(new Vec2(0.5f, 0.5f), new Vec2(1.0f, 1.0f));
+
+            Vertex[] texturedQuadData = new Vertex[4] { vertex1, vertex2, vertex3, vertex4 };
+
+            int length = Marshal.SizeOf(vertex1);
+            IntPtr pA = Marshal.AllocHGlobal(length * 4);
+            for (int i = 0; i < 4; i++)
+            {
+                Marshal.StructureToPtr(texturedQuadData[i], pA + i * length, true);
+            }
+
+            PropertyMap vertexFormat = new PropertyMap();
+            vertexFormat.Add("aPosition", new PropertyValue((int)PropertyType.Vector2));
+            vertexFormat.Add("aTexCoord", new PropertyValue((int)PropertyType.Vector2));
+
+            PropertyBuffer vertexBuffer = new PropertyBuffer(vertexFormat);
+            vertexBuffer.SetData(pA, 4u);
+
+            /* Create geometry */
+            Geometry geometry = new Geometry();
+            geometry.AddVertexBuffer(vertexBuffer);
+            geometry.SetType(Geometry.Type.TRIANGLE_STRIP);
+
+            Shader shader = new Shader(VERTEX_SHADER, FRAGMENT_SHADER);
+
+            Renderer renderer =  CreateRenderer(0, geometry, shader);
+
+            //Create the actor
+            Window window = Window.Instance;
+            window.BackgroundColor = Color.White;
+
+            View view = new View()
+            {
+                Size2D = new Size2D(800, 800),
+                ParentOrigin = ParentOrigin.Center,
+                PivotPoint = PivotPoint.Center,
+                PositionUsesPivotPoint = true,
+                BackgroundColor = Color.Black,
+            };
+            view.AddRenderer(renderer);
+            window.Add(view);
+        }
+
+        private Renderer CreateRenderer(int index, Geometry geometry, Shader shader)
+        {
+            Renderer renderer = new Renderer(geometry, shader);
+            string imagePath = Image_Path[index];
+            Size2D size = new Size2D(500, 500);
+
+            PixelBuffer pb =  ImageLoading.LoadImageFromFile(imagePath, size, FittingModeType.ShrinkToFit, SamplingModeType.Box);
+
+            Tizen.Log.Fatal("NUISamples", "width: "+ pb.GetWidth() + ", height: " + pb.GetHeight());
+            Texture texture = new Texture(TextureType.TEXTURE_2D, pb.GetPixelFormat(), pb.GetWidth(), pb.GetHeight());
+            PixelData pd = PixelBuffer.Convert(pb);
+            texture.Upload(pd);
+
+            TextureSet textureSet = new TextureSet();
+            textureSet.SetTexture(0u, texture);
+            renderer.SetTextures(textureSet);
+            renderer.DepthIndex = 0;
+            renderer.BlendMode = 0;
+            //renderer.SetProperty(Renderer.Property.BLEND_MODE, new Tizen.NUI.PropertyValue(false));
+            return renderer;
+        }
+    }
+}
index 659e9ba..c31c19a 100755 (executable)
@@ -127,7 +127,7 @@ namespace VisualViewTest2
             guide = new TextLabel();
             guide.PivotPoint = PivotPoint.TopLeft;
             guide.Size2D = new Size2D(800, 200);
-            guide.Padding = new Vector4(50, 50, 50, 50);
+            guide.Padding = new Extents(50, 50, 50, 50);
             guide.MultiLine = true;
             guide.BackgroundColor = Color.Magenta;
             guide.PointSize = 10;