1 using Tizen.Applications;
3 using System.Collections.Generic;
5 using Tizen.NUI.BaseComponents;
6 using Tizen.NUI.UIComponents;
8 namespace TizenVDUIApplication19
12 internal class Program : NUIApplication
14 private Timer myTimer;
15 private List<View> myViewList;
16 private const int numberOfObjects = 500;
17 private Random myRandom;
18 private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res";
20 protected override void OnCreate()
24 Window.Instance.BackgroundColor = Color.White;
26 myViewList = new List<View>();
28 myRandom = new Random();
30 for (int i = 0; i < numberOfObjects; i++)
34 float intensity = myRandom.Next(0, 255) / 255.0f;
35 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
36 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
37 v.AnchorPoint = AnchorPoint.TopLeft;
38 v.Size = new Size(100, 100, 0);
42 Window.Instance.GetDefaultLayer().Add(v);
45 myTimer = new Timer(1000);
47 myTimer.Tick += MyTimer_Tick;
52 private bool MyTimer_Tick(object source, System.EventArgs e)
54 //Remove current Scene,
55 foreach (View v in myViewList)
57 Window.Instance.GetDefaultLayer().Remove(v);
65 GC.WaitForPendingFinalizers();
67 for (int i = 0; i < 50; i++)
69 TextLabel v = new TextLabel();
71 float intensity = myRandom.Next(0, 255) / 255.0f;
72 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
73 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
74 v.AnchorPoint = AnchorPoint.TopLeft;
75 v.Size = new Size(100, 100, 0);
76 v.Text = "label " + i;
80 Window.Instance.GetDefaultLayer().Add(v);
83 for (int i = 50; i < 100; i++)
85 PushButton v = new PushButton();
87 float intensity = myRandom.Next(0, 255) / 255.0f;
88 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
89 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
90 v.AnchorPoint = AnchorPoint.TopLeft;
91 v.Size = new Size(100, 100, 0);
92 v.LabelText = "button " + i;
96 Window.Instance.GetDefaultLayer().Add(v);
99 for (int i = 100; i < 150; i++)
101 ImageView v = new ImageView();
103 float intensity = myRandom.Next(0, 255) / 255.0f;
104 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
105 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
106 v.AnchorPoint = AnchorPoint.TopLeft;
107 v.Size = new Size(100, 100, 0);
108 v.ResourceUrl = resources + "/images/gallery-3.jpg";
112 Window.Instance.GetDefaultLayer().Add(v);
115 for (int i = 150; i < 200; i++)
117 TextEditor v = new TextEditor();
119 float intensity = myRandom.Next(0, 255) / 255.0f;
120 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
121 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
122 v.AnchorPoint = AnchorPoint.TopLeft;
123 v.Size = new Size(100, 100, 0);
124 v.Text = "editor" + i;
128 Window.Instance.GetDefaultLayer().Add(v);
131 for (int i = 200; i < 250; i++)
133 TextField v = new TextField();
135 float intensity = myRandom.Next(0, 255) / 255.0f;
136 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
137 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
138 v.AnchorPoint = AnchorPoint.TopLeft;
139 v.Size = new Size(100, 100, 0);
140 v.Text = "field " + i;
144 Window.Instance.GetDefaultLayer().Add(v);
147 for (int i = 250; i < 300; i++)
149 CheckBoxButton v = new CheckBoxButton();
151 float intensity = myRandom.Next(0, 255) / 255.0f;
152 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
153 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
154 v.AnchorPoint = AnchorPoint.TopLeft;
155 v.Size = new Size(100, 100, 0);
156 v.LabelText = "check " + i;
160 Window.Instance.GetDefaultLayer().Add(v);
163 for (int i = 300; i < 350; i++)
165 ScrollBar v = new ScrollBar();
167 float intensity = myRandom.Next(0, 255) / 255.0f;
168 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
169 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
170 v.AnchorPoint = AnchorPoint.TopLeft;
171 v.Size = new Size(100, 100, 0);
175 Window.Instance.GetDefaultLayer().Add(v);
178 for (int i = 350; i < 400; i++)
180 Slider v = new Slider();
182 float intensity = myRandom.Next(0, 255) / 255.0f;
183 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
184 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
185 v.AnchorPoint = AnchorPoint.TopLeft;
186 v.Size = new Size(100, 100, 0);
190 Window.Instance.GetDefaultLayer().Add(v);
193 for (int i = 400; i < 450; i++)
195 TableView v = new TableView(1, 1);
197 float intensity = myRandom.Next(0, 255) / 255.0f;
198 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
199 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
200 v.AnchorPoint = AnchorPoint.TopLeft;
201 v.Size = new Size(100, 100, 0);
205 Window.Instance.GetDefaultLayer().Add(v);
208 for (int i = 450; i < numberOfObjects; i++)
212 float intensity = myRandom.Next(0, 255) / 255.0f;
213 v.BackgroundColor = new Color(intensity, intensity, intensity, 1);
214 v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0);
215 v.AnchorPoint = AnchorPoint.TopLeft;
216 v.Size = new Size(100, 100, 0);
220 Window.Instance.GetDefaultLayer().Add(v);
226 protected override void OnPause()
228 //This function is called when the window's visibility is changed from visible to invisible.
232 protected override void OnResume()
234 //This function is called when the window's visibility is changed from invisible to visible.
238 protected override void OnTerminate()
240 //This function is called when the app exit normally.
244 protected override void OnLowMemory(LowMemoryEventArgs e)
246 //This function is called when the system is low on memory.
250 protected override void OnLocaleChanged(LocaleChangedEventArgs e)
252 //This function is called when the language is changed.
253 base.OnLocaleChanged(e);
256 private static void _Main(string[] args)
258 //Create an Application
259 Program myProgram = new Program();