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 // It is a C# version of res/Tizen.NUI.Components_Tizen.NUI.Theme.Common.xaml
25 internal partial class DefaultThemeCreator : IThemeCreator
27 [SuppressMessage("Microsoft.Reliability", "CA2000: Dispose objects before losing scope", Justification = "The responsibility to dispose the object is transferred to the theme object.")]
30 var theme = new Theme()
32 Id = Tizen.NUI.DefaultThemeCreator.DefaultId,
33 Version = Tizen.NUI.DefaultThemeCreator.DefaultVersion
36 theme.AddStyleWithoutClone("Tizen.NUI.Components.Button", new ButtonStyle()
38 Size = new Size(339, 96),
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.CenterVertical,
59 Icon = new ImageViewStyle()
61 Size = new Size(36, 36),
62 ResourceUrl = new Selector<string>()
64 Normal = FrameworkInformation.ResourcePath + "IoT_check_off.png",
65 Pressed = FrameworkInformation.ResourcePath + "IoT_check_off_p.png",
66 Disabled = FrameworkInformation.ResourcePath + "IoT_check_off_d.png",
67 Focused = FrameworkInformation.ResourcePath + "IoT_check_off_f.png",
68 Selected = FrameworkInformation.ResourcePath + "IoT_check_on.png",
69 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_check_on_p.png",
70 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_check_on_f.png",
71 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_check_on_d.png",
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.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.CenterVertical,
147 Icon = new ImageViewStyle()
149 Size = new Size(36, 36),
150 ResourceUrl = new Selector<string>()
152 Normal = FrameworkInformation.ResourcePath + "IoT_radiobutton_off.png",
153 Pressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_p.png",
154 Disabled = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_d.png",
155 Focused = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_f.png",
156 Selected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on.png",
157 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_p.png",
158 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_f.png",
159 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_d.png",
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_track.png",
187 BackgroundColor = new Color(0.03f, 0.05f, 0.3f, 1),
189 Thumb = new ImageViewStyle()
191 Size = new Size(36, 36),
192 ResourceUrl = FrameworkInformation.ResourcePath + "IoT_slider_handler_normal.png",
193 // TODO : Should check later when UX guide provides the pressed image
194 /*BackgroundImage = new Selector<string>()
196 Normal = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
197 Pressed = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
200 ValueIndicatorImage = new ImageViewStyle()
202 Size = new Size(49, 24),
203 BackgroundColor = new Color(0.0f, 0.04f, 0.16f, 1.0f),
207 theme.AddStyleWithoutClone("Tizen.NUI.Components.Switch", new SwitchStyle()
209 ItemSpacing = new Size2D(32, 32),
210 ItemAlignment = LinearLayout.Alignment.CenterVertical,
211 Track = new ImageViewStyle()
213 Size = new Size(80, 40),
214 ResourceUrl = new Selector<string>()
216 Normal = FrameworkInformation.ResourcePath + "IoT_switch_track_off.png",
217 Pressed = FrameworkInformation.ResourcePath + "IoT_switch_track_off_p.png",
218 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_track_off_d.png",
219 Focused = FrameworkInformation.ResourcePath + "IoT_switch_track_off_f.png",
220 Selected = FrameworkInformation.ResourcePath + "IoT_switch_track_on.png",
221 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_track_on_p.png",
222 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_track_on_f.png",
223 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_switch_track_on_d.png",
226 Thumb = new ImageViewStyle()
228 Size = new Size(40, 40),
229 ResourceUrl = new Selector<string>()
231 Normal = FrameworkInformation.ResourcePath + "IoT_switch_thumb.png",
232 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_thumb_d.png",
233 Selected = FrameworkInformation.ResourcePath + "IoT_switch_thumb_s.png",
234 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sp.png",
235 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sf.png",
238 Text = new TextLabelStyle()
241 TextColor = new Color("#001447")
245 theme.AddStyleWithoutClone("Tizen.NUI.Components.Loading", new LoadingStyle()
247 LoadingSize = new Size(100, 100),
250 theme.AddStyleWithoutClone("Tizen.NUI.Components.Pagination", new PaginationStyle()
252 IndicatorImageUrl = new Selector<string>()
254 Normal = FrameworkInformation.ResourcePath + "nui_component_default_pagination_normal_dot.png",
255 Selected = FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
257 IndicatorSize = new Size(10, 10),
260 theme.AddStyleWithoutClone("Tizen.NUI.Components.Scrollbar", new ScrollbarStyle()
264 TrackColor = new Color(0f, 0f, 0f, 0f),
265 ThumbColor = new Color("#0A0E4AFF"),
267 ThumbVerticalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_vbar.#.png",
268 ThumbHorizontalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_hbar.#.png",
271 theme.AddStyleWithoutClone("Tizen.NUI.Components.LinearLayouter", new ViewStyle()
273 Padding = new Extents(64, 64, 0, 0)
276 theme.AddStyleWithoutClone("Tizen.NUI.Components.GridLayouter", new ViewStyle()
278 Padding = new Extents(0, 0, 0, 0),
281 theme.AddStyleWithoutClone("Tizen.NUI.Components.ItemsLayouter", new ViewStyle()
283 Padding = new Extents(0, 0, 0, 0),
286 theme.AddStyleWithoutClone("Tizen.NUI.Components.RecyclerViewItem", new RecyclerViewItemStyle()
288 BackgroundColor = new Selector<Color>()
290 Normal = new Color(1, 1, 1, 1),
291 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
292 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
293 Selected = new Color(0.701f, 0.898f, 0.937f, 1),
297 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultLinearItem", new DefaultLinearItemStyle()
300 Padding = new Extents(64, 64, 18, 17),
301 Margin = new Extents(0, 0, 0, 0),
302 BackgroundColor = new Selector<Color>()
304 Normal = new Color(1, 1, 1, 1),
305 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
306 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
307 Selected = new Color(0.85f, 0.85f, 0.85f, 1),
309 Label = new TextLabelStyle()
313 FontFamily = "BreezeSans", //FXIME Font Weight is Light
314 TextColor = new Color("#001447FF"),
316 SubLabel = new TextLabelStyle()
320 FontFamily = "BreezeSans",
321 TextColor = new Color("#001447FF"),
323 Icon = new ViewStyle()
325 Margin = new Extents(0, 32, 0, 0)
327 Extra = new ViewStyle()
329 Margin = new Extents(32, 0, 0, 0)
331 Seperator = new ViewStyle()
334 Margin = new Extents(64, 64, 0, 0),
335 BackgroundColor = new Color("#C3CAD2FF"),
338 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultGridItem", new DefaultGridItemStyle()
340 Padding = new Extents(0, 0, 0, 0),
341 Margin = new Extents(5, 5, 5, 5),
342 Label = new TextLabelStyle()
346 LineWrapMode = LineWrapMode.Character,
348 Badge = new ViewStyle()
350 Margin = new Extents(5, 5, 5, 5),
354 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultTitleItem", new DefaultTitleItemStyle()
357 Padding = new Extents(64, 64, 12, 12),
358 Margin = new Extents(0, 0, 0, 0),
359 BackgroundColor = new Selector<Color>()
361 Normal = new Color("#EEEEF1FF"),
363 Label = new TextLabelStyle()
367 TextColor = new Color("#001447FF"),
369 Icon = new ViewStyle()
371 Margin = new Extents(40, 0, 0, 0)
373 Seperator = new ViewStyle()
375 Margin = new Extents(0, 0, 0, 0),
376 BackgroundColor = new Color(0, 0, 0, 0),
380 theme.AddStyleWithoutClone("Tizen.NUI.Components.ContentPage", new ViewStyle()
382 BackgroundColor = new Color("#EEEFF1FF"),
385 theme.AddStyleWithoutClone("Tizen.NUI.Components.AppBar", new AppBarStyle()
387 Size = new Size(-1, 120),
388 BackgroundColor = new Color("#EEEFF1FF"),
389 BackButton = new ButtonStyle()
391 Size = new Size(48, 48),
393 BackgroundColor = new Color(0, 0, 0, 0),
394 Icon = new ImageViewStyle()
396 Size = new Size(48, 48),
397 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_back_button.png",
398 Color = new Selector<Color>()
400 Normal = new Color("#0A0E4AFF"),
401 Focused = new Color("#00338BFF"),
402 Pressed = new Color("#1B69CAFF"),
403 Disabled = new Color("#C3CAD2FF"),
407 TitleTextLabel = new TextLabelStyle()
410 VerticalAlignment = VerticalAlignment.Center,
411 TextColor = new Selector<Color>()
413 Normal = new Color("#000C2BFF"),
416 ActionView = new ViewStyle()
418 Size = new Size(-1, 120),
420 BackgroundColor = new Color(0, 0, 0, 0),
422 ActionButton = new ButtonStyle()
424 Size = new Size(-1, 120),
426 BackgroundColor = new Color(0, 0, 0, 0),
427 Text = new TextLabelStyle()
430 TextColor = new Selector<Color>()
432 Normal = new Color("#0A0E4AFF"),
433 Focused = new Color("#00338BFF"),
434 Pressed = new Color("#1B69CAFF"),
435 Disabled = new Color("#C3CAD2FF"),
438 Icon = new ImageViewStyle()
440 Size = new Size(-1, 48),
441 Color = new Selector<Color>()
443 Normal = new Color("#0A0E4AFF"),
444 Focused = new Color("#00338BFF"),
445 Pressed = new Color("#1B69CAFF"),
446 Disabled = new Color("#C3CAD2FF"),
450 Padding = new Extents(64, 64, 0, 0),
451 NavigationPadding = new Extents(0, 24, 0, 0),
452 ActionPadding = new Extents(40, 0, 0, 0),
453 ActionCellPadding = new Size2D(40, 0),
456 theme.AddStyleWithoutClone("Tizen.NUI.Components.Picker", new PickerStyle()
458 Size = new Size(160, 339),
459 ItemTextLabel = new TextLabelStyle()
461 //FIXME: Should be check PointSize. given size from UX is too large.
463 VerticalAlignment = VerticalAlignment.Center,
464 HorizontalAlignment = HorizontalAlignment.Center,
465 Size = new Size(0,72),
466 TextColor = new Selector<Color>()
468 Normal = new Color("#000C2BFF"),
470 BackgroundColor = Color.White,
472 Divider = new ViewStyle()
475 WidthResizePolicy = ResizePolicyType.FillToParent,
476 Position = new Position(0, 132),
477 BackgroundColor = new Color("#0A0E4AFF"),
479 StartScrollOffset = new Size(0, 12),
482 theme.AddStyleWithoutClone("Tizen.NUI.Components.TabButton", new TabButtonStyle()
484 Size = new Size(-1, 84),
486 BackgroundColor = Color.White,
487 Text = new TextLabelStyle()
490 Size = new Size(-2, -2),
491 TextColor = new Selector<Color>()
493 Normal = new Color("#000C2BFF"),
494 Selected = new Color("#000C2BFF"),
495 Pressed = new Color("#1473E6FF"),
496 Disabled = new Color("#C3CAD2FF"),
499 Icon = new ImageViewStyle()
501 Size = new Size(48, 48),
502 Color = new Selector<Color>()
504 Normal = new Color("#000C2BFF"),
505 Selected = new Color("#000C2BFF"),
506 Pressed = new Color("#1473E6FF"),
507 Disabled = new Color("#C3CAD2FF"),
510 TopLine = new ViewStyle()
512 Size = new Size(-1, 1),
513 BackgroundColor = new Selector<Color>()
515 Normal = new Color("#000C2BFF"),
516 Selected = new Color("#000C2BFF"),
517 Pressed = new Color("#1473E6FF"),
518 Disabled = new Color("#C3CAD2FF"),
521 BottomLine = new ViewStyle()
523 Size = new Size(-1, 8),
524 Position = new Position(0, 76), // 84 - 8
525 BackgroundColor = new Selector<Color>()
527 Normal = Color.Transparent,
528 Selected = new Color("#000C2BFF"),
529 Pressed = new Color("#1473E6FF"),
530 Disabled = Color.Transparent,
535 theme.AddStyleWithoutClone("NotificationToast", new TextLabelStyle()
537 BackgroundImage = FrameworkInformation.ResourcePath + "IoT_Toast_1.png",
538 BackgroundImageBorder = new Rectangle(28, 28, 28, 28),
539 TextColor = new Color("#000C2B"),
541 WidthResizePolicy = ResizePolicyType.UseNaturalSize,
542 HeightResizePolicy = ResizePolicyType.UseNaturalSize,
543 PositionUsesPivotPoint = true,
544 HorizontalAlignment = HorizontalAlignment.Center,
545 VerticalAlignment = VerticalAlignment.Center,
546 Padding = new Extents(40, 40, 24, 24),
550 theme.AddStyleWithoutClone("Tizen.NUI.Components.AlertDialog", new AlertDialogStyle()
552 Size = new Size(-2, -2),
553 Padding = new Extents(80, 80, 0, 0),
554 BackgroundImage = FrameworkInformation.ResourcePath + "nui_component_default_dialog_bg.#.png",
555 TitleTextLabel = new TextLabelStyle()
557 Size = new Size(1024, -2),
558 Margin = new Extents(0, 0, 40, 40),
560 HorizontalAlignment = HorizontalAlignment.Center,
561 VerticalAlignment = VerticalAlignment.Center,
562 TextColor = new Selector<Color>()
564 Normal = new Color("#000C2BFF"),
567 MessageTextLabel = new TextLabelStyle()
569 Size = new Size(1024, -2),
570 Margin = new Extents(0, 0, 0, 64),
573 HorizontalAlignment = HorizontalAlignment.Center,
574 VerticalAlignment = VerticalAlignment.Center,
575 TextColor = new Selector<Color>()
577 Normal = new Color("#000C2BFF"),
580 ActionContent = new ViewStyle()
582 Size = new Size(1024, -2),
586 theme.AddStyleWithoutClone("Tizen.NUI.Components.TimePicker", new TimePickerStyle()
588 CellPadding = new Size(50, 339),
590 Pickers = new PickerStyle()
592 Size = new Size(160, 339),
593 ItemTextLabel = new TextLabelStyle()
595 //FIXME: Should be check PointSize. given size from UX is too large.
597 VerticalAlignment = VerticalAlignment.Center,
598 HorizontalAlignment = HorizontalAlignment.Center,
599 Size = new Size(0,72),
600 TextColor = new Selector<Color>()
602 Normal = new Color("#000C2BFF"),
604 BackgroundColor = Color.White,
606 Divider = new ViewStyle()
609 WidthResizePolicy = ResizePolicyType.FillToParent,
610 Position = new Position(0, 132),
611 BackgroundColor = new Color("#0A0E4AFF"),
613 StartScrollOffset = new Size2D(0, 12),
617 theme.AddStyleWithoutClone("Tizen.NUI.Components.DatePicker", new DatePickerStyle()
619 CellPadding = new Size(50, 339),
621 Pickers = new PickerStyle()
623 Size = new Size(160, 339),
624 ItemTextLabel = new TextLabelStyle()
626 //FIXME: Should be check PointSize. given size from UX is too large.
628 VerticalAlignment = VerticalAlignment.Center,
629 HorizontalAlignment = HorizontalAlignment.Center,
630 Size = new Size(0,72),
631 TextColor = new Selector<Color>()
633 Normal = new Color("#000C2BFF"),
635 BackgroundColor = Color.White,
637 Divider = new ViewStyle()
640 WidthResizePolicy = ResizePolicyType.FillToParent,
641 Position = new Position(0, 132),
642 BackgroundColor = new Color("#0A0E4AFF"),
644 StartScrollOffset = new Size2D(0, 12),
648 theme.AddStyleWithoutClone("Tizen.NUI.Components.MenuItem", new ButtonStyle()
650 Size = new Size(480, -2),
651 MinimumSize = new Size2D(0, 72),
653 BackgroundImage = FrameworkInformation.ResourcePath + "nui_component_menu_item_bg.png",
654 Padding = new Extents(16, 16, 16, 16),
655 Text = new TextLabelStyle()
659 HorizontalAlignment = HorizontalAlignment.Begin,
660 VerticalAlignment = VerticalAlignment.Center,
661 TextColor = new Selector<Color>()
663 Normal = new Color("#001447FF"),
664 Focused = new Color("#00338BFF"),
665 Pressed = new Color("#1B69CAFF"),
666 Disabled = new Color("#C3CAD2FF"),
669 Icon = new ImageViewStyle()
671 Size = new Size(-2, 48),
672 Color = new Selector<Color>()
674 Normal = new Color("#001447FF"),
675 Focused = new Color("#00338BFF"),
676 Pressed = new Color("#1B69CAFF"),
677 Disabled = new Color("#C3CAD2FF"),