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, 5),
123 Track = new ImageViewStyle()
125 BackgroundColor = new Color(0, 0, 0, 0.1f),
127 Buffer = new ImageViewStyle()
129 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 0.3f),
131 Progress = new ImageViewStyle()
133 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
135 IndeterminateImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_progress_indeterminate.png",
138 theme.AddStyleWithoutClone("Tizen.NUI.Components.RadioButton", new ButtonStyle()
140 ItemSpacing = new Size2D(32, 32),
141 ItemAlignment = LinearLayout.Alignment.CenterVertical,
142 Icon = new ImageViewStyle()
144 Size = new Size(36, 36),
145 ResourceUrl = new Selector<string>()
147 Normal = FrameworkInformation.ResourcePath + "IoT_radiobutton_off.png",
148 Pressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_p.png",
149 Disabled = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_d.png",
150 Focused = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_f.png",
151 Selected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on.png",
152 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_p.png",
153 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_f.png",
154 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_d.png",
157 Text = new TextLabelStyle()
160 TextColor = new Color("#001447")
164 theme.AddStyleWithoutClone("Tizen.NUI.Components.Slider", new SliderStyle()
166 Size = new Size(200, 50),
168 Track = new ImageViewStyle()
170 BackgroundColor = new Color(0, 0, 0, 0.1f),
172 Progress = new ImageViewStyle()
174 BackgroundColor = new Color(0.5f, 0.63f, 0.9f, 1),
176 Thumb = new ImageViewStyle()
178 Size = new Size(50, 50),
179 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_n.png",
180 BackgroundImage = new Selector<string>()
182 Normal = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
183 Pressed = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
186 ValueIndicatorImage = new ImageViewStyle()
188 Size = new Size(83, 54),
189 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_slider_value_indicator.png",
193 theme.AddStyleWithoutClone("Tizen.NUI.Components.Switch", new SwitchStyle()
195 ItemSpacing = new Size2D(32, 32),
196 ItemAlignment = LinearLayout.Alignment.CenterVertical,
197 Track = new ImageViewStyle()
199 Size = new Size(80, 40),
200 ResourceUrl = new Selector<string>()
202 Normal = FrameworkInformation.ResourcePath + "IoT_switch_track_off.png",
203 Pressed = FrameworkInformation.ResourcePath + "IoT_switch_track_off_p.png",
204 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_track_off_d.png",
205 Focused = FrameworkInformation.ResourcePath + "IoT_switch_track_off_f.png",
206 Selected = FrameworkInformation.ResourcePath + "IoT_switch_track_on.png",
207 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_track_on_p.png",
208 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_track_on_f.png",
209 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_switch_track_on_d.png",
212 Thumb = new ImageViewStyle()
214 Size = new Size(40, 40),
215 ResourceUrl = new Selector<string>()
217 Normal = FrameworkInformation.ResourcePath + "IoT_switch_thumb.png",
218 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_thumb_d.png",
219 Selected = FrameworkInformation.ResourcePath + "IoT_switch_thumb_s.png",
220 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sp.png",
221 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sf.png",
224 Text = new TextLabelStyle()
227 TextColor = new Color("#001447")
231 theme.AddStyleWithoutClone("Tizen.NUI.Components.Loading", new LoadingStyle()
233 LoadingSize = new Size(100, 100),
236 theme.AddStyleWithoutClone("Tizen.NUI.Components.Pagination", new PaginationStyle()
238 IndicatorImageUrl = new Selector<string>()
240 Normal = FrameworkInformation.ResourcePath + "nui_component_default_pagination_normal_dot.png",
241 Selected = FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
243 IndicatorSize = new Size(10, 10),
246 theme.AddStyleWithoutClone("Tizen.NUI.Components.Scrollbar", new ScrollbarStyle()
250 TrackColor = new Color(0f, 0f, 0f, 0f),
251 ThumbColor = new Color("#0A0E4AFF"),
253 ThumbVerticalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_vbar.#.png",
254 ThumbHorizontalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_hbar.#.png",
257 theme.AddStyleWithoutClone("Tizen.NUI.Components.LinearLayouter", new ViewStyle()
259 Padding = new Extents(64, 64, 0, 0)
262 theme.AddStyleWithoutClone("Tizen.NUI.Components.GridLayouter", new ViewStyle()
264 Padding = new Extents(0, 0, 0, 0),
267 theme.AddStyleWithoutClone("Tizen.NUI.Components.ItemsLayouter", new ViewStyle()
269 Padding = new Extents(0, 0, 0, 0),
272 theme.AddStyleWithoutClone("Tizen.NUI.Components.RecyclerViewItem", new RecyclerViewItemStyle()
274 BackgroundColor = new Selector<Color>()
276 Normal = new Color(1, 1, 1, 1),
277 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
278 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
279 Selected = new Color(0.701f, 0.898f, 0.937f, 1),
283 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultLinearItem", new DefaultLinearItemStyle()
286 Padding = new Extents(64, 64, 18, 17),
287 Margin = new Extents(0, 0, 0, 0),
288 BackgroundColor = new Selector<Color>()
290 Normal = new Color(1, 1, 1, 1),
291 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
292 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
293 Selected = new Color(0.85f, 0.85f, 0.85f, 1),
295 Label = new TextLabelStyle()
299 FontFamily = "BreezeSans", //FXIME Font Weight is Light
300 TextColor = new Color("#001447FF"),
302 SubLabel = new TextLabelStyle()
306 FontFamily = "BreezeSans",
307 TextColor = new Color("#001447FF"),
309 Icon = new ViewStyle()
311 Margin = new Extents(0, 32, 0, 0)
313 Extra = new ViewStyle()
315 Margin = new Extents(32, 0, 0, 0)
317 Seperator = new ViewStyle()
320 Margin = new Extents(64, 64, 0, 0),
321 BackgroundColor = new Color("#C3CAD2FF"),
324 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultGridItem", new DefaultGridItemStyle()
326 Padding = new Extents(0, 0, 0, 0),
327 Margin = new Extents(5, 5, 5, 5),
328 Caption = new TextLabelStyle()
332 LineWrapMode = LineWrapMode.Character,
334 Badge = new ViewStyle()
336 Margin = new Extents(5, 5, 5, 5),
340 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultTitleItem", new DefaultTitleItemStyle()
343 Padding = new Extents(64, 64, 12, 12),
344 Margin = new Extents(0, 0, 0, 0),
345 BackgroundColor = new Selector<Color>()
347 Normal = new Color("#EEEEF1FF"),
349 Label = new TextLabelStyle()
353 TextColor = new Color("#001447FF"),
355 Icon = new ViewStyle()
357 Margin = new Extents(40, 0, 0, 0)
359 Seperator = new ViewStyle()
361 Margin = new Extents(0, 0, 0, 0),
362 BackgroundColor = new Color(0, 0, 0, 0),
366 theme.AddStyleWithoutClone("Tizen.NUI.Components.AppBar", new AppBarStyle()
368 Size = new Size(-1, 120),
369 BackgroundColor = new Color("#EEEFF1FF"),
370 BackButton = new ButtonStyle()
372 Size = new Size(48, 48),
374 BackgroundColor = new Color(0, 0, 0, 0),
375 Icon = new ImageViewStyle()
377 Size = new Size(48, 48),
378 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_back_button.png",
379 Color = new Selector<Color>()
381 Normal = new Color("#0A0E4AFF"),
382 Focused = new Color("#00338BFF"),
383 Pressed = new Color("#1B69CAFF"),
384 Disabled = new Color("#C3CAD2FF"),
388 TitleTextLabel = new TextLabelStyle()
391 VerticalAlignment = VerticalAlignment.Center,
392 TextColor = new Selector<Color>()
394 Normal = new Color("#000C2BFF"),
397 ActionView = new ViewStyle()
399 Size = new Size(-1, 120),
401 BackgroundColor = new Color(0, 0, 0, 0),
403 ActionButton = new ButtonStyle()
405 Size = new Size(-1, 120),
407 BackgroundColor = new Color(0, 0, 0, 0),
408 Text = new TextLabelStyle()
411 TextColor = new Selector<Color>()
413 Normal = new Color("#0A0E4AFF"),
414 Focused = new Color("#00338BFF"),
415 Pressed = new Color("#1B69CAFF"),
416 Disabled = new Color("#C3CAD2FF"),
419 Icon = new ImageViewStyle()
421 Size = new Size(-1, 48),
422 Color = new Selector<Color>()
424 Normal = new Color("#0A0E4AFF"),
425 Focused = new Color("#00338BFF"),
426 Pressed = new Color("#1B69CAFF"),
427 Disabled = new Color("#C3CAD2FF"),
431 Padding = new Extents(64, 64, 0, 0),
432 NavigationPadding = new Extents(0, 24, 0, 0),
433 ActionPadding = new Extents(40, 0, 0, 0),
434 ActionCellPadding = new Size2D(40, 0),
437 theme.AddStyleWithoutClone("Tizen.NUI.Components.Picker", new PickerStyle()
439 Size = new Size(160, 339),
440 ItemTextLabel = new TextLabelStyle()
442 //FIXME: Should be check PointSize. given size from UX is too large.
444 VerticalAlignment = VerticalAlignment.Center,
445 HorizontalAlignment = HorizontalAlignment.Center,
446 Size = new Size(0,72),
447 TextColor = new Selector<Color>()
449 Normal = new Color("#000C2BFF"),
451 BackgroundColor = Color.White,
453 Divider = new ViewStyle()
456 WidthResizePolicy = ResizePolicyType.FillToParent,
457 Position = new Position(0, 132),
458 BackgroundColor = new Color("#0A0E4AFF"),
460 StartScrollOffset = new Size(0, 12),
463 theme.AddStyleWithoutClone("Tizen.NUI.Components.TabButton", new TabButtonStyle()
465 Size = new Size(-1, 84),
467 BackgroundColor = Color.White,
468 Text = new TextLabelStyle()
471 Size = new Size(-2, -2),
472 TextColor = new Selector<Color>()
474 Normal = new Color("#000C2BFF"),
475 Selected = new Color("#000C2BFF"),
476 Pressed = new Color("#1473E6FF"),
477 Disabled = new Color("#C3CAD2FF"),
480 Icon = new ImageViewStyle()
482 Size = new Size(48, 48),
483 Color = new Selector<Color>()
485 Normal = new Color("#000C2BFF"),
486 Selected = new Color("#000C2BFF"),
487 Pressed = new Color("#1473E6FF"),
488 Disabled = new Color("#C3CAD2FF"),
491 TopLine = new ViewStyle()
493 Size = new Size(-1, 1),
494 BackgroundColor = new Selector<Color>()
496 Normal = new Color("#000C2BFF"),
497 Selected = new Color("#000C2BFF"),
498 Pressed = new Color("#1473E6FF"),
499 Disabled = new Color("#C3CAD2FF"),
502 BottomLine = new ViewStyle()
504 Size = new Size(-1, 8),
505 Position = new Position(0, 76), // 84 - 8
506 BackgroundColor = new Selector<Color>()
508 Normal = Color.Transparent,
509 Selected = new Color("#000C2BFF"),
510 Pressed = new Color("#1473E6FF"),
511 Disabled = Color.Transparent,
516 theme.AddStyleWithoutClone("NotificationToast", new TextLabelStyle()
518 BackgroundImage = FrameworkInformation.ResourcePath + "IoT_Toast_1.png",
519 BackgroundImageBorder = new Rectangle(28, 28, 28, 28),
520 TextColor = new Color("#000C2B"),
522 WidthResizePolicy = ResizePolicyType.UseNaturalSize,
523 HeightResizePolicy = ResizePolicyType.UseNaturalSize,
524 PositionUsesPivotPoint = true,
525 HorizontalAlignment = HorizontalAlignment.Center,
526 VerticalAlignment = VerticalAlignment.Center,
527 Padding = new Extents(40, 40, 24, 24),
531 theme.AddStyleWithoutClone("Tizen.NUI.Components.AlertDialog", new AlertDialogStyle()
533 Size = new Size(-2, -2),
534 Padding = new Extents(80, 80, 0, 0),
535 BackgroundImage = FrameworkInformation.ResourcePath + "nui_component_default_dialog_bg.#.png",
536 TitleTextLabel = new TextLabelStyle()
538 Size = new Size(1024, -2),
539 Margin = new Extents(0, 0, 40, 40),
541 HorizontalAlignment = HorizontalAlignment.Center,
542 VerticalAlignment = VerticalAlignment.Center,
543 TextColor = new Selector<Color>()
545 Normal = new Color("#000C2BFF"),
548 MessageTextLabel = new TextLabelStyle()
550 Size = new Size(1024, -2),
551 Margin = new Extents(0, 0, 0, 64),
554 HorizontalAlignment = HorizontalAlignment.Center,
555 VerticalAlignment = VerticalAlignment.Center,
556 TextColor = new Selector<Color>()
558 Normal = new Color("#000C2BFF"),
561 ActionContent = new ViewStyle()
563 Size = new Size(1024, -2),
567 theme.AddStyleWithoutClone("Tizen.NUI.Components.TimePicker", new TimePickerStyle()
569 CellPadding = new Size(50, 339),
571 Pickers = new PickerStyle()
573 Size = new Size(160, 339),
574 ItemTextLabel = new TextLabelStyle()
576 //FIXME: Should be check PointSize. given size from UX is too large.
578 VerticalAlignment = VerticalAlignment.Center,
579 HorizontalAlignment = HorizontalAlignment.Center,
580 Size = new Size(0,72),
581 TextColor = new Selector<Color>()
583 Normal = new Color("#000C2BFF"),
585 BackgroundColor = Color.White,
587 Divider = new ViewStyle()
590 WidthResizePolicy = ResizePolicyType.FillToParent,
591 Position = new Position(0, 132),
592 BackgroundColor = new Color("#0A0E4AFF"),
594 StartScrollOffset = new Size2D(0, 12),
598 theme.AddStyleWithoutClone("Tizen.NUI.Components.DatePicker", new DatePickerStyle()
600 CellPadding = new Size(50, 339),
602 Pickers = new PickerStyle()
604 Size = new Size(160, 339),
605 ItemTextLabel = new TextLabelStyle()
607 //FIXME: Should be check PointSize. given size from UX is too large.
609 VerticalAlignment = VerticalAlignment.Center,
610 HorizontalAlignment = HorizontalAlignment.Center,
611 Size = new Size(0,72),
612 TextColor = new Selector<Color>()
614 Normal = new Color("#000C2BFF"),
616 BackgroundColor = Color.White,
618 Divider = new ViewStyle()
621 WidthResizePolicy = ResizePolicyType.FillToParent,
622 Position = new Position(0, 132),
623 BackgroundColor = new Color("#0A0E4AFF"),
625 StartScrollOffset = new Size2D(0, 12),
629 theme.AddStyleWithoutClone("Tizen.NUI.Components.AlertDialog", new AlertDialogStyle()
631 Size = new Size(-2, -2),
632 Padding = new Extents(80, 80, 0, 0),
633 BackgroundImage = FrameworkInformation.ResourcePath + "nui_component_default_dialog_bg.#.png",
634 TitleTextLabel = new TextLabelStyle()
636 Size = new Size(1024, -2),
637 Margin = new Extents(0, 0, 40, 40),
639 HorizontalAlignment = HorizontalAlignment.Center,
640 VerticalAlignment = VerticalAlignment.Center,
641 TextColor = new Selector<Color>()
643 Normal = new Color("#000C2BFF"),
646 MessageTextLabel = new TextLabelStyle()
648 Size = new Size(1024, -2),
649 Margin = new Extents(0, 0, 0, 64),
652 HorizontalAlignment = HorizontalAlignment.Center,
653 VerticalAlignment = VerticalAlignment.Center,
654 TextColor = new Selector<Color>()
656 Normal = new Color("#000C2BFF"),
659 ActionContent = new ViewStyle()
661 Size = new Size(1024, -2),
665 theme.AddStyleWithoutClone("Tizen.NUI.Components.MenuItem", new ButtonStyle()
667 Size = new Size(480, -2),
668 MinimumSize = new Size2D(0, 72),
670 BackgroundImage = FrameworkInformation.ResourcePath + "nui_component_menu_item_bg.png",
671 Padding = new Extents(16, 16, 16, 16),
672 Text = new TextLabelStyle()
676 HorizontalAlignment = HorizontalAlignment.Begin,
677 VerticalAlignment = VerticalAlignment.Center,
678 TextColor = new Selector<Color>()
680 Normal = new Color("#001447FF"),
681 Focused = new Color("#00338BFF"),
682 Pressed = new Color("#1B69CAFF"),
683 Disabled = new Color("#C3CAD2FF"),
686 Icon = new ImageViewStyle()
688 Size = new Size(-2, 48),
689 Color = new Selector<Color>()
691 Normal = new Color("#001447FF"),
692 Focused = new Color("#00338BFF"),
693 Pressed = new Color("#1B69CAFF"),
694 Disabled = new Color("#C3CAD2FF"),