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 BorderlineWidth = 0.5f,
187 BorderlineColor = new Color(0.84f, 0.85f, 0.87f, 1.0f),
188 BackgroundColor = new Selector<Color>()
190 Normal = new Color(1.0f, 1.0f, 1.0f, 0.2f),
191 Disabled = new Color(0.76f, 0.79f, 0.82f, 1),
194 Progress = new ImageViewStyle()
196 Size = new Size(100, 8),
197 BackgroundColor = new Selector<Color>()
199 Normal = new Color(0.03f, 0.05f, 0.3f, 1),
200 Disabled = new Color(0.76f, 0.79f, 0.82f, 1),
203 Thumb = new ImageViewStyle()
205 Size = new Size(36, 36),
206 ResourceUrl = new Selector<string>()
208 Normal = FrameworkInformation.ResourcePath + "IoT_slider_handler_normal.png",
209 Pressed = FrameworkInformation.ResourcePath + "IoT_slider_handler_pressed.png",
210 Focused = FrameworkInformation.ResourcePath + "IoT_slider_handler_pressed.png",
211 Disabled = FrameworkInformation.ResourcePath + "IoT_slider_handler_disabled.png",
214 ValueIndicatorImage = new ImageViewStyle()
216 Size = new Size(49, 24),
217 BackgroundColor = new Color(0.0f, 0.04f, 0.16f, 1.0f),
222 theme.AddStyleWithoutClone("Tizen.NUI.Components.Switch", new SwitchStyle()
224 ItemSpacing = new Size2D(32, 32),
225 ItemAlignment = LinearLayout.Alignment.CenterVertical,
226 Track = new ImageViewStyle()
228 Size = new Size(80, 40),
229 ResourceUrl = new Selector<string>()
231 Normal = FrameworkInformation.ResourcePath + "IoT_switch_track_off.png",
232 Pressed = FrameworkInformation.ResourcePath + "IoT_switch_track_off_p.png",
233 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_track_off_d.png",
234 Focused = FrameworkInformation.ResourcePath + "IoT_switch_track_off_f.png",
235 Selected = FrameworkInformation.ResourcePath + "IoT_switch_track_on.png",
236 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_track_on_p.png",
237 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_track_on_f.png",
238 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_switch_track_on_d.png",
241 Thumb = new ImageViewStyle()
243 Size = new Size(40, 40),
244 ResourceUrl = new Selector<string>()
246 Normal = FrameworkInformation.ResourcePath + "IoT_switch_thumb.png",
247 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_thumb_d.png",
248 Selected = FrameworkInformation.ResourcePath + "IoT_switch_thumb_s.png",
249 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sp.png",
250 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sf.png",
253 Text = new TextLabelStyle()
255 TextColor = new Color("#001447"),
260 // Loading base style
261 theme.AddStyleWithoutClone("Tizen.NUI.Components.Loading", new LoadingStyle()
263 LoadingSize = new Size(100, 100),
266 // Pagination base style
267 theme.AddStyleWithoutClone("Tizen.NUI.Components.Pagination", new PaginationStyle()
269 IndicatorImageUrl = new Selector<string>()
271 Normal = FrameworkInformation.ResourcePath + "nui_component_default_pagination_normal_dot.png",
272 Selected = FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
274 IndicatorSize = new Size(10, 10),
277 // Scrollbar base style
278 theme.AddStyleWithoutClone("Tizen.NUI.Components.Scrollbar", new ScrollbarStyle()
282 TrackColor = new Color(0f, 0f, 0f, 0f),
283 ThumbColor = new Color("#0A0E4A"),
285 ThumbVerticalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_vbar.#.png",
286 ThumbHorizontalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_hbar.#.png",
289 // LinearLayouter base style
290 theme.AddStyleWithoutClone("Tizen.NUI.Components.LinearLayouter", new ViewStyle()
292 Padding = new Extents(64, 64, 0, 0)
295 // GridLayouter base style
296 theme.AddStyleWithoutClone("Tizen.NUI.Components.GridLayouter", new ViewStyle()
298 Padding = new Extents(0, 0, 0, 0),
301 // ItemsLayouter base style
302 theme.AddStyleWithoutClone("Tizen.NUI.Components.ItemsLayouter", new ViewStyle()
304 Padding = new Extents(0, 0, 0, 0),
307 // RecyclerViewItem base style
308 theme.AddStyleWithoutClone("Tizen.NUI.Components.RecyclerViewItem", new RecyclerViewItemStyle()
310 BackgroundColor = new Selector<Color>()
312 Normal = new Color(1, 1, 1, 1),
313 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
314 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
315 Selected = new Color(0.701f, 0.898f, 0.937f, 1),
319 // DefaultLinearItem base style
320 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultLinearItem", new DefaultLinearItemStyle()
323 Padding = new Extents(64, 64, 18, 17),
324 Margin = new Extents(0, 0, 0, 0),
325 BackgroundColor = new Selector<Color>()
327 Normal = new Color(1, 1, 1, 1),
328 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
329 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
330 Selected = new Color(0.85f, 0.85f, 0.85f, 1),
332 Label = new TextLabelStyle()
336 FontFamily = "BreezeSans", //FXIME Font Weight is Light
337 TextColor = new Color("#001447"),
338 ThemeChangeSensitive = false
340 SubLabel = new TextLabelStyle()
344 FontFamily = "BreezeSans",
345 TextColor = new Color("#001447"),
346 ThemeChangeSensitive = false
348 Icon = new ViewStyle()
350 Margin = new Extents(0, 32, 0, 0)
352 Extra = new ViewStyle()
354 Margin = new Extents(32, 0, 0, 0)
356 Seperator = new ViewStyle()
359 Margin = new Extents(64, 64, 0, 0),
360 BackgroundColor = new Color("#C3CAD2"),
364 // DefaultGridItem base style
365 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultGridItem", new DefaultGridItemStyle()
367 Padding = new Extents(0, 0, 0, 0),
368 Margin = new Extents(5, 5, 5, 5),
369 Label = new TextLabelStyle()
373 LineWrapMode = LineWrapMode.Character,
374 ThemeChangeSensitive = false
376 Badge = new ViewStyle()
378 Margin = new Extents(5, 5, 5, 5),
382 // DefaultTitleItem base style
383 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultTitleItem", new DefaultTitleItemStyle()
386 Padding = new Extents(64, 64, 12, 12),
387 Margin = new Extents(0, 0, 0, 0),
388 BackgroundColor = new Selector<Color>()
390 Normal = new Color("#EEEEF1"),
392 Label = new TextLabelStyle()
396 TextColor = new Color("#001447"),
397 ThemeChangeSensitive = false
399 Icon = new ViewStyle()
401 Margin = new Extents(40, 0, 0, 0)
403 Seperator = new ViewStyle()
405 Margin = new Extents(0, 0, 0, 0),
406 BackgroundColor = new Color(0, 0, 0, 0),
410 // ContentPage base style
411 theme.AddStyleWithoutClone("Tizen.NUI.Components.ContentPage", new ViewStyle()
413 BackgroundColor = new Color("#EEEFF1"),
417 theme.AddStyleWithoutClone("Tizen.NUI.Components.AppBar", new AppBarStyle()
419 Size = new Size(-1, 120),
420 BackgroundColor = new Color("#EEEFF1"),
421 BackButton = new ButtonStyle()
423 Size = new Size(48, 48),
425 BackgroundColor = new Color(0, 0, 0, 0),
426 Icon = new ImageViewStyle()
428 Size = new Size(48, 48),
429 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_back_button.png",
430 Color = new Selector<Color>()
432 Normal = new Color("#0A0E4A"),
433 Focused = new Color("#00338B"),
434 Pressed = new Color("#1B69CA"),
435 Disabled = new Color("#C3CAD2"),
438 ThemeChangeSensitive = false
440 TitleTextLabel = new TextLabelStyle()
443 VerticalAlignment = VerticalAlignment.Center,
444 TextColor = new Selector<Color>()
446 Normal = new Color("#000C2B"),
448 ThemeChangeSensitive = false
450 ActionView = new ViewStyle()
452 Size = new Size(-1, 120),
454 BackgroundColor = new Color(0, 0, 0, 0),
456 ActionButton = new ButtonStyle()
458 Size = new Size(-1, 120),
460 BackgroundColor = new Color(0, 0, 0, 0),
461 Text = new TextLabelStyle()
464 TextColor = new Selector<Color>()
466 Normal = new Color("#0A0E4A"),
467 Focused = new Color("#00338B"),
468 Pressed = new Color("#1B69CA"),
469 Disabled = new Color("#C3CAD2"),
472 Icon = new ImageViewStyle()
474 Size = new Size(-1, 48),
475 Color = new Selector<Color>()
477 Normal = new Color("#0A0E4A"),
478 Focused = new Color("#00338B"),
479 Pressed = new Color("#1B69CA"),
480 Disabled = new Color("#C3CAD2"),
483 ThemeChangeSensitive = false,
485 Padding = new Extents(64, 64, 0, 0),
486 NavigationPadding = new Extents(0, 24, 0, 0),
487 ActionPadding = new Extents(40, 0, 0, 0),
488 ActionCellPadding = new Size2D(40, 0),
492 theme.AddStyleWithoutClone("Tizen.NUI.Components.Picker", new PickerStyle()
494 Size = new Size(160, 339),
495 ItemTextLabel = new TextLabelStyle()
497 //FIXME: Should be check PointSize. given size from UX is too large.
499 VerticalAlignment = VerticalAlignment.Center,
500 HorizontalAlignment = HorizontalAlignment.Center,
501 Size = new Size(0,72),
502 TextColor = new Selector<Color>()
504 Normal = new Color("#000C2B"),
506 BackgroundColor = Color.White,
508 Divider = new ViewStyle()
511 WidthResizePolicy = ResizePolicyType.FillToParent,
512 Position = new Position(0, 132),
513 BackgroundColor = new Color("#0A0E4A"),
515 StartScrollOffset = new Size(0, 12),
518 // TabButton base style
519 theme.AddStyleWithoutClone("Tizen.NUI.Components.TabButton", new TabButtonStyle()
521 Size = new Size(-1, 84),
523 BackgroundColor = Color.White,
524 Text = new TextLabelStyle()
527 Size = new Size(-2, -2),
528 TextColor = new Selector<Color>()
530 Normal = new Color("#000C2B"),
531 Selected = new Color("#000C2B"),
532 Pressed = new Color("#1473E6"),
533 Disabled = new Color("#C3CAD2"),
535 ThemeChangeSensitive = false,
537 Icon = new ImageViewStyle()
539 Size = new Size(48, 48),
540 Color = new Selector<Color>()
542 Normal = new Color("#000C2B"),
543 Selected = new Color("#000C2B"),
544 Pressed = new Color("#1473E6"),
545 Disabled = new Color("#C3CAD2"),
548 TopLine = new ViewStyle()
550 Size = new Size(-1, 1),
551 BackgroundColor = new Selector<Color>()
553 Normal = new Color("#000C2B"),
554 Selected = new Color("#000C2B"),
555 Pressed = new Color("#1473E6"),
556 Disabled = new Color("#C3CAD2"),
559 BottomLine = new ViewStyle()
561 Size = new Size(-1, 8),
562 Position = new Position(0, 76), // 84 - 8
563 BackgroundColor = new Selector<Color>()
565 Normal = Color.Transparent,
566 Selected = new Color("#000C2B"),
567 Pressed = new Color("#1473E6"),
568 Disabled = Color.Transparent,
573 // NotificationToast base style
574 theme.AddStyleWithoutClone("NotificationToast", new TextLabelStyle()
576 BackgroundColor = new Color("#F2F7FF"),
577 CornerRadius = 20.0f,
578 BoxShadow = new Shadow(5.0f, new Color("#00000066"), new Vector2(2.0f, 2.0f)),
579 TextColor = new Color("#000C2B"),
581 WidthResizePolicy = ResizePolicyType.UseNaturalSize,
582 HeightResizePolicy = ResizePolicyType.UseNaturalSize,
583 PositionUsesPivotPoint = true,
584 HorizontalAlignment = HorizontalAlignment.Center,
585 VerticalAlignment = VerticalAlignment.Center,
586 Padding = new Extents(40, 40, 24, 24),
590 // AlertDialog base style
591 theme.AddStyleWithoutClone("Tizen.NUI.Components.AlertDialog", new AlertDialogStyle()
593 Size = new Size(-2, -2),
594 Padding = new Extents(80, 80, 0, 0),
595 BackgroundColor = Color.White,
596 CornerRadius = 28.0f,
597 BoxShadow = new Shadow(2.0f, new Color("#00000029"), new Vector2(2.0f, 2.0f)),
598 TitleTextLabel = new TextLabelStyle()
600 Size = new Size(720, -2),
601 Margin = new Extents(0, 0, 40, 40),
603 HorizontalAlignment = HorizontalAlignment.Center,
604 VerticalAlignment = VerticalAlignment.Center,
605 TextColor = new Color("#000C2B"),
606 ThemeChangeSensitive = false,
608 MessageTextLabel = new TextLabelStyle()
610 Size = new Size(720, -2),
611 Margin = new Extents(0, 0, 0, 64),
614 HorizontalAlignment = HorizontalAlignment.Center,
615 VerticalAlignment = VerticalAlignment.Center,
616 TextColor = new Color("#000C2B"),
617 ThemeChangeSensitive = false,
619 ActionContent = new ViewStyle()
621 Size = new Size(720, -2),
625 // TimePicker base style
626 theme.AddStyleWithoutClone("Tizen.NUI.Components.TimePicker", new TimePickerStyle()
628 CellPadding = new Size(50, 339),
630 Pickers = new PickerStyle()
632 Size = new Size(160, 339),
633 ItemTextLabel = new TextLabelStyle()
635 //FIXME: Should be check PointSize. given size from UX is too large.
637 VerticalAlignment = VerticalAlignment.Center,
638 HorizontalAlignment = HorizontalAlignment.Center,
639 Size = new Size(0,72),
640 TextColor = new Color("#000C2B"),
641 BackgroundColor = Color.White,
642 ThemeChangeSensitive = false
644 Divider = new ViewStyle()
647 WidthResizePolicy = ResizePolicyType.FillToParent,
648 Position = new Position(0, 132),
649 BackgroundColor = new Color("#0A0E4A"),
651 StartScrollOffset = new Size2D(0, 12),
655 // DatePicker base style
656 theme.AddStyleWithoutClone("Tizen.NUI.Components.DatePicker", new DatePickerStyle()
658 CellPadding = new Size(50, 339),
660 Pickers = new PickerStyle()
662 Size = new Size(160, 339),
663 ItemTextLabel = new TextLabelStyle()
665 //FIXME: Should be check PointSize. given size from UX is too large.
667 VerticalAlignment = VerticalAlignment.Center,
668 HorizontalAlignment = HorizontalAlignment.Center,
669 Size = new Size(0,72),
670 TextColor = new Color("#000C2B"),
671 BackgroundColor = Color.White,
672 ThemeChangeSensitive = false
674 Divider = new ViewStyle()
677 WidthResizePolicy = ResizePolicyType.FillToParent,
678 Position = new Position(0, 132),
679 BackgroundColor = new Color("#0A0E4A"),
681 StartScrollOffset = new Size2D(0, 12),
686 theme.AddStyleWithoutClone("Tizen.NUI.Components.Menu", new ViewStyle()
688 BackgroundColor = new Color("#EEEFF1"),
691 // MenuItem base style
692 theme.AddStyleWithoutClone("Tizen.NUI.Components.MenuItem", new ButtonStyle()
694 Size = new Size(480, -2),
695 MinimumSize = new Size2D(0, 72),
697 BackgroundImage = FrameworkInformation.ResourcePath + "nui_component_menu_item_bg.png",
698 Padding = new Extents(16, 16, 16, 16),
699 Text = new TextLabelStyle()
703 HorizontalAlignment = HorizontalAlignment.Begin,
704 VerticalAlignment = VerticalAlignment.Center,
705 TextColor = new Selector<Color>()
707 Normal = new Color("#001447"),
708 Focused = new Color("#00338B"),
709 Pressed = new Color("#1B69CA"),
710 Disabled = new Color("#C3CAD2"),
712 ThemeChangeSensitive = false
714 Icon = new ImageViewStyle()
716 Size = new Size(-2, 48),
717 Color = new Selector<Color>()
719 Normal = new Color("#001447"),
720 Focused = new Color("#00338B"),
721 Pressed = new Color("#1B69CA"),
722 Disabled = new Color("#C3CAD2"),
732 #endif // !PROFILE_WEARABLE