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 Label = 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.Page", new ViewStyle()
383 BackgroundColor = new Color("#EEEFF1FF"),
386 theme.AddStyleWithoutClone("Tizen.NUI.Components.AppBar", new AppBarStyle()
388 Size = new Size(-1, 120),
389 BackgroundColor = new Color("#EEEFF1FF"),
390 BackButton = new ButtonStyle()
392 Size = new Size(48, 48),
394 BackgroundColor = new Color(0, 0, 0, 0),
395 Icon = new ImageViewStyle()
397 Size = new Size(48, 48),
398 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_back_button.png",
399 Color = new Selector<Color>()
401 Normal = new Color("#0A0E4AFF"),
402 Focused = new Color("#00338BFF"),
403 Pressed = new Color("#1B69CAFF"),
404 Disabled = new Color("#C3CAD2FF"),
408 TitleTextLabel = new TextLabelStyle()
411 VerticalAlignment = VerticalAlignment.Center,
412 TextColor = new Selector<Color>()
414 Normal = new Color("#000C2BFF"),
417 ActionView = new ViewStyle()
419 Size = new Size(-1, 120),
421 BackgroundColor = new Color(0, 0, 0, 0),
423 ActionButton = new ButtonStyle()
425 Size = new Size(-1, 120),
427 BackgroundColor = new Color(0, 0, 0, 0),
428 Text = new TextLabelStyle()
431 TextColor = new Selector<Color>()
433 Normal = new Color("#0A0E4AFF"),
434 Focused = new Color("#00338BFF"),
435 Pressed = new Color("#1B69CAFF"),
436 Disabled = new Color("#C3CAD2FF"),
439 Icon = new ImageViewStyle()
441 Size = new Size(-1, 48),
442 Color = new Selector<Color>()
444 Normal = new Color("#0A0E4AFF"),
445 Focused = new Color("#00338BFF"),
446 Pressed = new Color("#1B69CAFF"),
447 Disabled = new Color("#C3CAD2FF"),
451 Padding = new Extents(64, 64, 0, 0),
452 NavigationPadding = new Extents(0, 24, 0, 0),
453 ActionPadding = new Extents(40, 0, 0, 0),
454 ActionCellPadding = new Size2D(40, 0),
457 theme.AddStyleWithoutClone("Tizen.NUI.Components.Picker", new PickerStyle()
459 Size = new Size(160, 339),
460 ItemTextLabel = new TextLabelStyle()
462 //FIXME: Should be check PointSize. given size from UX is too large.
464 VerticalAlignment = VerticalAlignment.Center,
465 HorizontalAlignment = HorizontalAlignment.Center,
466 Size = new Size(0,72),
467 TextColor = new Selector<Color>()
469 Normal = new Color("#000C2BFF"),
471 BackgroundColor = Color.White,
473 Divider = new ViewStyle()
476 WidthResizePolicy = ResizePolicyType.FillToParent,
477 Position = new Position(0, 132),
478 BackgroundColor = new Color("#0A0E4AFF"),
480 StartScrollOffset = new Size(0, 12),
483 theme.AddStyleWithoutClone("Tizen.NUI.Components.TabButton", new TabButtonStyle()
485 Size = new Size(-1, 84),
487 BackgroundColor = Color.White,
488 Text = new TextLabelStyle()
491 Size = new Size(-2, -2),
492 TextColor = new Selector<Color>()
494 Normal = new Color("#000C2BFF"),
495 Selected = new Color("#000C2BFF"),
496 Pressed = new Color("#1473E6FF"),
497 Disabled = new Color("#C3CAD2FF"),
500 Icon = new ImageViewStyle()
502 Size = new Size(48, 48),
503 Color = new Selector<Color>()
505 Normal = new Color("#000C2BFF"),
506 Selected = new Color("#000C2BFF"),
507 Pressed = new Color("#1473E6FF"),
508 Disabled = new Color("#C3CAD2FF"),
511 TopLine = new ViewStyle()
513 Size = new Size(-1, 1),
514 BackgroundColor = new Selector<Color>()
516 Normal = new Color("#000C2BFF"),
517 Selected = new Color("#000C2BFF"),
518 Pressed = new Color("#1473E6FF"),
519 Disabled = new Color("#C3CAD2FF"),
522 BottomLine = new ViewStyle()
524 Size = new Size(-1, 8),
525 Position = new Position(0, 76), // 84 - 8
526 BackgroundColor = new Selector<Color>()
528 Normal = Color.Transparent,
529 Selected = new Color("#000C2BFF"),
530 Pressed = new Color("#1473E6FF"),
531 Disabled = Color.Transparent,
536 theme.AddStyleWithoutClone("NotificationToast", new TextLabelStyle()
538 BackgroundImage = FrameworkInformation.ResourcePath + "IoT_Toast_1.png",
539 BackgroundImageBorder = new Rectangle(28, 28, 28, 28),
540 TextColor = new Color("#000C2B"),
542 WidthResizePolicy = ResizePolicyType.UseNaturalSize,
543 HeightResizePolicy = ResizePolicyType.UseNaturalSize,
544 PositionUsesPivotPoint = true,
545 HorizontalAlignment = HorizontalAlignment.Center,
546 VerticalAlignment = VerticalAlignment.Center,
547 Padding = new Extents(40, 40, 24, 24),
551 theme.AddStyleWithoutClone("Tizen.NUI.Components.AlertDialog", new AlertDialogStyle()
553 Size = new Size(-2, -2),
554 Padding = new Extents(80, 80, 0, 0),
555 BackgroundImage = FrameworkInformation.ResourcePath + "nui_component_default_dialog_bg.#.png",
556 TitleTextLabel = new TextLabelStyle()
558 Size = new Size(1024, -2),
559 Margin = new Extents(0, 0, 40, 40),
561 HorizontalAlignment = HorizontalAlignment.Center,
562 VerticalAlignment = VerticalAlignment.Center,
563 TextColor = new Selector<Color>()
565 Normal = new Color("#000C2BFF"),
568 MessageTextLabel = new TextLabelStyle()
570 Size = new Size(1024, -2),
571 Margin = new Extents(0, 0, 0, 64),
574 HorizontalAlignment = HorizontalAlignment.Center,
575 VerticalAlignment = VerticalAlignment.Center,
576 TextColor = new Selector<Color>()
578 Normal = new Color("#000C2BFF"),
581 ActionContent = new ViewStyle()
583 Size = new Size(1024, -2),
587 theme.AddStyleWithoutClone("Tizen.NUI.Components.TimePicker", new TimePickerStyle()
589 CellPadding = new Size(50, 339),
591 Pickers = new PickerStyle()
593 Size = new Size(160, 339),
594 ItemTextLabel = new TextLabelStyle()
596 //FIXME: Should be check PointSize. given size from UX is too large.
598 VerticalAlignment = VerticalAlignment.Center,
599 HorizontalAlignment = HorizontalAlignment.Center,
600 Size = new Size(0,72),
601 TextColor = new Selector<Color>()
603 Normal = new Color("#000C2BFF"),
605 BackgroundColor = Color.White,
607 Divider = new ViewStyle()
610 WidthResizePolicy = ResizePolicyType.FillToParent,
611 Position = new Position(0, 132),
612 BackgroundColor = new Color("#0A0E4AFF"),
614 StartScrollOffset = new Size2D(0, 12),
618 theme.AddStyleWithoutClone("Tizen.NUI.Components.DatePicker", new DatePickerStyle()
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 Selector<Color>()
634 Normal = new Color("#000C2BFF"),
636 BackgroundColor = Color.White,
638 Divider = new ViewStyle()
641 WidthResizePolicy = ResizePolicyType.FillToParent,
642 Position = new Position(0, 132),
643 BackgroundColor = new Color("#0A0E4AFF"),
645 StartScrollOffset = new Size2D(0, 12),
649 theme.AddStyleWithoutClone("Tizen.NUI.Components.MenuItem", new ButtonStyle()
651 Size = new Size(480, -2),
652 MinimumSize = new Size2D(0, 72),
654 BackgroundImage = FrameworkInformation.ResourcePath + "nui_component_menu_item_bg.png",
655 Padding = new Extents(16, 16, 16, 16),
656 Text = new TextLabelStyle()
660 HorizontalAlignment = HorizontalAlignment.Begin,
661 VerticalAlignment = VerticalAlignment.Center,
662 TextColor = new Selector<Color>()
664 Normal = new Color("#001447FF"),
665 Focused = new Color("#00338BFF"),
666 Pressed = new Color("#1B69CAFF"),
667 Disabled = new Color("#C3CAD2FF"),
670 Icon = new ImageViewStyle()
672 Size = new Size(-2, 48),
673 Color = new Selector<Color>()
675 Normal = new Color("#001447FF"),
676 Focused = new Color("#00338BFF"),
677 Pressed = new Color("#1B69CAFF"),
678 Disabled = new Color("#C3CAD2FF"),