[NUI][Non-ACR] Change Manual TCT UI (Scroll-View) 22/192022/2
authorhuiyu.eun <huiyu.eun@samsung.com>
Mon, 29 Oct 2018 03:15:38 +0000 (12:15 +0900)
committerhuiyu.eun <huiyu.eun@samsung.com>
Mon, 29 Oct 2018 04:06:17 +0000 (13:06 +0900)
Change-Id: Ia241b3c88874f74e106337cf49c22b89722d2290
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
tct-suite-vs/Tizen.NUI.Manual.Tests/ManualTestPage.cs

index 8fb4167a9bc35b865b0c0bb71a2b5d005063829a..fe0198e28a62150345ff8281d7beb79a8fcd8c34 100755 (executable)
@@ -55,6 +55,7 @@ namespace Tizen.NUI.Tests
 
         //Show the result of all the test case
         private TextLabel _summaryLabel;
+        ScrollView _scrollView;
         private View _initView;
         private View _detailView;
         private TableView _initList;
@@ -93,7 +94,7 @@ namespace Tizen.NUI.Tests
         }
         public void Initialize()
         {
-            Tizen.Log.Fatal("NUI", "Initialize=========================================");
+            Tizen.Log.Fatal("NUI", "NUI Initialize");
             PointSize = (1.0f / Window.Instance.Dpi.Length()) * 2000.0f;
             RunType.Value = RunType.MANUAL;
             _tRunner = new TRunner();
@@ -143,7 +144,6 @@ namespace Tizen.NUI.Tests
             _initView.Position = new Position(0.0f, 70.0f, 0.0f);
             InitializeFirstPage();
             _initView.Show();
-            Tizen.Log.Fatal("NUI", "TCT : InitDataInitDataInitDataInitDataInitDataInitDataInitDataInitDataInitDataInitData:");
 
             _detailView = new View();
             _initView.Size2D = new Size2D((int)Window.Instance.Size.Width, (int)Window.Instance.Size.Height - 65);
@@ -154,7 +154,6 @@ namespace Tizen.NUI.Tests
             _detailView.Hide();
 
             window.GetDefaultLayer().Add(_initView);
-            Tizen.Log.Fatal("NUI", "TCT : InitDataInitDataInitDataInitDataInitDataInitDataInitDataInitDataInitDataInitData:");
             window.GetDefaultLayer().Add(_detailView);
 
             FocusManager.Instance.SetCurrentFocusView(run);
@@ -190,22 +189,24 @@ namespace Tizen.NUI.Tests
             doneButton.LeftFocusableView = run;
 
             //To show all the test case information(Number _className._TCName  [result]).
-            _initList = new TableView(12, 2);
+            _initList = new TableView((uint)_tcIDList.Count, 1);
             _initList.Focusable = true;
-            _initList.CellPadding = new Vector2(30, 30);
-            _initList.Size2D = new Size2D(Window.Instance.Size.Width - 50, 800);
+            _initList.CellPadding = new Vector2(0, 0);
+            _initList.Size2D = new Size2D(Window.Instance.Size.Width - 50, _tcIDList.Count * 50);
             _initList.ParentOrigin = Position.ParentOriginTopLeft;
             _initList.PivotPoint = PivotPoint.TopLeft;
             _initList.Position = new Position(0.0f, 0.0f, 0.0f);
             CreateInitList();
+
             run.DownFocusableView = _initList;
+            doneButton.DownFocusableView = _initList;
             _initList.UpFocusableView = run;
 
             _firstPageContainer = new TableView(2, 2);
             _firstPageContainer.PivotPoint = Position.PivotPointTopLeft;
             _firstPageContainer.ParentOrigin = Position.ParentOriginTopLeft;
             _firstPageContainer.Position = new Position(0, 3, 0);
-            _firstPageContainer.Size2D = new Size2D((int)Window.Instance.Size.Width - 200, 400);
+            _firstPageContainer.Size2D = new Size2D((int)Window.Instance.Size.Width - 200, 200);
             _firstPageContainer.Focusable = (true);
             _firstPageContainer.SetCellAlignment(new TableView.CellPosition(0, 0), HorizontalAlignmentType.Right, VerticalAlignmentType.Center);
             _firstPageContainer.SetCellAlignment(new TableView.CellPosition(0, 1), HorizontalAlignmentType.Center, VerticalAlignmentType.Center);
@@ -214,7 +215,24 @@ namespace Tizen.NUI.Tests
 
             _firstPageContainer.AddChild(doneButton, new TableView.CellPosition(0, 0));
             _firstPageContainer.AddChild(run, new TableView.CellPosition(0, 1));
-            _firstPageContainer.AddChild(_initList, new TableView.CellPosition(1, 0, 1, 2));
+
+
+            _scrollView = new ScrollView();
+            _scrollView.ClippingMode = ClippingModeType.ClipChildren;
+            _scrollView.BackgroundColor = Color.Transparent;
+            _scrollView.Size2D = new Size2D(Window.Instance.Size.Width, Window.Instance.Size.Height);
+            _scrollView.Position2D = new Position2D(0, 0);
+            _scrollView.Scrolling = true;
+
+            PropertyMap rulerMap = new PropertyMap();
+            rulerMap.Add((int)ScrollModeType.XAxisScrollEnabled, new PropertyValue(false));
+            rulerMap.Add((int)ScrollModeType.YAxisScrollEnabled, new PropertyValue(true));
+            rulerMap.Add((int)ScrollModeType.YAxisSnapToInterval, new PropertyValue(100));
+            rulerMap.Add((int)ScrollModeType.YAxisScrollBoundary, new PropertyValue(60 * (_tcIDList.Count+1)));
+            _scrollView.ScrollMode = rulerMap;
+
+            _scrollView.Add(_initList);
+            _firstPageContainer.AddChild(_scrollView, new TableView.CellPosition(1, 0, 1, 2));
 
             _initView.Add(_firstPageContainer);
             Tizen.Log.Fatal("NUI", "TCT : InitializeFirstPage:");
@@ -225,7 +243,7 @@ namespace Tizen.NUI.Tests
         void UpdateDetailPage()
         {
             UpdateCurrentTCInfo();
-            Tizen.Log.Fatal("NUI", "UpdateDetailPage::::::::::::::::::::::");
+            Tizen.Log.Fatal("NUI", "UpdateDetailPage:");
             CreateTestCase();
         }
 
@@ -535,7 +553,7 @@ namespace Tizen.NUI.Tests
                 {
                     PushButton button = obj as PushButton;
 
-                    Tizen.Log.Fatal("TBT", "Item clicked!!!!!!!!!!!!!!::" + button.Name);
+                    Tizen.Log.Fatal("TBT", "Item clicked!!::" + button.Name);
                     CurrentTCNum = int.Parse(button.Name);
                     _initView.Hide();
                     UpdateDetailPage();
@@ -544,13 +562,22 @@ namespace Tizen.NUI.Tests
                     FocusManager.Instance.SetCurrentFocusView(runButton);
                     return false;
                 };
-                uint row = (uint)(index / 2);
-                uint column = (uint)(index % 2);
-                _initList.AddChild(buttonList[index], new TableView.CellPosition(row, column));
+                buttonList[index].FocusGained += ManualTestNUI_FocusGained;
+                _initList.AddChild(buttonList[index], new TableView.CellPosition((uint)index, 0));
 
             }
         }
 
+        private void ManualTestNUI_FocusGained(object sender, EventArgs e)
+        {
+            var item = sender as PushButton;
+            if (item != null)
+            {
+                uint idx = UInt32.Parse(item.Name);
+                _scrollView.ScrollTo(new Vector2(0, 30 * idx));
+            }
+        }
+
         private void CreateDetailList()
         {
             Tizen.Log.Fatal("NUI", "Print the CreateDetailList::");
@@ -633,7 +660,7 @@ namespace Tizen.NUI.Tests
             {
                 CurrentTCInfo.Add(TCInfoList[CurrentTCNum].Postconditions[index]);
             }
-            Tizen.Log.Fatal("NUI", "Ppppppppppppppppppppppprint the CurrentTCNum::" + CurrentTCNum);
+            Tizen.Log.Fatal("NUI", "The CurrentTCNum::" + CurrentTCNum);
         }
 
         private void OnSingleTestDone(object sender, SingleTestDoneEventArgs e)
@@ -667,10 +694,7 @@ namespace Tizen.NUI.Tests
                 ResultNumber.Block += 1;
             }
 
-            //_initList.RemoveChildAt(new TableView.CellPosition((uint)CurrentTCNum, 0));
-            uint row = (uint)(CurrentTCNum / 2);
-            uint column = (uint)(CurrentTCNum % 2);
-            _initList.RemoveChildAt(new TableView.CellPosition(row, column));
+            _initList.RemoveChildAt(new TableView.CellPosition((uint)CurrentTCNum, 0));
             string name = _tcIDList[CurrentTCNum];
             string testcaseName = "#." + (CurrentTCNum + 1).ToString() + name;
             string resultText = "[" + _listItem[(int)CurrentTCNum].Result + "]";
@@ -685,7 +709,7 @@ namespace Tizen.NUI.Tests
             button.Position = new Position(0.0f, 0.0f, 0.0f);
             button.Clicked += (obj, ee) =>
             {
-                Tizen.Log.Fatal("NUI", "Item clicked clicked!!!!!!!!!!!!!!::" + ((int)button.CellIndex.X).ToString());
+                Tizen.Log.Fatal("NUI", "Item clicked clicked!!::" + ((int)button.CellIndex.X).ToString());
                 CurrentTCNum = (int)button.CellIndex.X;
                 _initView.Hide();
                 UpdateDetailPage();
@@ -694,8 +718,7 @@ namespace Tizen.NUI.Tests
                 FocusManager.Instance.SetCurrentFocusView(runButton);
                 return false;
             };
-            //_initList.AddChild(button, new TableView.CellPosition((uint)CurrentTCNum, 0));
-            _initList.AddChild(button, new TableView.CellPosition(row, column));
+            _initList.AddChild(button, new TableView.CellPosition((uint)CurrentTCNum, 0));
             SetSummaryResult();
             notRun.Text = _listItem[CurrentTCNum].Result;
         }