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,
58 // CheckBox base style
59 theme.AddStyleWithoutClone("Tizen.NUI.Components.CheckBox", new ButtonStyle()
61 ItemSpacing = new Size2D(32, 32),
62 ItemAlignment = LinearLayout.Alignment.CenterVertical,
63 Icon = new ImageViewStyle()
65 Size = new Size(36, 36),
66 ResourceUrl = new Selector<string>()
68 Normal = FrameworkInformation.ResourcePath + "IoT_check_off.png",
69 Pressed = FrameworkInformation.ResourcePath + "IoT_check_off_p.png",
70 Disabled = FrameworkInformation.ResourcePath + "IoT_check_off_d.png",
71 Focused = FrameworkInformation.ResourcePath + "IoT_check_off_f.png",
72 Selected = FrameworkInformation.ResourcePath + "IoT_check_on.png",
73 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_check_on_p.png",
74 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_check_on_f.png",
75 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_check_on_d.png",
78 Text = new TextLabelStyle()
80 TextColor = new Color("#001447")
85 theme.AddStyleWithoutClone("Tizen.NUI.Components.Popup", new PopupStyle()
87 Size = new Size(500, 280),
88 BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1),
89 ImageShadow = new ImageShadow()
91 Url = FrameworkInformation.ResourcePath + "nui_component_default_popup_shadow.png",
92 Border = new Rectangle(24, 24, 24, 24),
93 Extents = new Vector2(48, 48)
95 Title = new TextLabelStyle()
98 Padding = new Extents(20, 20, 20, 20),
100 Buttons = new ButtonStyle()
102 Size = new Size(0, 80),
104 BackgroundColor = new Selector<Color>()
106 Normal = new Color(1, 1, 1, 1),
107 Pressed = new Color(1, 1, 1, 0.5f),
109 Overlay = new ImageViewStyle()
111 BackgroundColor = new Selector<Color>()
113 Pressed = new Color(0, 0, 0, 0.1f),
114 Other = new Color(1, 1, 1, 0.1f),
117 Text = new TextLabelStyle()
119 TextColor = new Color(0.05f, 0.63f, 0.9f, 1),
124 // Progress base style
125 theme.AddStyleWithoutClone("Tizen.NUI.Components.Progress", new ProgressStyle()
127 Size = new Size(200, 25),
128 Track = new ImageViewStyle()
130 ResourceUrl = FrameworkInformation.ResourcePath + "IoT_progressindicator_empty.png",
131 BackgroundColor = new Color(0, 0, 0, 0.1f),
133 Buffer = new ImageViewStyle()
135 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 0.3f),
137 Progress = new ImageViewStyle()
139 ResourceUrl = new Selector<string>()
141 Normal = FrameworkInformation.ResourcePath + "IoT_progressindicator_progress.png",
142 Disabled = FrameworkInformation.ResourcePath + "IoT_progressindicator_progressdisabled.png",
144 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
146 IndeterminateImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_progress_indeterminate.png",
149 // RadioButton base style
150 theme.AddStyleWithoutClone("Tizen.NUI.Components.RadioButton", new ButtonStyle()
152 ItemSpacing = new Size2D(32, 32),
153 ItemAlignment = LinearLayout.Alignment.CenterVertical,
154 Icon = new ImageViewStyle()
156 Size = new Size(36, 36),
157 ResourceUrl = new Selector<string>()
159 Normal = FrameworkInformation.ResourcePath + "IoT_radiobutton_off.png",
160 Pressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_p.png",
161 Disabled = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_d.png",
162 Focused = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_f.png",
163 Selected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on.png",
164 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_p.png",
165 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_f.png",
166 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_d.png",
169 Text = new TextLabelStyle()
171 TextColor = new Color("#001447")
176 theme.AddStyleWithoutClone("Tizen.NUI.Components.Slider", new SliderStyle()
178 Size = new Size(200, 50),
180 Track = new ImageViewStyle()
182 Size = new Size(100, 8),
183 ResourceUrl = new Selector<string>()
185 Normal = FrameworkInformation.ResourcePath + "IoT_slider_status_empty_track.png",
186 Disabled = FrameworkInformation.ResourcePath + "IoT_slider_status_track_disabled.png",
188 BackgroundColor = new Color(1.0f, 1.0f, 1.0f, 0.1f),
190 Progress = new ImageViewStyle()
192 Size = new Size(100, 8),
193 ResourceUrl = FrameworkInformation.ResourcePath + "IoT_slider_status_track.png",
194 BackgroundColor = new Color(0.03f, 0.05f, 0.3f, 1),
196 Thumb = new ImageViewStyle()
198 Size = new Size(36, 36),
199 ResourceUrl = FrameworkInformation.ResourcePath + "IoT_slider_handler_normal.png",
200 // TODO : Should check later when UX guide provides the pressed image
201 /*BackgroundImage = new Selector<string>()
203 Normal = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
204 Pressed = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
207 ValueIndicatorImage = new ImageViewStyle()
209 Size = new Size(49, 24),
210 BackgroundColor = new Color(0.0f, 0.04f, 0.16f, 1.0f),
215 theme.AddStyleWithoutClone("Tizen.NUI.Components.Switch", new SwitchStyle()
217 ItemSpacing = new Size2D(32, 32),
218 ItemAlignment = LinearLayout.Alignment.CenterVertical,
219 Track = new ImageViewStyle()
221 Size = new Size(80, 40),
222 ResourceUrl = new Selector<string>()
224 Normal = FrameworkInformation.ResourcePath + "IoT_switch_track_off.png",
225 Pressed = FrameworkInformation.ResourcePath + "IoT_switch_track_off_p.png",
226 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_track_off_d.png",
227 Focused = FrameworkInformation.ResourcePath + "IoT_switch_track_off_f.png",
228 Selected = FrameworkInformation.ResourcePath + "IoT_switch_track_on.png",
229 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_track_on_p.png",
230 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_track_on_f.png",
231 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_switch_track_on_d.png",
234 Thumb = new ImageViewStyle()
236 Size = new Size(40, 40),
237 ResourceUrl = new Selector<string>()
239 Normal = FrameworkInformation.ResourcePath + "IoT_switch_thumb.png",
240 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_thumb_d.png",
241 Selected = FrameworkInformation.ResourcePath + "IoT_switch_thumb_s.png",
242 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sp.png",
243 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sf.png",
246 Text = new TextLabelStyle()
248 TextColor = new Color("#001447")
252 // Loading base style
253 theme.AddStyleWithoutClone("Tizen.NUI.Components.Loading", new LoadingStyle()
255 LoadingSize = new Size(100, 100),
258 // Pagination base style
259 theme.AddStyleWithoutClone("Tizen.NUI.Components.Pagination", new PaginationStyle()
261 IndicatorImageUrl = new Selector<string>()
263 Normal = FrameworkInformation.ResourcePath + "nui_component_default_pagination_normal_dot.png",
264 Selected = FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
266 IndicatorSize = new Size(10, 10),
269 // Scrollbar base style
270 theme.AddStyleWithoutClone("Tizen.NUI.Components.Scrollbar", new ScrollbarStyle()
274 TrackColor = new Color(0f, 0f, 0f, 0f),
275 ThumbColor = new Color("#0A0E4A"),
277 ThumbVerticalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_vbar.#.png",
278 ThumbHorizontalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_hbar.#.png",
281 // LinearLayouter base style
282 theme.AddStyleWithoutClone("Tizen.NUI.Components.LinearLayouter", new ViewStyle()
284 Padding = new Extents(64, 64, 0, 0)
287 // GridLayouter base style
288 theme.AddStyleWithoutClone("Tizen.NUI.Components.GridLayouter", new ViewStyle()
290 Padding = new Extents(0, 0, 0, 0),
293 // ItemsLayouter base style
294 theme.AddStyleWithoutClone("Tizen.NUI.Components.ItemsLayouter", new ViewStyle()
296 Padding = new Extents(0, 0, 0, 0),
299 // RecyclerViewItem base style
300 theme.AddStyleWithoutClone("Tizen.NUI.Components.RecyclerViewItem", new RecyclerViewItemStyle()
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.701f, 0.898f, 0.937f, 1),
311 // DefaultLinearItem base style
312 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultLinearItem", new DefaultLinearItemStyle()
315 Padding = new Extents(64, 64, 18, 17),
316 Margin = new Extents(0, 0, 0, 0),
317 BackgroundColor = new Selector<Color>()
319 Normal = new Color(1, 1, 1, 1),
320 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
321 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
322 Selected = new Color(0.85f, 0.85f, 0.85f, 1),
324 Label = new TextLabelStyle()
328 FontFamily = "BreezeSans", //FXIME Font Weight is Light
329 TextColor = new Color("#001447"),
330 ThemeChangeSensitive = false
332 SubLabel = new TextLabelStyle()
336 FontFamily = "BreezeSans",
337 TextColor = new Color("#001447"),
338 ThemeChangeSensitive = false
340 Icon = new ViewStyle()
342 Margin = new Extents(0, 32, 0, 0)
344 Extra = new ViewStyle()
346 Margin = new Extents(32, 0, 0, 0)
348 Seperator = new ViewStyle()
351 Margin = new Extents(64, 64, 0, 0),
352 BackgroundColor = new Color("#C3CAD2"),
356 // DefaultGridItem base style
357 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultGridItem", new DefaultGridItemStyle()
359 Padding = new Extents(0, 0, 0, 0),
360 Margin = new Extents(5, 5, 5, 5),
361 Label = new TextLabelStyle()
365 LineWrapMode = LineWrapMode.Character,
366 ThemeChangeSensitive = false
368 Badge = new ViewStyle()
370 Margin = new Extents(5, 5, 5, 5),
374 // DefaultTitleItem base style
375 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultTitleItem", new DefaultTitleItemStyle()
378 Padding = new Extents(64, 64, 12, 12),
379 Margin = new Extents(0, 0, 0, 0),
380 BackgroundColor = new Selector<Color>()
382 Normal = new Color("#EEEEF1"),
384 Label = new TextLabelStyle()
388 TextColor = new Color("#001447"),
389 ThemeChangeSensitive = false
391 Icon = new ViewStyle()
393 Margin = new Extents(40, 0, 0, 0)
395 Seperator = new ViewStyle()
397 Margin = new Extents(0, 0, 0, 0),
398 BackgroundColor = new Color(0, 0, 0, 0),
402 // ContentPage base style
403 theme.AddStyleWithoutClone("Tizen.NUI.Components.ContentPage", new ViewStyle()
405 BackgroundColor = new Color("#EEEFF1"),
409 theme.AddStyleWithoutClone("Tizen.NUI.Components.AppBar", new AppBarStyle()
411 Size = new Size(-1, 120),
412 BackgroundColor = new Color("#EEEFF1"),
413 BackButton = new ButtonStyle()
415 Size = new Size(48, 48),
417 BackgroundColor = new Color(0, 0, 0, 0),
418 Icon = new ImageViewStyle()
420 Size = new Size(48, 48),
421 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_back_button.png",
422 Color = new Selector<Color>()
424 Normal = new Color("#0A0E4A"),
425 Focused = new Color("#00338B"),
426 Pressed = new Color("#1B69CA"),
427 Disabled = new Color("#C3CAD2"),
430 ThemeChangeSensitive = false
432 TitleTextLabel = new TextLabelStyle()
435 VerticalAlignment = VerticalAlignment.Center,
436 TextColor = new Selector<Color>()
438 Normal = new Color("#000C2B"),
440 ThemeChangeSensitive = false
442 ActionView = new ViewStyle()
444 Size = new Size(-1, 120),
446 BackgroundColor = new Color(0, 0, 0, 0),
448 ActionButton = new ButtonStyle()
450 Size = new Size(-1, 120),
452 BackgroundColor = new Color(0, 0, 0, 0),
453 Text = new TextLabelStyle()
456 TextColor = new Selector<Color>()
458 Normal = new Color("#0A0E4A"),
459 Focused = new Color("#00338B"),
460 Pressed = new Color("#1B69CA"),
461 Disabled = new Color("#C3CAD2"),
464 Icon = new ImageViewStyle()
466 Size = new Size(-1, 48),
467 Color = new Selector<Color>()
469 Normal = new Color("#0A0E4A"),
470 Focused = new Color("#00338B"),
471 Pressed = new Color("#1B69CA"),
472 Disabled = new Color("#C3CAD2"),
475 ThemeChangeSensitive = false,
477 Padding = new Extents(64, 64, 0, 0),
478 NavigationPadding = new Extents(0, 24, 0, 0),
479 ActionPadding = new Extents(40, 0, 0, 0),
480 ActionCellPadding = new Size2D(40, 0),
484 theme.AddStyleWithoutClone("Tizen.NUI.Components.Picker", new PickerStyle()
486 Size = new Size(160, 339),
487 ItemTextLabel = new TextLabelStyle()
489 //FIXME: Should be check PointSize. given size from UX is too large.
491 VerticalAlignment = VerticalAlignment.Center,
492 HorizontalAlignment = HorizontalAlignment.Center,
493 Size = new Size(0,72),
494 TextColor = new Selector<Color>()
496 Normal = new Color("#000C2B"),
498 BackgroundColor = Color.White,
500 Divider = new ViewStyle()
503 WidthResizePolicy = ResizePolicyType.FillToParent,
504 Position = new Position(0, 132),
505 BackgroundColor = new Color("#0A0E4A"),
507 StartScrollOffset = new Size(0, 12),
510 // TabButton base style
511 theme.AddStyleWithoutClone("Tizen.NUI.Components.TabButton", new TabButtonStyle()
513 Size = new Size(-1, 84),
515 BackgroundColor = Color.White,
516 Text = new TextLabelStyle()
519 Size = new Size(-2, -2),
520 TextColor = new Selector<Color>()
522 Normal = new Color("#000C2B"),
523 Selected = new Color("#000C2B"),
524 Pressed = new Color("#1473E6"),
525 Disabled = new Color("#C3CAD2"),
527 ThemeChangeSensitive = false,
529 Icon = new ImageViewStyle()
531 Size = new Size(48, 48),
532 Color = new Selector<Color>()
534 Normal = new Color("#000C2B"),
535 Selected = new Color("#000C2B"),
536 Pressed = new Color("#1473E6"),
537 Disabled = new Color("#C3CAD2"),
540 TopLine = new ViewStyle()
542 Size = new Size(-1, 1),
543 BackgroundColor = new Selector<Color>()
545 Normal = new Color("#000C2B"),
546 Selected = new Color("#000C2B"),
547 Pressed = new Color("#1473E6"),
548 Disabled = new Color("#C3CAD2"),
551 BottomLine = new ViewStyle()
553 Size = new Size(-1, 8),
554 Position = new Position(0, 76), // 84 - 8
555 BackgroundColor = new Selector<Color>()
557 Normal = Color.Transparent,
558 Selected = new Color("#000C2B"),
559 Pressed = new Color("#1473E6"),
560 Disabled = Color.Transparent,
565 // NotificationToast base style
566 theme.AddStyleWithoutClone("NotificationToast", new TextLabelStyle()
568 BackgroundColor = new Color("#F2F7FF"),
569 CornerRadius = 20.0f,
570 BoxShadow = new Shadow(5.0f, new Color("#00000066"), new Vector2(2.0f, 2.0f)),
571 TextColor = new Color("#000C2B"),
573 WidthResizePolicy = ResizePolicyType.UseNaturalSize,
574 HeightResizePolicy = ResizePolicyType.UseNaturalSize,
575 PositionUsesPivotPoint = true,
576 HorizontalAlignment = HorizontalAlignment.Center,
577 VerticalAlignment = VerticalAlignment.Center,
578 Padding = new Extents(40, 40, 24, 24),
582 // AlertDialog base style
583 theme.AddStyleWithoutClone("Tizen.NUI.Components.AlertDialog", new AlertDialogStyle()
585 Size = new Size(-2, -2),
586 Padding = new Extents(80, 80, 0, 0),
587 BackgroundColor = Color.White,
588 CornerRadius = 28.0f,
589 BoxShadow = new Shadow(2.0f, new Color("#00000029"), new Vector2(2.0f, 2.0f)),
590 TitleTextLabel = new TextLabelStyle()
592 Size = new Size(600, -2),
593 Margin = new Extents(0, 0, 40, 40),
595 HorizontalAlignment = HorizontalAlignment.Center,
596 VerticalAlignment = VerticalAlignment.Center,
597 TextColor = new Color("#000C2B"),
598 ThemeChangeSensitive = false,
600 MessageTextLabel = new TextLabelStyle()
602 Size = new Size(600, -2),
603 Margin = new Extents(0, 0, 0, 64),
606 HorizontalAlignment = HorizontalAlignment.Center,
607 VerticalAlignment = VerticalAlignment.Center,
608 TextColor = new Color("#000C2B"),
609 ThemeChangeSensitive = false,
611 ActionContent = new ViewStyle()
613 Size = new Size(600, -2),
617 // TimePicker base style
618 theme.AddStyleWithoutClone("Tizen.NUI.Components.TimePicker", new TimePickerStyle()
620 CellPadding = new Size(50, 339),
622 Pickers = new PickerStyle()
624 Size = new Size(160, 339),
625 ItemTextLabel = new TextLabelStyle()
627 //FIXME: Should be check PointSize. given size from UX is too large.
629 VerticalAlignment = VerticalAlignment.Center,
630 HorizontalAlignment = HorizontalAlignment.Center,
631 Size = new Size(0,72),
632 TextColor = new Color("#000C2B"),
633 BackgroundColor = Color.White,
634 ThemeChangeSensitive = false
636 Divider = new ViewStyle()
639 WidthResizePolicy = ResizePolicyType.FillToParent,
640 Position = new Position(0, 132),
641 BackgroundColor = new Color("#0A0E4A"),
643 StartScrollOffset = new Size2D(0, 12),
647 // DatePicker base style
648 theme.AddStyleWithoutClone("Tizen.NUI.Components.DatePicker", new DatePickerStyle()
650 CellPadding = new Size(50, 339),
652 Pickers = new PickerStyle()
654 Size = new Size(160, 339),
655 ItemTextLabel = new TextLabelStyle()
657 //FIXME: Should be check PointSize. given size from UX is too large.
659 VerticalAlignment = VerticalAlignment.Center,
660 HorizontalAlignment = HorizontalAlignment.Center,
661 Size = new Size(0,72),
662 TextColor = new Color("#000C2B"),
663 BackgroundColor = Color.White,
664 ThemeChangeSensitive = false
666 Divider = new ViewStyle()
669 WidthResizePolicy = ResizePolicyType.FillToParent,
670 Position = new Position(0, 132),
671 BackgroundColor = new Color("#0A0E4A"),
673 StartScrollOffset = new Size2D(0, 12),
677 // MenuItem base style
678 theme.AddStyleWithoutClone("Tizen.NUI.Components.MenuItem", new ButtonStyle()
680 Size = new Size(480, -2),
681 MinimumSize = new Size2D(0, 72),
683 BackgroundImage = FrameworkInformation.ResourcePath + "nui_component_menu_item_bg.png",
684 Padding = new Extents(16, 16, 16, 16),
685 Text = new TextLabelStyle()
689 HorizontalAlignment = HorizontalAlignment.Begin,
690 VerticalAlignment = VerticalAlignment.Center,
691 TextColor = new Selector<Color>()
693 Normal = new Color("#001447"),
694 Focused = new Color("#00338B"),
695 Pressed = new Color("#1B69CA"),
696 Disabled = new Color("#C3CAD2"),
698 ThemeChangeSensitive = false
700 Icon = new ImageViewStyle()
702 Size = new Size(-2, 48),
703 Color = new Selector<Color>()
705 Normal = new Color("#001447"),
706 Focused = new Color("#00338B"),
707 Pressed = new Color("#1B69CA"),
708 Disabled = new Color("#C3CAD2"),
718 #endif // !PROFILE_WEARABLE