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
28 /// The base theme description.
30 [SuppressMessage("Microsoft.Reliability", "CA2000: Dispose objects before losing scope", Justification = "The responsibility to dispose the object is transferred to the theme object.")]
33 var theme = new Theme()
35 Id = Tizen.NUI.DefaultThemeCreator.DefaultId,
36 Version = Tizen.NUI.DefaultThemeCreator.DefaultVersion
40 theme.AddStyleWithoutClone("Tizen.NUI.Components.Button", new ButtonStyle()
42 Size = new Size(339, 96),
44 ItemAlignment = LinearLayout.Alignment.Center,
45 BackgroundColor = new Selector<Color>()
47 Normal = new Color(0.039f, 0.055f, 0.29f, 1),
48 Pressed = new Color(0.106f, 0.412f, 0.792f, 1),
49 Focused = new Color(0, 0.2f, 0.545f, 1),
50 Disabled = new Color(0.765f, 0.792f, 0.824f, 1),
52 Text = new TextLabelStyle()
54 TextColor = Color.White,
59 // CheckBox base style
60 theme.AddStyleWithoutClone("Tizen.NUI.Components.CheckBox", new ButtonStyle()
62 ItemSpacing = new Size2D(32, 32),
63 ItemAlignment = LinearLayout.Alignment.CenterVertical,
64 Icon = new ImageViewStyle()
66 Size = new Size(36, 36),
67 ResourceUrl = new Selector<string>()
69 Normal = FrameworkInformation.ResourcePath + "IoT_check_off.png",
70 Pressed = FrameworkInformation.ResourcePath + "IoT_check_off_p.png",
71 Disabled = FrameworkInformation.ResourcePath + "IoT_check_off_d.png",
72 Focused = FrameworkInformation.ResourcePath + "IoT_check_off_f.png",
73 Selected = FrameworkInformation.ResourcePath + "IoT_check_on.png",
74 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_check_on_p.png",
75 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_check_on_f.png",
76 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_check_on_d.png",
79 Text = new TextLabelStyle()
81 TextColor = new Color("#001447"),
87 theme.AddStyleWithoutClone("Tizen.NUI.Components.Popup", new PopupStyle()
89 Size = new Size(500, 280),
90 BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1),
91 ImageShadow = new ImageShadow()
93 Url = FrameworkInformation.ResourcePath + "nui_component_default_popup_shadow.png",
94 Border = new Rectangle(24, 24, 24, 24),
95 Extents = new Vector2(48, 48)
97 Title = new TextLabelStyle()
100 Padding = new Extents(20, 20, 20, 20),
102 Buttons = new ButtonStyle()
104 Size = new Size(0, 80),
106 BackgroundColor = new Selector<Color>()
108 Normal = new Color(1, 1, 1, 1),
109 Pressed = new Color(1, 1, 1, 0.5f),
111 Overlay = new ImageViewStyle()
113 BackgroundColor = new Selector<Color>()
115 Pressed = new Color(0, 0, 0, 0.1f),
116 Other = new Color(1, 1, 1, 0.1f),
119 Text = new TextLabelStyle()
121 TextColor = new Color(0.05f, 0.63f, 0.9f, 1),
126 // Progress base style
127 theme.AddStyleWithoutClone("Tizen.NUI.Components.Progress", new ProgressStyle()
129 Size = new Size(200, 25),
130 Track = new ImageViewStyle()
132 ResourceUrl = FrameworkInformation.ResourcePath + "IoT_progressindicator_empty.png",
133 BackgroundColor = new Color(0, 0, 0, 0.1f),
135 Buffer = new ImageViewStyle()
137 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 0.3f),
139 Progress = new ImageViewStyle()
141 ResourceUrl = new Selector<string>()
143 Normal = FrameworkInformation.ResourcePath + "IoT_progressindicator_progress.png",
144 Disabled = FrameworkInformation.ResourcePath + "IoT_progressindicator_progressdisabled.png",
146 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
148 IndeterminateImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_progress_indeterminate.png",
151 // RadioButton base style
152 theme.AddStyleWithoutClone("Tizen.NUI.Components.RadioButton", new ButtonStyle()
154 ItemSpacing = new Size2D(32, 32),
155 ItemAlignment = LinearLayout.Alignment.CenterVertical,
156 Icon = new ImageViewStyle()
158 Size = new Size(36, 36),
159 ResourceUrl = new Selector<string>()
161 Normal = FrameworkInformation.ResourcePath + "IoT_radiobutton_off.png",
162 Pressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_p.png",
163 Disabled = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_d.png",
164 Focused = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_f.png",
165 Selected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on.png",
166 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_p.png",
167 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_f.png",
168 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_d.png",
171 Text = new TextLabelStyle()
173 TextColor = new Color("#001447"),
179 theme.AddStyleWithoutClone("Tizen.NUI.Components.Slider", new SliderStyle()
181 Size = new Size(200, 50),
183 Track = new ImageViewStyle()
185 Size = new Size(100, 8),
186 ResourceUrl = new Selector<string>()
188 Normal = FrameworkInformation.ResourcePath + "IoT_slider_status_empty_track.png",
189 Disabled = FrameworkInformation.ResourcePath + "IoT_slider_status_track_disabled.png",
191 BackgroundColor = new Color(1.0f, 1.0f, 1.0f, 0.1f),
193 Progress = new ImageViewStyle()
195 Size = new Size(100, 8),
196 ResourceUrl = FrameworkInformation.ResourcePath + "IoT_slider_status_track.png",
197 BackgroundColor = new Color(0.03f, 0.05f, 0.3f, 1),
199 Thumb = new ImageViewStyle()
201 Size = new Size(36, 36),
202 ResourceUrl = FrameworkInformation.ResourcePath + "IoT_slider_handler_normal.png",
203 // TODO : Should check later when UX guide provides the pressed image
204 /*BackgroundImage = new Selector<string>()
206 Normal = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
207 Pressed = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
210 ValueIndicatorImage = new ImageViewStyle()
212 Size = new Size(49, 24),
213 BackgroundColor = new Color(0.0f, 0.04f, 0.16f, 1.0f),
218 theme.AddStyleWithoutClone("Tizen.NUI.Components.Switch", new SwitchStyle()
220 ItemSpacing = new Size2D(32, 32),
221 ItemAlignment = LinearLayout.Alignment.CenterVertical,
222 Track = new ImageViewStyle()
224 Size = new Size(80, 40),
225 ResourceUrl = new Selector<string>()
227 Normal = FrameworkInformation.ResourcePath + "IoT_switch_track_off.png",
228 Pressed = FrameworkInformation.ResourcePath + "IoT_switch_track_off_p.png",
229 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_track_off_d.png",
230 Focused = FrameworkInformation.ResourcePath + "IoT_switch_track_off_f.png",
231 Selected = FrameworkInformation.ResourcePath + "IoT_switch_track_on.png",
232 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_track_on_p.png",
233 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_track_on_f.png",
234 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_switch_track_on_d.png",
237 Thumb = new ImageViewStyle()
239 Size = new Size(40, 40),
240 ResourceUrl = new Selector<string>()
242 Normal = FrameworkInformation.ResourcePath + "IoT_switch_thumb.png",
243 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_thumb_d.png",
244 Selected = FrameworkInformation.ResourcePath + "IoT_switch_thumb_s.png",
245 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sp.png",
246 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sf.png",
249 Text = new TextLabelStyle()
251 TextColor = new Color("#001447"),
256 // Loading base style
257 theme.AddStyleWithoutClone("Tizen.NUI.Components.Loading", new LoadingStyle()
259 LoadingSize = new Size(100, 100),
262 // Pagination base style
263 theme.AddStyleWithoutClone("Tizen.NUI.Components.Pagination", new PaginationStyle()
265 IndicatorImageUrl = new Selector<string>()
267 Normal = FrameworkInformation.ResourcePath + "nui_component_default_pagination_normal_dot.png",
268 Selected = FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
270 IndicatorSize = new Size(10, 10),
273 // Scrollbar base style
274 theme.AddStyleWithoutClone("Tizen.NUI.Components.Scrollbar", new ScrollbarStyle()
278 TrackColor = new Color(0f, 0f, 0f, 0f),
279 ThumbColor = new Color("#0A0E4A"),
281 ThumbVerticalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_vbar.#.png",
282 ThumbHorizontalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_hbar.#.png",
285 // LinearLayouter base style
286 theme.AddStyleWithoutClone("Tizen.NUI.Components.LinearLayouter", new ViewStyle()
288 Padding = new Extents(64, 64, 0, 0)
291 // GridLayouter base style
292 theme.AddStyleWithoutClone("Tizen.NUI.Components.GridLayouter", new ViewStyle()
294 Padding = new Extents(0, 0, 0, 0),
297 // ItemsLayouter base style
298 theme.AddStyleWithoutClone("Tizen.NUI.Components.ItemsLayouter", new ViewStyle()
300 Padding = new Extents(0, 0, 0, 0),
303 // RecyclerViewItem base style
304 theme.AddStyleWithoutClone("Tizen.NUI.Components.RecyclerViewItem", new RecyclerViewItemStyle()
306 BackgroundColor = new Selector<Color>()
308 Normal = new Color(1, 1, 1, 1),
309 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
310 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
311 Selected = new Color(0.701f, 0.898f, 0.937f, 1),
315 // DefaultLinearItem base style
316 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultLinearItem", new DefaultLinearItemStyle()
319 Padding = new Extents(64, 64, 18, 17),
320 Margin = new Extents(0, 0, 0, 0),
321 BackgroundColor = new Selector<Color>()
323 Normal = new Color(1, 1, 1, 1),
324 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
325 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
326 Selected = new Color(0.85f, 0.85f, 0.85f, 1),
328 Label = new TextLabelStyle()
332 FontFamily = "BreezeSans", //FXIME Font Weight is Light
333 TextColor = new Color("#001447"),
334 ThemeChangeSensitive = false
336 SubLabel = new TextLabelStyle()
340 FontFamily = "BreezeSans",
341 TextColor = new Color("#001447"),
342 ThemeChangeSensitive = false
344 Icon = new ViewStyle()
346 Margin = new Extents(0, 32, 0, 0)
348 Extra = new ViewStyle()
350 Margin = new Extents(32, 0, 0, 0)
352 Seperator = new ViewStyle()
355 Margin = new Extents(64, 64, 0, 0),
356 BackgroundColor = new Color("#C3CAD2"),
360 // DefaultGridItem base style
361 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultGridItem", new DefaultGridItemStyle()
363 Padding = new Extents(0, 0, 0, 0),
364 Margin = new Extents(5, 5, 5, 5),
365 Label = new TextLabelStyle()
369 LineWrapMode = LineWrapMode.Character,
370 ThemeChangeSensitive = false
372 Badge = new ViewStyle()
374 Margin = new Extents(5, 5, 5, 5),
378 // DefaultTitleItem base style
379 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultTitleItem", new DefaultTitleItemStyle()
382 Padding = new Extents(64, 64, 12, 12),
383 Margin = new Extents(0, 0, 0, 0),
384 BackgroundColor = new Selector<Color>()
386 Normal = new Color("#EEEEF1"),
388 Label = new TextLabelStyle()
392 TextColor = new Color("#001447"),
393 ThemeChangeSensitive = false
395 Icon = new ViewStyle()
397 Margin = new Extents(40, 0, 0, 0)
399 Seperator = new ViewStyle()
401 Margin = new Extents(0, 0, 0, 0),
402 BackgroundColor = new Color(0, 0, 0, 0),
406 // ContentPage base style
407 theme.AddStyleWithoutClone("Tizen.NUI.Components.ContentPage", new ViewStyle()
409 BackgroundColor = new Color("#EEEFF1"),
413 theme.AddStyleWithoutClone("Tizen.NUI.Components.AppBar", new AppBarStyle()
415 Size = new Size(-1, 120),
416 BackgroundColor = new Color("#EEEFF1"),
417 BackButton = new ButtonStyle()
419 Size = new Size(48, 48),
421 BackgroundColor = new Color(0, 0, 0, 0),
422 Icon = new ImageViewStyle()
424 Size = new Size(48, 48),
425 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_back_button.png",
426 Color = new Selector<Color>()
428 Normal = new Color("#0A0E4A"),
429 Focused = new Color("#00338B"),
430 Pressed = new Color("#1B69CA"),
431 Disabled = new Color("#C3CAD2"),
434 ThemeChangeSensitive = false
436 TitleTextLabel = new TextLabelStyle()
439 VerticalAlignment = VerticalAlignment.Center,
440 TextColor = new Selector<Color>()
442 Normal = new Color("#000C2B"),
444 ThemeChangeSensitive = false
446 ActionView = new ViewStyle()
448 Size = new Size(-1, 120),
450 BackgroundColor = new Color(0, 0, 0, 0),
452 ActionButton = new ButtonStyle()
454 Size = new Size(-1, 120),
456 BackgroundColor = new Color(0, 0, 0, 0),
457 Text = new TextLabelStyle()
460 TextColor = new Selector<Color>()
462 Normal = new Color("#0A0E4A"),
463 Focused = new Color("#00338B"),
464 Pressed = new Color("#1B69CA"),
465 Disabled = new Color("#C3CAD2"),
468 Icon = new ImageViewStyle()
470 Size = new Size(-1, 48),
471 Color = new Selector<Color>()
473 Normal = new Color("#0A0E4A"),
474 Focused = new Color("#00338B"),
475 Pressed = new Color("#1B69CA"),
476 Disabled = new Color("#C3CAD2"),
479 ThemeChangeSensitive = false,
481 Padding = new Extents(64, 64, 0, 0),
482 NavigationPadding = new Extents(0, 24, 0, 0),
483 ActionPadding = new Extents(40, 0, 0, 0),
484 ActionCellPadding = new Size2D(40, 0),
488 theme.AddStyleWithoutClone("Tizen.NUI.Components.Picker", new PickerStyle()
490 Size = new Size(160, 339),
491 ItemTextLabel = new TextLabelStyle()
493 //FIXME: Should be check PointSize. given size from UX is too large.
495 VerticalAlignment = VerticalAlignment.Center,
496 HorizontalAlignment = HorizontalAlignment.Center,
497 Size = new Size(0,72),
498 TextColor = new Selector<Color>()
500 Normal = new Color("#000C2B"),
502 BackgroundColor = Color.White,
504 Divider = new ViewStyle()
507 WidthResizePolicy = ResizePolicyType.FillToParent,
508 Position = new Position(0, 132),
509 BackgroundColor = new Color("#0A0E4A"),
511 StartScrollOffset = new Size(0, 12),
514 // TabButton base style
515 theme.AddStyleWithoutClone("Tizen.NUI.Components.TabButton", new TabButtonStyle()
517 Size = new Size(-1, 84),
519 BackgroundColor = Color.White,
520 Text = new TextLabelStyle()
523 Size = new Size(-2, -2),
524 TextColor = new Selector<Color>()
526 Normal = new Color("#000C2B"),
527 Selected = new Color("#000C2B"),
528 Pressed = new Color("#1473E6"),
529 Disabled = new Color("#C3CAD2"),
531 ThemeChangeSensitive = false,
533 Icon = new ImageViewStyle()
535 Size = new Size(48, 48),
536 Color = new Selector<Color>()
538 Normal = new Color("#000C2B"),
539 Selected = new Color("#000C2B"),
540 Pressed = new Color("#1473E6"),
541 Disabled = new Color("#C3CAD2"),
544 TopLine = new ViewStyle()
546 Size = new Size(-1, 1),
547 BackgroundColor = new Selector<Color>()
549 Normal = new Color("#000C2B"),
550 Selected = new Color("#000C2B"),
551 Pressed = new Color("#1473E6"),
552 Disabled = new Color("#C3CAD2"),
555 BottomLine = new ViewStyle()
557 Size = new Size(-1, 8),
558 Position = new Position(0, 76), // 84 - 8
559 BackgroundColor = new Selector<Color>()
561 Normal = Color.Transparent,
562 Selected = new Color("#000C2B"),
563 Pressed = new Color("#1473E6"),
564 Disabled = Color.Transparent,
569 // NotificationToast base style
570 theme.AddStyleWithoutClone("NotificationToast", new TextLabelStyle()
572 BackgroundColor = new Color("#F2F7FF"),
573 CornerRadius = 20.0f,
574 BoxShadow = new Shadow(5.0f, new Color("#00000066"), new Vector2(2.0f, 2.0f)),
575 TextColor = new Color("#000C2B"),
577 WidthResizePolicy = ResizePolicyType.UseNaturalSize,
578 HeightResizePolicy = ResizePolicyType.UseNaturalSize,
579 PositionUsesPivotPoint = true,
580 HorizontalAlignment = HorizontalAlignment.Center,
581 VerticalAlignment = VerticalAlignment.Center,
582 Padding = new Extents(40, 40, 24, 24),
586 // AlertDialog base style
587 theme.AddStyleWithoutClone("Tizen.NUI.Components.AlertDialog", new AlertDialogStyle()
589 Size = new Size(-2, -2),
590 Padding = new Extents(80, 80, 0, 0),
591 BackgroundColor = Color.White,
592 CornerRadius = 28.0f,
593 BoxShadow = new Shadow(2.0f, new Color("#00000029"), new Vector2(2.0f, 2.0f)),
594 TitleTextLabel = new TextLabelStyle()
596 Size = new Size(720, -2),
597 Margin = new Extents(0, 0, 40, 40),
599 HorizontalAlignment = HorizontalAlignment.Center,
600 VerticalAlignment = VerticalAlignment.Center,
601 TextColor = new Color("#000C2B"),
602 ThemeChangeSensitive = false,
604 MessageTextLabel = new TextLabelStyle()
606 Size = new Size(720, -2),
607 Margin = new Extents(0, 0, 0, 64),
610 HorizontalAlignment = HorizontalAlignment.Center,
611 VerticalAlignment = VerticalAlignment.Center,
612 TextColor = new Color("#000C2B"),
613 ThemeChangeSensitive = false,
615 ActionContent = new ViewStyle()
617 Size = new Size(720, -2),
621 // TimePicker base style
622 theme.AddStyleWithoutClone("Tizen.NUI.Components.TimePicker", new TimePickerStyle()
624 CellPadding = new Size(50, 339),
626 Pickers = new PickerStyle()
628 Size = new Size(160, 339),
629 ItemTextLabel = new TextLabelStyle()
631 //FIXME: Should be check PointSize. given size from UX is too large.
633 VerticalAlignment = VerticalAlignment.Center,
634 HorizontalAlignment = HorizontalAlignment.Center,
635 Size = new Size(0,72),
636 TextColor = new Color("#000C2B"),
637 BackgroundColor = Color.White,
638 ThemeChangeSensitive = false
640 Divider = new ViewStyle()
643 WidthResizePolicy = ResizePolicyType.FillToParent,
644 Position = new Position(0, 132),
645 BackgroundColor = new Color("#0A0E4A"),
647 StartScrollOffset = new Size2D(0, 12),
651 // DatePicker base style
652 theme.AddStyleWithoutClone("Tizen.NUI.Components.DatePicker", new DatePickerStyle()
654 CellPadding = new Size(50, 339),
656 Pickers = new PickerStyle()
658 Size = new Size(160, 339),
659 ItemTextLabel = new TextLabelStyle()
661 //FIXME: Should be check PointSize. given size from UX is too large.
663 VerticalAlignment = VerticalAlignment.Center,
664 HorizontalAlignment = HorizontalAlignment.Center,
665 Size = new Size(0,72),
666 TextColor = new Color("#000C2B"),
667 BackgroundColor = Color.White,
668 ThemeChangeSensitive = false
670 Divider = new ViewStyle()
673 WidthResizePolicy = ResizePolicyType.FillToParent,
674 Position = new Position(0, 132),
675 BackgroundColor = new Color("#0A0E4A"),
677 StartScrollOffset = new Size2D(0, 12),
682 theme.AddStyleWithoutClone("Tizen.NUI.Components.Menu", new ViewStyle()
684 BackgroundColor = new Color("#EEEFF1"),
687 // MenuItem base style
688 theme.AddStyleWithoutClone("Tizen.NUI.Components.MenuItem", new ButtonStyle()
690 Size = new Size(480, -2),
691 MinimumSize = new Size2D(0, 72),
693 BackgroundImage = FrameworkInformation.ResourcePath + "nui_component_menu_item_bg.png",
694 Padding = new Extents(16, 16, 16, 16),
695 Text = new TextLabelStyle()
699 HorizontalAlignment = HorizontalAlignment.Begin,
700 VerticalAlignment = VerticalAlignment.Center,
701 TextColor = new Selector<Color>()
703 Normal = new Color("#001447"),
704 Focused = new Color("#00338B"),
705 Pressed = new Color("#1B69CA"),
706 Disabled = new Color("#C3CAD2"),
708 ThemeChangeSensitive = false
710 Icon = new ImageViewStyle()
712 Size = new Size(-2, 48),
713 Color = new Selector<Color>()
715 Normal = new Color("#001447"),
716 Focused = new Color("#00338B"),
717 Pressed = new Color("#1B69CA"),
718 Disabled = new Color("#C3CAD2"),
728 #endif // !PROFILE_WEARABLE