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.
19 using System.Diagnostics.CodeAnalysis;
20 using Tizen.NUI.BaseComponents;
22 namespace Tizen.NUI.Components
24 internal partial class DefaultThemeCreator : IThemeCreator
26 [SuppressMessage("Microsoft.Reliability", "CA2000: Dispose objects before losing scope", Justification = "The responsibility to dispose the object is transferred to the theme object.")]
29 var theme = new Theme()
31 Id = Tizen.NUI.DefaultThemeCreator.DefaultId,
32 Version = Tizen.NUI.DefaultThemeCreator.DefaultVersion
35 theme.AddStyleWithoutClone("Tizen.NUI.Components.Button", new ButtonStyle()
37 Size = new Size(339, 96),
38 CornerRadiusPolicy = VisualTransformPolicyType.Relative,
39 CornerRadius = 0.2916f,
40 ItemAlignment = LinearLayout.Alignment.Center,
41 BackgroundColor = new Selector<Color>()
43 Normal = new Color(0.039f, 0.055f, 0.29f, 1),
44 Pressed = new Color(0.106f, 0.412f, 0.792f, 1),
45 Focused = new Color(0, 0.2f, 0.545f, 1),
46 Disabled = new Color(0.765f, 0.792f, 0.824f, 1),
48 Text = new TextLabelStyle()
51 TextColor = Color.White,
55 theme.AddStyleWithoutClone("Tizen.NUI.Components.CheckBox", new ButtonStyle()
57 ItemSpacing = new Size2D(32, 32),
58 ItemAlignment = LinearLayout.Alignment.Begin,
59 Icon = new ImageViewStyle()
61 Size = new Size(36, 36),
62 ResourceUrl = new Selector<string>()
64 Normal = FrameworkInformation.ResourcePath + "IoT_check_off.svg",
65 Pressed = FrameworkInformation.ResourcePath + "IoT_check_off_p.svg",
66 Disabled = FrameworkInformation.ResourcePath + "IoT_check_off_d.svg",
67 Focused = FrameworkInformation.ResourcePath + "IoT_check_off_f.svg",
68 Selected = FrameworkInformation.ResourcePath + "IoT_check_on.svg",
69 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_check_on_p.svg",
70 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_check_on_f.svg",
71 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_check_on_d.svg",
74 Text = new TextLabelStyle()
77 TextColor = new Color("#001447")
81 theme.AddStyleWithoutClone("Tizen.NUI.Components.Popup", new PopupStyle()
83 Size = new Size(500, 280),
84 BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1),
85 ImageShadow = new ImageShadow()
87 Url = FrameworkInformation.ResourcePath + "nui_component_default_popup_shadow.png",
88 Border = new Rectangle(24, 24, 24, 24),
89 Extents = new Vector2(48, 48)
91 Title = new TextLabelStyle()
94 Padding = new Extents(20, 20, 20, 20),
96 Buttons = new ButtonStyle()
98 Size = new Size(0, 80),
99 BackgroundColor = new Selector<Color>()
101 Normal = new Color(1, 1, 1, 1),
102 Pressed = new Color(1, 1, 1, 0.5f),
104 Overlay = new ImageViewStyle()
106 BackgroundColor = new Selector<Color>()
108 Pressed = new Color(0, 0, 0, 0.1f),
109 Other = new Color(1, 1, 1, 0.1f),
112 Text = new TextLabelStyle()
114 TextColor = new Color(0.05f, 0.63f, 0.9f, 1),
119 theme.AddStyleWithoutClone("Tizen.NUI.Components.Progress", new ProgressStyle()
121 Size = new Size(200, 25),
122 Track = new ImageViewStyle()
124 ResourceUrl = FrameworkInformation.ResourcePath + "IoT_progressindicator_empty.png",
125 BackgroundColor = new Color(0, 0, 0, 0.1f),
127 Buffer = new ImageViewStyle()
129 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 0.3f),
131 Progress = new ImageViewStyle()
133 ResourceUrl = new Selector<string>()
135 Normal = FrameworkInformation.ResourcePath + "IoT_progressindicator_progress_dark.png",
136 Disabled = FrameworkInformation.ResourcePath + "IoT_progressindicator_progressdisabled.png",
138 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
140 IndeterminateImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_progress_indeterminate.png",
143 theme.AddStyleWithoutClone("Tizen.NUI.Components.RadioButton", new ButtonStyle()
145 ItemSpacing = new Size2D(32, 32),
146 ItemAlignment = LinearLayout.Alignment.Begin,
147 Icon = new ImageViewStyle()
149 Size = new Size(36, 36),
150 ResourceUrl = new Selector<string>()
152 Normal = FrameworkInformation.ResourcePath + "IoT_radiobutton_off.svg",
153 Pressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_p.svg",
154 Disabled = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_d.svg",
155 Focused = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_f.svg",
156 Selected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on.svg",
157 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_p.svg",
158 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_f.svg",
159 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_d.svg",
162 Text = new TextLabelStyle()
165 TextColor = new Color("#001447")
169 theme.AddStyleWithoutClone("Tizen.NUI.Components.Slider", new SliderStyle()
171 Size = new Size(200, 50),
173 Track = new ImageViewStyle()
175 Size = new Size(100, 8),
176 ResourceUrl = new Selector<string>()
178 Normal = FrameworkInformation.ResourcePath + "IoT_slider_status_empty_track.png",
179 Disabled = FrameworkInformation.ResourcePath + "IoT_slider_status_track_disabled.png",
181 BackgroundColor = new Color(1.0f, 1.0f, 1.0f, 0.1f),
183 Progress = new ImageViewStyle()
185 Size = new Size(100, 8),
186 ResourceUrl = FrameworkInformation.ResourcePath + "IoT_slider_status_trackW.png",
187 BackgroundColor = new Color(1.0f, 1.0f, 1.0f, 1),
189 Thumb = new ImageViewStyle()
191 Size = new Size(36, 36),
192 ResourceUrl = FrameworkInformation.ResourcePath + "IoT_slider_handler_normalW.png",
194 ValueIndicatorImage = new ImageViewStyle()
196 Size = new Size(49, 24),
197 BackgroundColor = new Color(1.0f, 1.0f, 1.0f, 1.0f),
201 theme.AddStyleWithoutClone("Tizen.NUI.Components.Switch", new SwitchStyle()
203 ItemSpacing = new Size2D(32, 32),
204 ItemAlignment = LinearLayout.Alignment.Begin,
205 Track = new ImageViewStyle()
207 Size = new Size(80, 40),
208 ResourceUrl = new Selector<string>()
210 Normal = FrameworkInformation.ResourcePath + "IoT_switch_track_off.svg",
211 Pressed = FrameworkInformation.ResourcePath + "IoT_switch_track_off_p.svg",
212 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_track_off_d.svg",
213 Focused = FrameworkInformation.ResourcePath + "IoT_switch_track_off_f.svg",
214 Selected = FrameworkInformation.ResourcePath + "IoT_switch_track_on.svg",
215 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_track_on_p.svg",
216 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_track_on_f.svg",
217 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_switch_track_on_d.svg",
220 Thumb = new ImageViewStyle()
222 Size = new Size(40, 40),
223 ResourceUrl = new Selector<string>()
225 Normal = FrameworkInformation.ResourcePath + "IoT_switch_thumb.svg",
226 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_thumb_d.svg",
227 Selected = FrameworkInformation.ResourcePath + "IoT_switch_thumb_s.svg",
228 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sp.svg",
229 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sf.svg",
232 Text = new TextLabelStyle()
235 TextColor = new Color("#001447")
239 theme.AddStyleWithoutClone("Tizen.NUI.Components.Loading", new LoadingStyle()
241 LoadingSize = new Size(100, 100),
244 theme.AddStyleWithoutClone("Tizen.NUI.Components.Pagination", new PaginationStyle()
246 IndicatorImageUrl = new Selector<string>()
248 Normal = FrameworkInformation.ResourcePath + "nui_component_default_pagination_normal_dot.png",
249 Selected = FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
251 IndicatorSize = new Size(10, 10),
254 theme.AddStyleWithoutClone("Tizen.NUI.Components.Scrollbar", new ScrollbarStyle()
258 TrackColor = new Color(0f, 0f, 0f, 0f),
259 ThumbColor = new Color("#0A0E4AFF"),
261 ThumbVerticalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_vbar.#.png",
262 ThumbHorizontalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_hbar.#.png",
265 theme.AddStyleWithoutClone("Tizen.NUI.Components.LinearLayouter", new ViewStyle()
267 Padding = new Extents(64, 64, 0, 0)
270 theme.AddStyleWithoutClone("Tizen.NUI.Components.GridLayouter", new ViewStyle()
272 Padding = new Extents(0, 0, 0, 0),
275 theme.AddStyleWithoutClone("Tizen.NUI.Components.ItemsLayouter", new ViewStyle()
277 Padding = new Extents(0, 0, 0, 0),
280 theme.AddStyleWithoutClone("Tizen.NUI.Components.RecyclerViewItem", new RecyclerViewItemStyle()
282 BackgroundColor = new Selector<Color>()
284 Normal = new Color(1, 1, 1, 1),
285 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
286 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
287 Selected = new Color(0.701f, 0.898f, 0.937f, 1),
291 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultLinearItem", new DefaultLinearItemStyle()
294 Padding = new Extents(64, 64, 18, 17),
295 Margin = new Extents(0, 0, 0, 0),
296 BackgroundColor = new Selector<Color>()
298 Normal = new Color(1, 1, 1, 1),
299 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
300 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
301 Selected = new Color(0.85f, 0.85f, 0.85f, 1),
303 Label = new TextLabelStyle()
307 FontFamily = "BreezeSans", //FXIME Font Weight is Light
308 TextColor = new Color("#001447FF"),
310 SubLabel = new TextLabelStyle()
314 FontFamily = "BreezeSans",
315 TextColor = new Color("#001447FF"),
317 Icon = new ViewStyle()
319 Margin = new Extents(0, 32, 0, 0)
321 Extra = new ViewStyle()
323 Margin = new Extents(32, 0, 0, 0)
325 Seperator = new ViewStyle()
328 Margin = new Extents(64, 64, 0, 0),
329 BackgroundColor = new Color("#C3CAD2FF"),
332 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultGridItem", new DefaultGridItemStyle()
334 Padding = new Extents(0, 0, 0, 0),
335 Margin = new Extents(5, 5, 5, 5),
336 Caption = new TextLabelStyle()
340 LineWrapMode = LineWrapMode.Character,
342 Badge = new ViewStyle()
344 Margin = new Extents(5, 5, 5, 5),
348 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultTitleItem", new DefaultTitleItemStyle()
351 Padding = new Extents(64, 64, 12, 12),
352 Margin = new Extents(0, 0, 0, 0),
353 BackgroundColor = new Selector<Color>()
355 Normal = new Color("#EEEEF1FF"),
357 Label = new TextLabelStyle()
361 TextColor = new Color("#001447FF"),
363 Icon = new ViewStyle()
365 Margin = new Extents(40, 0, 0, 0)
367 Seperator = new ViewStyle()
369 Margin = new Extents(0, 0, 0, 0),
370 BackgroundColor = new Color(0, 0, 0, 0),
374 theme.AddStyleWithoutClone("Tizen.NUI.Components.ContentPage", new ViewStyle()
376 BackgroundColor = new Color("#EEEFF1FF"),
379 theme.AddStyleWithoutClone("Tizen.NUI.Components.AppBar", new AppBarStyle()
381 Size = new Size(-1, 120),
382 BackgroundColor = new Color("#EEEFF1FF"),
383 BackButton = new ButtonStyle()
385 Size = new Size(48, 48),
387 BackgroundColor = new Color(0, 0, 0, 0),
388 Icon = new ImageViewStyle()
390 Size = new Size(48, 48),
391 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_back_button.png",
392 Color = new Selector<Color>()
394 Normal = new Color("#0A0E4AFF"),
395 Focused = new Color("#00338BFF"),
396 Pressed = new Color("#1B69CAFF"),
397 Disabled = new Color("#C3CAD2FF"),
401 TitleTextLabel = new TextLabelStyle()
404 VerticalAlignment = VerticalAlignment.Center,
405 TextColor = new Selector<Color>()
407 Normal = new Color("#000C2BFF"),
410 ActionView = new ViewStyle()
412 Size = new Size(-1, 48),
414 BackgroundColor = new Color(0, 0, 0, 0),
416 ActionButton = new ButtonStyle()
418 Size = new Size(-1, 48),
420 BackgroundColor = new Color(0, 0, 0, 0),
421 Text = new TextLabelStyle()
424 TextColor = new Selector<Color>()
426 Normal = new Color("#0A0E4AFF"),
427 Focused = new Color("#00338BFF"),
428 Pressed = new Color("#1B69CAFF"),
429 Disabled = new Color("#C3CAD2FF"),
432 Icon = new ImageViewStyle()
434 Size = new Size(-1, 48),
435 Color = new Selector<Color>()
437 Normal = new Color("#0A0E4AFF"),
438 Focused = new Color("#00338BFF"),
439 Pressed = new Color("#1B69CAFF"),
440 Disabled = new Color("#C3CAD2FF"),
444 Padding = new Extents(64, 64, 0, 0),
445 NavigationPadding = new Extents(0, 24, 0, 0),
446 ActionPadding = new Extents(40, 0, 0, 0),
447 ActionCellPadding = new Size2D(40, 0),
450 theme.AddStyleWithoutClone("Tizen.NUI.Components.Picker", new PickerStyle()
452 Size = new Size(160, 339),
453 ItemTextLabel = new TextLabelStyle()
455 //FIXME: Should be check PointSize. given size from UX is too large.
457 VerticalAlignment = VerticalAlignment.Center,
458 HorizontalAlignment = HorizontalAlignment.Center,
459 Size = new Size(0,72),
460 TextColor = new Selector<Color>()
462 Normal = new Color("#000C2BFF"),
464 BackgroundColor = Color.White,
466 Divider = new ViewStyle()
469 WidthResizePolicy = ResizePolicyType.FillToParent,
470 Position = new Position(0, 132),
471 BackgroundColor = new Color("#0A0E4AFF"),
473 StartScrollOffset = new Size(0, 12),
476 theme.AddStyleWithoutClone("Tizen.NUI.Components.TabButton", new TabButtonStyle()
478 Size = new Size(-1, 84),
480 BackgroundColor = Color.White,
481 Text = new TextLabelStyle()
484 Size = new Size(-2, -2),
485 TextColor = new Selector<Color>()
487 Normal = new Color("#000C2BFF"),
488 Selected = new Color("#000C2BFF"),
489 Pressed = new Color("#1473E6FF"),
490 Disabled = new Color("#C3CAD2FF"),
493 Icon = new ImageViewStyle()
495 Size = new Size(48, 48),
496 Color = new Selector<Color>()
498 Normal = new Color("#000C2BFF"),
499 Selected = new Color("#000C2BFF"),
500 Pressed = new Color("#1473E6FF"),
501 Disabled = new Color("#C3CAD2FF"),
504 TopLine = new ViewStyle()
506 Size = new Size(-1, 1),
507 BackgroundColor = new Selector<Color>()
509 Normal = new Color("#000C2BFF"),
510 Selected = new Color("#000C2BFF"),
511 Pressed = new Color("#1473E6FF"),
512 Disabled = new Color("#C3CAD2FF"),
515 BottomLine = new ViewStyle()
517 Size = new Size(-1, 8),
518 Position = new Position(0, 76), // 84 - 8
519 BackgroundColor = new Selector<Color>()
521 Normal = Color.Transparent,
522 Selected = new Color("#000C2BFF"),
523 Pressed = new Color("#1473E6FF"),
524 Disabled = Color.Transparent,
529 theme.AddStyleWithoutClone("NotificationToast", new TextLabelStyle()
531 BackgroundImage = FrameworkInformation.ResourcePath + "IoT_Toast_1.png",
532 BackgroundImageBorder = new Rectangle(28, 28, 28, 28),
533 TextColor = new Color("#000C2B"),
535 WidthResizePolicy = ResizePolicyType.UseNaturalSize,
536 HeightResizePolicy = ResizePolicyType.UseNaturalSize,
537 PositionUsesPivotPoint = true,
538 HorizontalAlignment = HorizontalAlignment.Center,
539 VerticalAlignment = VerticalAlignment.Center,
540 Padding = new Extents(40, 40, 24, 24),
544 theme.AddStyleWithoutClone("Tizen.NUI.Components.TimePicker", new TimePickerStyle()
546 CellPadding = new Size(50, 339),
548 Pickers = new PickerStyle()
550 Size = new Size(160, 339),
551 ItemTextLabel = new TextLabelStyle()
553 //FIXME: Should be check PointSize. given size from UX is too large.
555 VerticalAlignment = VerticalAlignment.Center,
556 HorizontalAlignment = HorizontalAlignment.Center,
557 Size = new Size(0,72),
558 TextColor = new Selector<Color>()
560 Normal = new Color("#000C2BFF"),
562 BackgroundColor = Color.White,
564 Divider = new ViewStyle()
567 WidthResizePolicy = ResizePolicyType.FillToParent,
568 Position = new Position(0, 132),
569 BackgroundColor = new Color("#0A0E4AFF"),
571 StartScrollOffset = new Size2D(0, 12),
575 theme.AddStyleWithoutClone("Tizen.NUI.Components.DatePicker", new DatePickerStyle()
577 CellPadding = new Size(50, 339),
579 Pickers = new PickerStyle()
581 Size = new Size(160, 339),
582 ItemTextLabel = new TextLabelStyle()
584 //FIXME: Should be check PointSize. given size from UX is too large.
586 VerticalAlignment = VerticalAlignment.Center,
587 HorizontalAlignment = HorizontalAlignment.Center,
588 Size = new Size(0,72),
589 TextColor = new Selector<Color>()
591 Normal = new Color("#000C2BFF"),
593 BackgroundColor = Color.White,
595 Divider = new ViewStyle()
598 WidthResizePolicy = ResizePolicyType.FillToParent,
599 Position = new Position(0, 132),
600 BackgroundColor = new Color("#0A0E4AFF"),
602 StartScrollOffset = new Size2D(0, 12),