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 ItemHorizontalAlignment = HorizontalAlignment.Center,
45 ItemVerticalAlignment = VerticalAlignment.Center,
46 BackgroundColor = new Selector<Color>()
48 Normal = new Color(0.039f, 0.055f, 0.29f, 1),
49 Pressed = new Color(0.106f, 0.412f, 0.792f, 1),
50 Focused = new Color(0, 0.2f, 0.545f, 1),
51 Disabled = new Color(0.765f, 0.792f, 0.824f, 1),
53 Text = new TextLabelStyle()
55 TextColor = Color.White,
60 // CheckBox base style
61 theme.AddStyleWithoutClone("Tizen.NUI.Components.CheckBox", new ButtonStyle()
63 ItemSpacing = new Size2D(32, 32),
64 ItemHorizontalAlignment = HorizontalAlignment.Begin,
65 ItemVerticalAlignment = VerticalAlignment.Center,
66 Icon = new ImageViewStyle()
68 Size = new Size(36, 36),
69 ResourceUrl = new Selector<string>()
71 Normal = FrameworkInformation.ResourcePath + "IoT_check_off.png",
72 Pressed = FrameworkInformation.ResourcePath + "IoT_check_off_p.png",
73 Disabled = FrameworkInformation.ResourcePath + "IoT_check_off_d.png",
74 Focused = FrameworkInformation.ResourcePath + "IoT_check_off_f.png",
75 Selected = FrameworkInformation.ResourcePath + "IoT_check_on.png",
76 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_check_on_p.png",
77 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_check_on_f.png",
78 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_check_on_d.png",
81 Text = new TextLabelStyle()
83 TextColor = new Color("#001447"),
89 theme.AddStyleWithoutClone("Tizen.NUI.Components.Popup", new PopupStyle()
91 Size = new Size(500, 280),
92 BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1),
93 ImageShadow = new ImageShadow()
95 Url = FrameworkInformation.ResourcePath + "nui_component_default_popup_shadow.png",
96 Border = new Rectangle(24, 24, 24, 24),
97 Extents = new Vector2(48, 48)
99 Title = new TextLabelStyle()
102 Padding = new Extents(20, 20, 20, 20),
104 Buttons = new ButtonStyle()
106 Size = new Size(0, 80),
108 BackgroundColor = new Selector<Color>()
110 Normal = new Color(1, 1, 1, 1),
111 Pressed = new Color(1, 1, 1, 0.5f),
113 Overlay = new ImageViewStyle()
115 BackgroundColor = new Selector<Color>()
117 Pressed = new Color(0, 0, 0, 0.1f),
118 Other = new Color(1, 1, 1, 0.1f),
121 Text = new TextLabelStyle()
123 TextColor = new Color(0.05f, 0.63f, 0.9f, 1),
128 // Progress base style
129 theme.AddStyleWithoutClone("Tizen.NUI.Components.Progress", new ProgressStyle()
131 Size = new Size(200, 25),
132 Track = new ImageViewStyle()
134 BorderlineWidth = 0.5f,
135 BorderlineColor = new Color(0.92f, 0.93f, 0.94f, 1.0f),
136 BackgroundColor = new Selector<Color>()
138 Normal = new Color(1.0f, 1.0f, 1.0f, 0.5f),
139 Disabled = new Color(0.73f, 0.76f, 0.79f, 1),
142 Buffer = new ImageViewStyle()
144 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 0.3f),
146 Progress = new ImageViewStyle()
148 BackgroundColor = new Color(0.03f, 0.05f, 0.29f, 1),
150 IndeterminateImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_progress_indeterminate.png",
153 // RadioButton base style
154 theme.AddStyleWithoutClone("Tizen.NUI.Components.RadioButton", new ButtonStyle()
156 ItemSpacing = new Size2D(32, 32),
157 ItemHorizontalAlignment = HorizontalAlignment.Begin,
158 ItemVerticalAlignment = VerticalAlignment.Center,
159 Icon = new ImageViewStyle()
161 Size = new Size(36, 36),
162 ResourceUrl = new Selector<string>()
164 Normal = FrameworkInformation.ResourcePath + "IoT_radiobutton_off.png",
165 Pressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_p.png",
166 Disabled = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_d.png",
167 Focused = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_f.png",
168 Selected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on.png",
169 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_p.png",
170 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_f.png",
171 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_d.png",
174 Text = new TextLabelStyle()
176 TextColor = new Color("#001447"),
182 theme.AddStyleWithoutClone("Tizen.NUI.Components.Slider", new SliderStyle()
184 Size = new Size(200, 50),
186 Track = new ImageViewStyle()
188 Size = new Size(100, 8),
189 BorderlineWidth = 0.5f,
190 BorderlineColor = new Color(0.84f, 0.85f, 0.87f, 1.0f),
191 BackgroundColor = new Selector<Color>()
193 Normal = new Color(1.0f, 1.0f, 1.0f, 0.2f),
194 Disabled = new Color(0.76f, 0.79f, 0.82f, 1),
197 Progress = new ImageViewStyle()
199 Size = new Size(100, 8),
200 BackgroundColor = new Selector<Color>()
202 Normal = new Color(0.03f, 0.05f, 0.3f, 1),
203 Disabled = new Color(0.76f, 0.79f, 0.82f, 1),
206 Thumb = new ImageViewStyle()
208 Size = new Size(36, 36),
209 ResourceUrl = new Selector<string>()
211 Normal = FrameworkInformation.ResourcePath + "IoT_slider_handler_normal.png",
212 Pressed = FrameworkInformation.ResourcePath + "IoT_slider_handler_pressed.png",
213 Focused = FrameworkInformation.ResourcePath + "IoT_slider_handler_pressed.png",
214 Disabled = FrameworkInformation.ResourcePath + "IoT_slider_handler_disabled.png",
217 ValueIndicatorImage = new ImageViewStyle()
219 Size = new Size(49, 24),
220 BackgroundColor = new Color(0.0f, 0.04f, 0.16f, 1.0f),
225 theme.AddStyleWithoutClone("Tizen.NUI.Components.Switch", new SwitchStyle()
227 ItemSpacing = new Size2D(32, 32),
228 ItemHorizontalAlignment = HorizontalAlignment.Begin,
229 ItemVerticalAlignment = VerticalAlignment.Center,
230 Track = new ImageViewStyle()
232 Size = new Size(80, 40),
233 ResourceUrl = new Selector<string>()
235 Normal = FrameworkInformation.ResourcePath + "IoT_switch_track_off.png",
236 Pressed = FrameworkInformation.ResourcePath + "IoT_switch_track_off_p.png",
237 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_track_off_d.png",
238 Focused = FrameworkInformation.ResourcePath + "IoT_switch_track_off_f.png",
239 Selected = FrameworkInformation.ResourcePath + "IoT_switch_track_on.png",
240 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_track_on_p.png",
241 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_track_on_f.png",
242 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_switch_track_on_d.png",
245 Thumb = new ImageViewStyle()
247 Size = new Size(40, 40),
248 ResourceUrl = new Selector<string>()
250 Normal = FrameworkInformation.ResourcePath + "IoT_switch_thumb.png",
251 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_thumb_d.png",
252 Selected = FrameworkInformation.ResourcePath + "IoT_switch_thumb_s.png",
253 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sp.png",
254 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sf.png",
257 Text = new TextLabelStyle()
259 TextColor = new Color("#001447"),
264 // Loading base style
265 theme.AddStyleWithoutClone("Tizen.NUI.Components.Loading", new LoadingStyle()
267 LoadingSize = new Size(100, 100),
270 // Pagination base style
271 theme.AddStyleWithoutClone("Tizen.NUI.Components.Pagination", new PaginationStyle()
273 IndicatorImageUrl = new Selector<string>()
275 Normal = FrameworkInformation.ResourcePath + "nui_component_default_pagination_normal_dot.png",
276 Selected = FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
278 IndicatorSize = new Size(10, 10),
281 // Scrollbar base style
282 theme.AddStyleWithoutClone("Tizen.NUI.Components.Scrollbar", new ScrollbarStyle()
286 TrackColor = new Color(0f, 0f, 0f, 0f),
287 ThumbColor = new Color("#0A0E4A"),
289 ThumbVerticalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_vbar.#.png",
290 ThumbHorizontalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_hbar.#.png",
293 // LinearLayouter base style
294 theme.AddStyleWithoutClone("Tizen.NUI.Components.LinearLayouter", new ViewStyle()
296 Padding = new Extents(64, 64, 0, 0)
299 // GridLayouter base style
300 theme.AddStyleWithoutClone("Tizen.NUI.Components.GridLayouter", new ViewStyle()
302 Padding = new Extents(0, 0, 0, 0),
305 // ItemsLayouter base style
306 theme.AddStyleWithoutClone("Tizen.NUI.Components.ItemsLayouter", new ViewStyle()
308 Padding = new Extents(0, 0, 0, 0),
311 // RecyclerViewItem base style
312 theme.AddStyleWithoutClone("Tizen.NUI.Components.RecyclerViewItem", new RecyclerViewItemStyle()
314 BackgroundColor = new Selector<Color>()
316 Normal = new Color(1, 1, 1, 1),
317 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
318 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
319 Selected = new Color(0.701f, 0.898f, 0.937f, 1),
323 // DefaultLinearItem base style
324 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultLinearItem", new DefaultLinearItemStyle()
327 Padding = new Extents(64, 64, 18, 17),
328 Margin = new Extents(0, 0, 0, 0),
329 BackgroundColor = new Selector<Color>()
331 Normal = new Color(1, 1, 1, 1),
332 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
333 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
334 Selected = new Color(0.85f, 0.85f, 0.85f, 1),
336 Label = new TextLabelStyle()
340 FontFamily = "BreezeSans", //FXIME Font Weight is Light
341 TextColor = new Color("#001447"),
342 ThemeChangeSensitive = false
344 SubLabel = new TextLabelStyle()
348 FontFamily = "BreezeSans",
349 TextColor = new Color("#001447"),
350 ThemeChangeSensitive = false
352 Icon = new ViewStyle()
354 Margin = new Extents(0, 32, 0, 0)
356 Extra = new ViewStyle()
358 Margin = new Extents(32, 0, 0, 0)
360 Seperator = new ViewStyle()
363 Margin = new Extents(64, 64, 0, 0),
364 BackgroundColor = new Color("#C3CAD2"),
368 // DefaultGridItem base style
369 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultGridItem", new DefaultGridItemStyle()
371 Padding = new Extents(0, 0, 0, 0),
372 Margin = new Extents(5, 5, 5, 5),
373 Label = new TextLabelStyle()
377 LineWrapMode = LineWrapMode.Character,
378 ThemeChangeSensitive = false
380 Badge = new ViewStyle()
382 Margin = new Extents(5, 5, 5, 5),
386 // DefaultTitleItem base style
387 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultTitleItem", new DefaultTitleItemStyle()
390 Padding = new Extents(64, 64, 12, 12),
391 Margin = new Extents(0, 0, 0, 0),
392 BackgroundColor = new Selector<Color>()
394 Normal = new Color("#EEEEF1"),
396 Label = new TextLabelStyle()
400 TextColor = new Color("#001447"),
401 ThemeChangeSensitive = false
403 Icon = new ViewStyle()
405 Margin = new Extents(40, 0, 0, 0)
407 Seperator = new ViewStyle()
409 Margin = new Extents(0, 0, 0, 0),
410 BackgroundColor = new Color(0, 0, 0, 0),
414 // ContentPage base style
415 theme.AddStyleWithoutClone("Tizen.NUI.Components.ContentPage", new ViewStyle()
417 BackgroundColor = new Color("#EEEFF1"),
421 theme.AddStyleWithoutClone("Tizen.NUI.Components.AppBar", new AppBarStyle()
423 Size = new Size(-1, 64),
424 BackgroundColor = Color.Transparent,
425 BackButton = new ButtonStyle()
427 Size = new Size(48, 48),
429 BackgroundColor = Color.Transparent,
430 Icon = new ImageViewStyle()
432 Size = new Size(48, 48),
433 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_back_button.png",
434 Color = new Selector<Color>()
436 Normal = new Color("#17234D"),
437 Focused = new Color("#17234D"),
438 Pressed = new Color("#FF6200"),
439 Disabled = new Color("#CACACA"),
442 ThemeChangeSensitive = false
444 TitleTextLabel = new TextLabelStyle()
447 VerticalAlignment = VerticalAlignment.Center,
448 TextColor = new Selector<Color>()
450 Normal = new Color("#17234D"),
452 ThemeChangeSensitive = false
454 ActionView = new ViewStyle()
456 Size = new Size(48, 64),
458 BackgroundColor = Color.Transparent,
460 ActionButton = new ButtonStyle()
462 Size = new Size(-2, 64),
464 BackgroundColor = Color.Transparent,
465 Text = new TextLabelStyle()
468 TextColor = new Selector<Color>()
470 Normal = new Color("#FF6200"),
471 Focused = new Color("#FF6200"),
472 Pressed = new Color("#D95300"),
473 Disabled = new Color("#CACACA"),
476 Icon = new ImageViewStyle()
478 Size = new Size(48, 48),
479 Color = new Selector<Color>()
481 Normal = new Color("#17234D"),
482 Focused = new Color("#17234D"),
483 Pressed = new Color("#FF6200"),
484 Disabled = new Color("#CACACA"),
487 ThemeChangeSensitive = false,
489 Padding = new Extents(16, 16, 0, 0),
490 NavigationPadding = new Extents(0, 8, 0, 0),
491 ActionPadding = new Extents(16, 0, 0, 0),
492 ActionCellPadding = new Size2D(16, 0),
496 theme.AddStyleWithoutClone("Tizen.NUI.Components.Picker", new PickerStyle()
498 Size = new Size(160, 339),
499 ItemTextLabel = new TextLabelStyle()
501 //FIXME: Should be check PointSize. given size from UX is too large.
503 VerticalAlignment = VerticalAlignment.Center,
504 HorizontalAlignment = HorizontalAlignment.Center,
505 Size = new Size(0,72),
506 TextColor = new Selector<Color>()
508 Normal = new Color("#000C2B"),
510 BackgroundColor = Color.White,
512 Divider = new ViewStyle()
515 WidthResizePolicy = ResizePolicyType.FillToParent,
516 Position = new Position(0, 132),
517 BackgroundColor = new Color("#0A0E4A"),
519 StartScrollOffset = new Size(0, 12),
522 // TabButton base style
523 theme.AddStyleWithoutClone("Tizen.NUI.Components.TabButton", new TabButtonStyle()
525 Size = new Size(-1, 84),
527 BackgroundColor = Color.White,
528 Text = new TextLabelStyle()
531 Size = new Size(-2, -2),
532 TextColor = new Selector<Color>()
534 Normal = new Color("#000C2B"),
535 Selected = new Color("#000C2B"),
536 Pressed = new Color("#1473E6"),
537 Disabled = new Color("#C3CAD2"),
539 ThemeChangeSensitive = false,
541 Icon = new ImageViewStyle()
543 Size = new Size(48, 48),
544 Color = new Selector<Color>()
546 Normal = new Color("#000C2B"),
547 Selected = new Color("#000C2B"),
548 Pressed = new Color("#1473E6"),
549 Disabled = new Color("#C3CAD2"),
552 TopLine = new ViewStyle()
554 Size = new Size(-1, 1),
555 BackgroundColor = new Selector<Color>()
557 Normal = new Color("#000C2B"),
558 Selected = new Color("#000C2B"),
559 Pressed = new Color("#1473E6"),
560 Disabled = new Color("#C3CAD2"),
563 BottomLine = new ViewStyle()
565 Size = new Size(-1, 8),
566 Position = new Position(0, 76), // 84 - 8
567 BackgroundColor = new Selector<Color>()
569 Normal = Color.Transparent,
570 Selected = new Color("#000C2B"),
571 Pressed = new Color("#1473E6"),
572 Disabled = Color.Transparent,
577 // NotificationToast base style
578 theme.AddStyleWithoutClone("NotificationToast", new TextLabelStyle()
580 BackgroundColor = new Color("#F2F7FF"),
581 CornerRadius = 20.0f,
582 BoxShadow = new Shadow(5.0f, new Color("#00000066"), new Vector2(2.0f, 2.0f)),
583 TextColor = new Color("#000C2B"),
585 WidthResizePolicy = ResizePolicyType.UseNaturalSize,
586 HeightResizePolicy = ResizePolicyType.UseNaturalSize,
587 PositionUsesPivotPoint = true,
588 HorizontalAlignment = HorizontalAlignment.Center,
589 VerticalAlignment = VerticalAlignment.Center,
590 Padding = new Extents(40, 40, 24, 24),
594 // AlertDialog base style
595 theme.AddStyleWithoutClone("Tizen.NUI.Components.AlertDialog", new AlertDialogStyle()
597 Size = new Size(-2, -2),
598 Padding = new Extents(80, 80, 0, 0),
599 BackgroundColor = Color.White,
600 CornerRadius = 28.0f,
601 BoxShadow = new Shadow(2.0f, new Color("#00000029"), new Vector2(2.0f, 2.0f)),
602 TitleTextLabel = new TextLabelStyle()
604 Size = new Size(720, -2),
605 Margin = new Extents(0, 0, 40, 40),
607 HorizontalAlignment = HorizontalAlignment.Center,
608 VerticalAlignment = VerticalAlignment.Center,
609 TextColor = new Color("#000C2B"),
610 ThemeChangeSensitive = false,
612 MessageTextLabel = new TextLabelStyle()
614 Size = new Size(720, -2),
615 Margin = new Extents(0, 0, 0, 64),
618 HorizontalAlignment = HorizontalAlignment.Center,
619 VerticalAlignment = VerticalAlignment.Center,
620 TextColor = new Color("#000C2B"),
621 ThemeChangeSensitive = false,
623 ActionContent = new ViewStyle()
625 Size = new Size(720, -2),
629 // TimePicker base style
630 theme.AddStyleWithoutClone("Tizen.NUI.Components.TimePicker", new TimePickerStyle()
632 CellPadding = new Size(50, 339),
634 Pickers = new PickerStyle()
636 Size = new Size(160, 339),
637 ItemTextLabel = new TextLabelStyle()
639 //FIXME: Should be check PointSize. given size from UX is too large.
641 VerticalAlignment = VerticalAlignment.Center,
642 HorizontalAlignment = HorizontalAlignment.Center,
643 Size = new Size(0,72),
644 TextColor = new Color("#000C2B"),
645 BackgroundColor = Color.White,
646 ThemeChangeSensitive = false
648 Divider = new ViewStyle()
651 WidthResizePolicy = ResizePolicyType.FillToParent,
652 Position = new Position(0, 132),
653 BackgroundColor = new Color("#0A0E4A"),
655 StartScrollOffset = new Size2D(0, 12),
659 // DatePicker base style
660 theme.AddStyleWithoutClone("Tizen.NUI.Components.DatePicker", new DatePickerStyle()
662 CellPadding = new Size(50, 339),
664 Pickers = new PickerStyle()
666 Size = new Size(160, 339),
667 ItemTextLabel = new TextLabelStyle()
669 //FIXME: Should be check PointSize. given size from UX is too large.
671 VerticalAlignment = VerticalAlignment.Center,
672 HorizontalAlignment = HorizontalAlignment.Center,
673 Size = new Size(0,72),
674 TextColor = new Color("#000C2B"),
675 BackgroundColor = Color.White,
676 ThemeChangeSensitive = false
678 Divider = new ViewStyle()
681 WidthResizePolicy = ResizePolicyType.FillToParent,
682 Position = new Position(0, 132),
683 BackgroundColor = new Color("#0A0E4A"),
685 StartScrollOffset = new Size2D(0, 12),
689 // MenuItem base style
690 theme.AddStyleWithoutClone("Tizen.NUI.Components.MenuItem", new ButtonStyle()
692 Size = new Size(480, -2),
693 MinimumSize = new Size2D(0, 72),
695 BackgroundImage = FrameworkInformation.ResourcePath + "nui_component_menu_item_bg.png",
696 Padding = new Extents(16, 16, 16, 16),
697 Text = new TextLabelStyle()
701 HorizontalAlignment = HorizontalAlignment.Begin,
702 VerticalAlignment = VerticalAlignment.Center,
703 TextColor = new Selector<Color>()
705 Normal = new Color("#001447"),
706 Focused = new Color("#00338B"),
707 Pressed = new Color("#1B69CA"),
708 Disabled = new Color("#C3CAD2"),
709 Selected = new Color("#1B69CA"),
711 ThemeChangeSensitive = false
713 Icon = new ImageViewStyle()
715 Size = new Size(-2, 48),
716 Color = new Selector<Color>()
718 Normal = new Color("#001447"),
719 Focused = new Color("#00338B"),
720 Pressed = new Color("#1B69CA"),
721 Disabled = new Color("#C3CAD2"),
722 Selected = new Color("#1B69CA"),
727 // AlertDialog base style
728 theme.AddStyleWithoutClone("Tizen.NUI.Components.DialogPage.Scrim", new ViewStyle()
730 BackgroundColor = new Color("#090E21"),
739 #endif // !PROFILE_WEARABLE