2 * Copyright(c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using Tizen.NUI.BaseComponents;
19 using Tizen.NUI.Components;
21 namespace NUITizenGallery
23 public partial class PerformanceTest2Page : View
25 private int TestItems = 50;
26 private int ScrollTime = 5000;
28 public PerformanceTest2Page()
30 InitializeComponent();
32 //Application Linear Layout
33 LinearLayout layout = new LinearLayout();
34 layout.LinearOrientation = LinearLayout.Orientation.Vertical;
35 layout.LinearAlignment = LinearLayout.Alignment.Center;
36 layout.Padding = new Extents(5, 5, 5, 5);
37 layout.CellPadding = new Size2D(5, 5);
40 StartButton.Clicked += OnButtonScrollClicked;
42 //Create List for Labels
43 LabelsListView = new ScrollableBase();
44 LabelsListView.BackgroundColor = Color.White;
45 LabelsListView.Size2D = new Size2D(700, 1200);
47 //Set linead layout for scrollable widget
48 LinearLayout scrollLayout = new LinearLayout();
49 scrollLayout.LinearOrientation = LinearLayout.Orientation.Vertical;
50 scrollLayout.LinearAlignment = LinearLayout.Alignment.Center;
51 scrollLayout.CellPadding = new Size2D(5, 5);
52 LabelsListView.Layout = scrollLayout;
53 LabelsListView.ScrollDuration = ScrollTime;
54 this.Add(LabelsListView);
56 var items = new ListItemTitleSwitch[TestItems];
57 for (int i = 0; i < TestItems; i++) {
58 items[i] = new ListItemTitleSwitch("item: " + i.ToString());
59 LabelsListView.Add(items[i]);
63 private void OnButtonScrollClicked(object sender, ClickedEventArgs args)
65 LabelsListView.ScrollToIndex(49);