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),
39 CornerRadiusPolicy = VisualTransformPolicyType.Relative,
40 CornerRadius = 0.2916f,
41 ItemAlignment = LinearLayout.Alignment.Center,
42 BackgroundColor = new Selector<Color>()
44 Normal = new Color(0.039f, 0.055f, 0.29f, 1),
45 Pressed = new Color(0.106f, 0.412f, 0.792f, 1),
46 Focused = new Color(0, 0.2f, 0.545f, 1),
47 Disabled = new Color(0.765f, 0.792f, 0.824f, 1),
49 Text = new TextLabelStyle()
52 TextColor = Color.White,
56 theme.AddStyleWithoutClone("Tizen.NUI.Components.CheckBox", new ButtonStyle()
58 ItemSpacing = new Size2D(32, 32),
59 ItemAlignment = LinearLayout.Alignment.CenterVertical,
60 Icon = new ImageViewStyle()
62 Size = new Size(36, 36),
63 ResourceUrl = new Selector<string>()
65 Normal = FrameworkInformation.ResourcePath + "IoT_check_off.png",
66 Pressed = FrameworkInformation.ResourcePath + "IoT_check_off_p.png",
67 Disabled = FrameworkInformation.ResourcePath + "IoT_check_off_d.png",
68 Focused = FrameworkInformation.ResourcePath + "IoT_check_off_f.png",
69 Selected = FrameworkInformation.ResourcePath + "IoT_check_on.png",
70 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_check_on_p.png",
71 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_check_on_f.png",
72 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_check_on_d.png",
75 Text = new TextLabelStyle()
78 TextColor = new Color("#001447")
82 theme.AddStyleWithoutClone("Tizen.NUI.Components.Popup", new PopupStyle()
84 Size = new Size(500, 280),
85 BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1),
86 ImageShadow = new ImageShadow()
88 Url = FrameworkInformation.ResourcePath + "nui_component_default_popup_shadow.png",
89 Border = new Rectangle(24, 24, 24, 24),
90 Extents = new Vector2(48, 48)
92 Title = new TextLabelStyle()
95 Padding = new Extents(20, 20, 20, 20),
97 Buttons = new ButtonStyle()
99 Size = new Size(0, 80),
100 BackgroundColor = new Selector<Color>()
102 Normal = new Color(1, 1, 1, 1),
103 Pressed = new Color(1, 1, 1, 0.5f),
105 Overlay = new ImageViewStyle()
107 BackgroundColor = new Selector<Color>()
109 Pressed = new Color(0, 0, 0, 0.1f),
110 Other = new Color(1, 1, 1, 0.1f),
113 Text = new TextLabelStyle()
115 TextColor = new Color(0.05f, 0.63f, 0.9f, 1),
120 theme.AddStyleWithoutClone("Tizen.NUI.Components.Progress", new ProgressStyle()
122 Size = new Size(200, 25),
123 Track = new ImageViewStyle()
125 ResourceUrl = FrameworkInformation.ResourcePath + "IoT_progressindicator_empty.png",
126 BackgroundColor = new Color(0, 0, 0, 0.1f),
128 Buffer = new ImageViewStyle()
130 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 0.3f),
132 Progress = new ImageViewStyle()
134 ResourceUrl = new Selector<string>()
136 Normal = FrameworkInformation.ResourcePath + "IoT_progressindicator_progress.png",
137 Disabled = FrameworkInformation.ResourcePath + "IoT_progressindicator_progressdisabled.png",
139 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
141 IndeterminateImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_progress_indeterminate.png",
144 theme.AddStyleWithoutClone("Tizen.NUI.Components.RadioButton", new ButtonStyle()
146 ItemSpacing = new Size2D(32, 32),
147 ItemAlignment = LinearLayout.Alignment.CenterVertical,
148 Icon = new ImageViewStyle()
150 Size = new Size(36, 36),
151 ResourceUrl = new Selector<string>()
153 Normal = FrameworkInformation.ResourcePath + "IoT_radiobutton_off.png",
154 Pressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_p.png",
155 Disabled = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_d.png",
156 Focused = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_f.png",
157 Selected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on.png",
158 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_p.png",
159 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_f.png",
160 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_d.png",
163 Text = new TextLabelStyle()
166 TextColor = new Color("#001447")
170 theme.AddStyleWithoutClone("Tizen.NUI.Components.Slider", new SliderStyle()
172 Size = new Size(200, 50),
174 Track = new ImageViewStyle()
176 Size = new Size(100, 8),
177 ResourceUrl = new Selector<string>()
179 Normal = FrameworkInformation.ResourcePath + "IoT_slider_status_empty_track.png",
180 Disabled = FrameworkInformation.ResourcePath + "IoT_slider_status_track_disabled.png",
182 BackgroundColor = new Color(1.0f, 1.0f, 1.0f, 0.1f),
184 Progress = new ImageViewStyle()
186 Size = new Size(100, 8),
187 ResourceUrl = FrameworkInformation.ResourcePath + "IoT_slider_status_track.png",
188 BackgroundColor = new Color(0.03f, 0.05f, 0.3f, 1),
190 Thumb = new ImageViewStyle()
192 Size = new Size(36, 36),
193 ResourceUrl = FrameworkInformation.ResourcePath + "IoT_slider_handler_normal.png",
194 // TODO : Should check later when UX guide provides the pressed image
195 /*BackgroundImage = new Selector<string>()
197 Normal = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
198 Pressed = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
201 ValueIndicatorImage = new ImageViewStyle()
203 Size = new Size(49, 24),
204 BackgroundColor = new Color(0.0f, 0.04f, 0.16f, 1.0f),
208 theme.AddStyleWithoutClone("Tizen.NUI.Components.Switch", new SwitchStyle()
210 ItemSpacing = new Size2D(32, 32),
211 ItemAlignment = LinearLayout.Alignment.CenterVertical,
212 Track = new ImageViewStyle()
214 Size = new Size(80, 40),
215 ResourceUrl = new Selector<string>()
217 Normal = FrameworkInformation.ResourcePath + "IoT_switch_track_off.png",
218 Pressed = FrameworkInformation.ResourcePath + "IoT_switch_track_off_p.png",
219 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_track_off_d.png",
220 Focused = FrameworkInformation.ResourcePath + "IoT_switch_track_off_f.png",
221 Selected = FrameworkInformation.ResourcePath + "IoT_switch_track_on.png",
222 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_track_on_p.png",
223 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_track_on_f.png",
224 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_switch_track_on_d.png",
227 Thumb = new ImageViewStyle()
229 Size = new Size(40, 40),
230 ResourceUrl = new Selector<string>()
232 Normal = FrameworkInformation.ResourcePath + "IoT_switch_thumb.png",
233 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_thumb_d.png",
234 Selected = FrameworkInformation.ResourcePath + "IoT_switch_thumb_s.png",
235 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sp.png",
236 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sf.png",
239 Text = new TextLabelStyle()
242 TextColor = new Color("#001447")
246 theme.AddStyleWithoutClone("Tizen.NUI.Components.Loading", new LoadingStyle()
248 LoadingSize = new Size(100, 100),
251 theme.AddStyleWithoutClone("Tizen.NUI.Components.Pagination", new PaginationStyle()
253 IndicatorImageUrl = new Selector<string>()
255 Normal = FrameworkInformation.ResourcePath + "nui_component_default_pagination_normal_dot.png",
256 Selected = FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
258 IndicatorSize = new Size(10, 10),
261 theme.AddStyleWithoutClone("Tizen.NUI.Components.Scrollbar", new ScrollbarStyle()
265 TrackColor = new Color(0f, 0f, 0f, 0f),
266 ThumbColor = new Color("#0A0E4AFF"),
268 ThumbVerticalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_vbar.#.png",
269 ThumbHorizontalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_hbar.#.png",
272 theme.AddStyleWithoutClone("Tizen.NUI.Components.LinearLayouter", new ViewStyle()
274 Padding = new Extents(64, 64, 0, 0)
277 theme.AddStyleWithoutClone("Tizen.NUI.Components.GridLayouter", new ViewStyle()
279 Padding = new Extents(0, 0, 0, 0),
282 theme.AddStyleWithoutClone("Tizen.NUI.Components.ItemsLayouter", new ViewStyle()
284 Padding = new Extents(0, 0, 0, 0),
287 theme.AddStyleWithoutClone("Tizen.NUI.Components.RecyclerViewItem", new RecyclerViewItemStyle()
289 BackgroundColor = new Selector<Color>()
291 Normal = new Color(1, 1, 1, 1),
292 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
293 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
294 Selected = new Color(0.701f, 0.898f, 0.937f, 1),
298 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultLinearItem", new DefaultLinearItemStyle()
301 Padding = new Extents(64, 64, 18, 17),
302 Margin = new Extents(0, 0, 0, 0),
303 BackgroundColor = new Selector<Color>()
305 Normal = new Color(1, 1, 1, 1),
306 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
307 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
308 Selected = new Color(0.85f, 0.85f, 0.85f, 1),
310 Label = new TextLabelStyle()
314 FontFamily = "BreezeSans", //FXIME Font Weight is Light
315 TextColor = new Color("#001447FF"),
317 SubLabel = new TextLabelStyle()
321 FontFamily = "BreezeSans",
322 TextColor = new Color("#001447FF"),
324 Icon = new ViewStyle()
326 Margin = new Extents(0, 32, 0, 0)
328 Extra = new ViewStyle()
330 Margin = new Extents(32, 0, 0, 0)
332 Seperator = new ViewStyle()
335 Margin = new Extents(64, 64, 0, 0),
336 BackgroundColor = new Color("#C3CAD2FF"),
339 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultGridItem", new DefaultGridItemStyle()
341 Padding = new Extents(0, 0, 0, 0),
342 Margin = new Extents(5, 5, 5, 5),
343 Caption = new TextLabelStyle()
347 LineWrapMode = LineWrapMode.Character,
349 Badge = new ViewStyle()
351 Margin = new Extents(5, 5, 5, 5),
355 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultTitleItem", new DefaultTitleItemStyle()
358 Padding = new Extents(64, 64, 12, 12),
359 Margin = new Extents(0, 0, 0, 0),
360 BackgroundColor = new Selector<Color>()
362 Normal = new Color("#EEEEF1FF"),
364 Label = new TextLabelStyle()
368 TextColor = new Color("#001447FF"),
370 Icon = new ViewStyle()
372 Margin = new Extents(40, 0, 0, 0)
374 Seperator = new ViewStyle()
376 Margin = new Extents(0, 0, 0, 0),
377 BackgroundColor = new Color(0, 0, 0, 0),
381 theme.AddStyleWithoutClone("Tizen.NUI.Components.AppBar", new AppBarStyle()
383 Size = new Size(-1, 120),
384 BackgroundColor = new Color("#EEEFF1FF"),
385 BackButton = new ButtonStyle()
387 Size = new Size(48, 48),
389 BackgroundColor = new Color(0, 0, 0, 0),
390 Icon = new ImageViewStyle()
392 Size = new Size(48, 48),
393 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_back_button.png",
394 Color = new Selector<Color>()
396 Normal = new Color("#0A0E4AFF"),
397 Focused = new Color("#00338BFF"),
398 Pressed = new Color("#1B69CAFF"),
399 Disabled = new Color("#C3CAD2FF"),
403 TitleTextLabel = new TextLabelStyle()
406 VerticalAlignment = VerticalAlignment.Center,
407 TextColor = new Selector<Color>()
409 Normal = new Color("#000C2BFF"),
412 ActionView = new ViewStyle()
414 Size = new Size(-1, 120),
416 BackgroundColor = new Color(0, 0, 0, 0),
418 ActionButton = new ButtonStyle()
420 Size = new Size(-1, 120),
422 BackgroundColor = new Color(0, 0, 0, 0),
423 Text = new TextLabelStyle()
426 TextColor = new Selector<Color>()
428 Normal = new Color("#0A0E4AFF"),
429 Focused = new Color("#00338BFF"),
430 Pressed = new Color("#1B69CAFF"),
431 Disabled = new Color("#C3CAD2FF"),
434 Icon = new ImageViewStyle()
436 Size = new Size(-1, 48),
437 Color = new Selector<Color>()
439 Normal = new Color("#0A0E4AFF"),
440 Focused = new Color("#00338BFF"),
441 Pressed = new Color("#1B69CAFF"),
442 Disabled = new Color("#C3CAD2FF"),
446 Padding = new Extents(64, 64, 0, 0),
447 NavigationPadding = new Extents(0, 24, 0, 0),
448 ActionPadding = new Extents(40, 0, 0, 0),
449 ActionCellPadding = new Size2D(40, 0),
452 theme.AddStyleWithoutClone("Tizen.NUI.Components.Picker", new PickerStyle()
454 Size = new Size(160, 339),
455 ItemTextLabel = new TextLabelStyle()
457 //FIXME: Should be check PointSize. given size from UX is too large.
459 VerticalAlignment = VerticalAlignment.Center,
460 HorizontalAlignment = HorizontalAlignment.Center,
461 Size = new Size(0,72),
462 TextColor = new Selector<Color>()
464 Normal = new Color("#000C2BFF"),
466 BackgroundColor = Color.White,
468 Divider = new ViewStyle()
471 WidthResizePolicy = ResizePolicyType.FillToParent,
472 Position = new Position(0, 132),
473 BackgroundColor = new Color("#0A0E4AFF"),
475 StartScrollOffset = new Size(0, 12),
478 theme.AddStyleWithoutClone("Tizen.NUI.Components.TabButton", new TabButtonStyle()
480 Size = new Size(-1, 84),
482 BackgroundColor = Color.White,
483 Text = new TextLabelStyle()
486 Size = new Size(-2, -2),
487 TextColor = new Selector<Color>()
489 Normal = new Color("#000C2BFF"),
490 Selected = new Color("#000C2BFF"),
491 Pressed = new Color("#1473E6FF"),
492 Disabled = new Color("#C3CAD2FF"),
495 Icon = new ImageViewStyle()
497 Size = new Size(48, 48),
498 Color = new Selector<Color>()
500 Normal = new Color("#000C2BFF"),
501 Selected = new Color("#000C2BFF"),
502 Pressed = new Color("#1473E6FF"),
503 Disabled = new Color("#C3CAD2FF"),
506 TopLine = new ViewStyle()
508 Size = new Size(-1, 1),
509 BackgroundColor = new Selector<Color>()
511 Normal = new Color("#000C2BFF"),
512 Selected = new Color("#000C2BFF"),
513 Pressed = new Color("#1473E6FF"),
514 Disabled = new Color("#C3CAD2FF"),
517 BottomLine = new ViewStyle()
519 Size = new Size(-1, 8),
520 Position = new Position(0, 76), // 84 - 8
521 BackgroundColor = new Selector<Color>()
523 Normal = Color.Transparent,
524 Selected = new Color("#000C2BFF"),
525 Pressed = new Color("#1473E6FF"),
526 Disabled = Color.Transparent,
531 theme.AddStyleWithoutClone("NotificationToast", new TextLabelStyle()
533 BackgroundImage = FrameworkInformation.ResourcePath + "IoT_Toast_1.png",
534 BackgroundImageBorder = new Rectangle(28, 28, 28, 28),
535 TextColor = new Color("#000C2B"),
537 WidthResizePolicy = ResizePolicyType.UseNaturalSize,
538 HeightResizePolicy = ResizePolicyType.UseNaturalSize,
539 PositionUsesPivotPoint = true,
540 HorizontalAlignment = HorizontalAlignment.Center,
541 VerticalAlignment = VerticalAlignment.Center,
542 Padding = new Extents(40, 40, 24, 24),
546 theme.AddStyleWithoutClone("Tizen.NUI.Components.AlertDialog", new AlertDialogStyle()
548 Size = new Size(-2, -2),
549 Padding = new Extents(80, 80, 0, 0),
550 BackgroundImage = FrameworkInformation.ResourcePath + "nui_component_default_dialog_bg.#.png",
551 TitleTextLabel = new TextLabelStyle()
553 Size = new Size(1024, -2),
554 Margin = new Extents(0, 0, 40, 40),
556 HorizontalAlignment = HorizontalAlignment.Center,
557 VerticalAlignment = VerticalAlignment.Center,
558 TextColor = new Selector<Color>()
560 Normal = new Color("#000C2BFF"),
563 MessageTextLabel = new TextLabelStyle()
565 Size = new Size(1024, -2),
566 Margin = new Extents(0, 0, 0, 64),
569 HorizontalAlignment = HorizontalAlignment.Center,
570 VerticalAlignment = VerticalAlignment.Center,
571 TextColor = new Selector<Color>()
573 Normal = new Color("#000C2BFF"),
576 ActionContent = new ViewStyle()
578 Size = new Size(1024, -2),
582 theme.AddStyleWithoutClone("Tizen.NUI.Components.TimePicker", new TimePickerStyle()
584 CellPadding = new Size(50, 339),
586 Pickers = new PickerStyle()
588 Size = new Size(160, 339),
589 ItemTextLabel = new TextLabelStyle()
591 //FIXME: Should be check PointSize. given size from UX is too large.
593 VerticalAlignment = VerticalAlignment.Center,
594 HorizontalAlignment = HorizontalAlignment.Center,
595 Size = new Size(0,72),
596 TextColor = new Selector<Color>()
598 Normal = new Color("#000C2BFF"),
600 BackgroundColor = Color.White,
602 Divider = new ViewStyle()
605 WidthResizePolicy = ResizePolicyType.FillToParent,
606 Position = new Position(0, 132),
607 BackgroundColor = new Color("#0A0E4AFF"),
609 StartScrollOffset = new Size2D(0, 12),
613 theme.AddStyleWithoutClone("Tizen.NUI.Components.DatePicker", new DatePickerStyle()
615 CellPadding = new Size(50, 339),
617 Pickers = new PickerStyle()
619 Size = new Size(160, 339),
620 ItemTextLabel = new TextLabelStyle()
622 //FIXME: Should be check PointSize. given size from UX is too large.
624 VerticalAlignment = VerticalAlignment.Center,
625 HorizontalAlignment = HorizontalAlignment.Center,
626 Size = new Size(0,72),
627 TextColor = new Selector<Color>()
629 Normal = new Color("#000C2BFF"),
631 BackgroundColor = Color.White,
633 Divider = new ViewStyle()
636 WidthResizePolicy = ResizePolicyType.FillToParent,
637 Position = new Position(0, 132),
638 BackgroundColor = new Color("#0A0E4AFF"),
640 StartScrollOffset = new Size2D(0, 12),
644 theme.AddStyleWithoutClone("Tizen.NUI.Components.AlertDialog", new AlertDialogStyle()
646 Size = new Size(-2, -2),
647 Padding = new Extents(80, 80, 0, 0),
648 BackgroundImage = FrameworkInformation.ResourcePath + "nui_component_default_dialog_bg.#.png",
649 TitleTextLabel = new TextLabelStyle()
651 Size = new Size(1024, -2),
652 Margin = new Extents(0, 0, 40, 40),
654 HorizontalAlignment = HorizontalAlignment.Center,
655 VerticalAlignment = VerticalAlignment.Center,
656 TextColor = new Selector<Color>()
658 Normal = new Color("#000C2BFF"),
661 MessageTextLabel = new TextLabelStyle()
663 Size = new Size(1024, -2),
664 Margin = new Extents(0, 0, 0, 64),
667 HorizontalAlignment = HorizontalAlignment.Center,
668 VerticalAlignment = VerticalAlignment.Center,
669 TextColor = new Selector<Color>()
671 Normal = new Color("#000C2BFF"),
674 ActionContent = new ViewStyle()
676 Size = new Size(1024, -2),
680 theme.AddStyleWithoutClone("Tizen.NUI.Components.MenuItem", new ButtonStyle()
682 Size = new Size(480, -2),
683 MinimumSize = new Size2D(0, 72),
685 BackgroundImage = FrameworkInformation.ResourcePath + "nui_component_menu_item_bg.png",
686 Padding = new Extents(16, 16, 16, 16),
687 Text = new TextLabelStyle()
691 HorizontalAlignment = HorizontalAlignment.Begin,
692 VerticalAlignment = VerticalAlignment.Center,
693 TextColor = new Selector<Color>()
695 Normal = new Color("#001447FF"),
696 Focused = new Color("#00338BFF"),
697 Pressed = new Color("#1B69CAFF"),
698 Disabled = new Color("#C3CAD2FF"),
701 Icon = new ImageViewStyle()
703 Size = new Size(-2, 48),
704 Color = new Selector<Color>()
706 Normal = new Color("#001447FF"),
707 Focused = new Color("#00338BFF"),
708 Pressed = new Color("#1B69CAFF"),
709 Disabled = new Color("#C3CAD2FF"),