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.Begin,
60 Icon = new ImageViewStyle()
62 Size = new Size(36, 36),
63 ResourceUrl = new Selector<string>()
65 Normal = FrameworkInformation.ResourcePath + "IoT_check_off.svg",
66 Pressed = FrameworkInformation.ResourcePath + "IoT_check_off_p.svg",
67 Disabled = FrameworkInformation.ResourcePath + "IoT_check_off_d.svg",
68 Focused = FrameworkInformation.ResourcePath + "IoT_check_off_f.svg",
69 Selected = FrameworkInformation.ResourcePath + "IoT_check_on.svg",
70 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_check_on_p.svg",
71 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_check_on_f.svg",
72 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_check_on_d.svg",
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),
137 theme.AddStyleWithoutClone("Tizen.NUI.Components.RadioButton", new ButtonStyle()
139 ItemSpacing = new Size2D(32, 32),
140 ItemAlignment = LinearLayout.Alignment.Begin,
141 Icon = new ImageViewStyle()
143 Size = new Size(36, 36),
144 ResourceUrl = new Selector<string>()
146 Normal = FrameworkInformation.ResourcePath + "IoT_radiobutton_off.svg",
147 Pressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_p.svg",
148 Disabled = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_d.svg",
149 Focused = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_f.svg",
150 Selected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on.svg",
151 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_p.svg",
152 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_f.svg",
153 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_d.svg",
156 Text = new TextLabelStyle()
159 TextColor = new Color("#001447")
163 theme.AddStyleWithoutClone("Tizen.NUI.Components.Slider", new SliderStyle()
165 Size = new Size(200, 50),
167 Track = new ImageViewStyle()
169 BackgroundColor = new Color(0, 0, 0, 0.1f),
171 Progress = new ImageViewStyle()
173 BackgroundColor = new Color(0.5f, 0.63f, 0.9f, 1),
175 Thumb = new ImageViewStyle()
177 Size = new Size(50, 50),
178 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_n.png",
179 BackgroundImage = new Selector<string>()
181 Normal = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
182 Pressed = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
185 ValueIndicatorImage = new ImageViewStyle()
187 Size = new Size(83, 54),
188 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_slider_value_indicator.png",
192 theme.AddStyleWithoutClone("Tizen.NUI.Components.Switch", new SwitchStyle()
194 ItemSpacing = new Size2D(32, 32),
195 ItemAlignment = LinearLayout.Alignment.Begin,
196 Track = new ImageViewStyle()
198 Size = new Size(80, 40),
199 ResourceUrl = new Selector<string>()
201 Normal = FrameworkInformation.ResourcePath + "IoT_switch_track_off.svg",
202 Pressed = FrameworkInformation.ResourcePath + "IoT_switch_track_off_p.svg",
203 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_track_off_d.svg",
204 Focused = FrameworkInformation.ResourcePath + "IoT_switch_track_off_f.svg",
205 Selected = FrameworkInformation.ResourcePath + "IoT_switch_track_on.svg",
206 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_track_on_p.svg",
207 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_track_on_f.svg",
208 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_switch_track_on_d.svg",
211 Thumb = new ImageViewStyle()
213 Size = new Size(40, 40),
214 ResourceUrl = new Selector<string>()
216 Normal = FrameworkInformation.ResourcePath + "IoT_switch_thumb.svg",
217 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_thumb_d.svg",
218 Selected = FrameworkInformation.ResourcePath + "IoT_switch_thumb_s.svg",
219 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sp.svg",
220 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sf.svg",
223 Text = new TextLabelStyle()
226 TextColor = new Color("#001447")
230 theme.AddStyleWithoutClone("Tizen.NUI.Components.Loading", new LoadingStyle()
232 LoadingSize = new Size(100, 100),
235 theme.AddStyleWithoutClone("Tizen.NUI.Components.Pagination", new PaginationStyle()
237 IndicatorImageUrl = new Selector<string>()
239 Normal = FrameworkInformation.ResourcePath + "nui_component_default_pagination_normal_dot.png",
240 Selected = FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
242 IndicatorSize = new Size(10, 10),
245 theme.AddStyleWithoutClone("Tizen.NUI.Components.Scrollbar", new ScrollbarStyle()
249 TrackColor = new Color(0f, 0f, 0f, 0f),
250 ThumbColor = new Color("#0A0E4AFF"),
252 ThumbVerticalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_vbar.#.png",
253 ThumbHorizontalImageUrl = FrameworkInformation.ResourcePath + "nui_component_default_scroll_hbar.#.png",
256 theme.AddStyleWithoutClone("Tizen.NUI.Components.RecyclerViewItem", new RecyclerViewItemStyle()
258 BackgroundColor = new Selector<Color>()
260 Normal = new Color(1, 1, 1, 1),
261 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
262 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
263 Selected = new Color(0.701f, 0.898f, 0.937f, 1),
267 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultLinearItem", new DefaultLinearItemStyle()
270 Padding = new Extents(64, 64, 18, 17),
271 BackgroundColor = new Selector<Color>()
273 Normal = new Color(1, 1, 1, 1),
274 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
275 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
276 Selected = new Color(0.85f, 0.85f, 0.85f, 1),
278 Label = new TextLabelStyle()
282 FontFamily = "BreezeSans", //FXIME Font Weight is Light
283 TextColor = new Color("#001447FF"),
285 SubLabel = new TextLabelStyle()
289 FontFamily = "BreezeSans",
290 TextColor = new Color("#001447FF"),
292 Icon = new ViewStyle()
294 Margin = new Extents(0, 32, 0, 0)
296 Extra = new ViewStyle()
298 Margin = new Extents(32, 0, 0, 0)
300 Seperator = new ViewStyle()
303 Margin = new Extents(64, 64, 0, 0),
304 BackgroundColor = new Color("#C3CAD2FF"),
307 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultGridItem", new DefaultGridItemStyle()
309 Padding = new Extents(5, 5, 5, 5),
310 Caption = new TextLabelStyle()
314 LineWrapMode = LineWrapMode.Character,
316 Badge = new ViewStyle()
318 Margin = new Extents(5, 5, 5, 5),
322 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultTitleItem", new DefaultTitleItemStyle()
325 Padding = new Extents(64, 64, 12, 12),
326 BackgroundColor = new Selector<Color>()
328 Normal = new Color("#EEEEF1FF"),
330 Label = new TextLabelStyle()
334 TextColor = new Color("#001447FF"),
336 Icon = new ViewStyle()
338 Margin = new Extents(40, 0, 0, 0)
340 Seperator = new ViewStyle()
342 Margin = new Extents(0, 0, 0, 0),
343 BackgroundColor = new Color(0, 0, 0, 0),
347 theme.AddStyleWithoutClone("Tizen.NUI.Components.AppBar", new AppBarStyle()
349 Size = new Size(-1, 120),
350 BackgroundColor = new Color("#EEEFF1FF"),
351 BackButton = new ButtonStyle()
353 Size = new Size(48, 48),
355 BackgroundColor = new Color(0, 0, 0, 0),
356 Icon = new ImageViewStyle()
358 Size = new Size(48, 48),
359 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_back_button.png",
360 Color = new Selector<Color>()
362 Normal = new Color("#0A0E4AFF"),
363 Focused = new Color("#00338BFF"),
364 Pressed = new Color("#1B69CAFF"),
365 Disabled = new Color("#C3CAD2FF"),
369 TitleTextLabel = new TextLabelStyle()
372 VerticalAlignment = VerticalAlignment.Center,
373 TextColor = new Selector<Color>()
375 Normal = new Color("#000C2BFF"),
378 ActionView = new ViewStyle()
380 Size = new Size(-1, 48),
382 BackgroundColor = new Color(0, 0, 0, 0),
384 ActionButton = new ButtonStyle()
386 Size = new Size(-1, 48),
388 BackgroundColor = new Color(0, 0, 0, 0),
389 Text = new TextLabelStyle()
392 TextColor = new Selector<Color>()
394 Normal = new Color("#0A0E4AFF"),
395 Focused = new Color("#00338BFF"),
396 Pressed = new Color("#1B69CAFF"),
397 Disabled = new Color("#C3CAD2FF"),
400 Icon = new ImageViewStyle()
402 Size = new Size(-1, 48),
403 Color = new Selector<Color>()
405 Normal = new Color("#0A0E4AFF"),
406 Focused = new Color("#00338BFF"),
407 Pressed = new Color("#1B69CAFF"),
408 Disabled = new Color("#C3CAD2FF"),
412 Padding = new Extents(64, 64, 0, 0),
413 NavigationPadding = new Extents(0, 24, 0, 0),
414 ActionPadding = new Extents(40, 0, 0, 0),
415 ActionCellPadding = new Size2D(40, 0),
418 theme.AddStyleWithoutClone("Tizen.NUI.Components.Picker", new PickerStyle()
420 Size = new Size(160, 339),
421 ItemTextLabel = new TextLabelStyle()
423 //FIXME: Should be check PointSize. given size from UX is too large.
425 VerticalAlignment = VerticalAlignment.Center,
426 HorizontalAlignment = HorizontalAlignment.Center,
427 Size = new Size(0,72),
428 TextColor = new Selector<Color>()
430 Normal = new Color("#000C2BFF"),
432 BackgroundColor = Color.White,
434 Divider = new ViewStyle()
437 WidthResizePolicy = ResizePolicyType.FillToParent,
438 Position = new Position(0, 132),
439 BackgroundColor = new Color("#0A0E4AFF"),
441 StartScrollOffset = new Size(0, 12),
444 theme.AddStyleWithoutClone("Tizen.NUI.Components.TabButton", new TabButtonStyle()
446 Size = new Size(-1, 84),
448 BackgroundColor = Color.White,
449 Text = new TextLabelStyle()
452 Size = new Size(-2, -2),
453 TextColor = new Selector<Color>()
455 Normal = new Color("#000C2BFF"),
456 Selected = new Color("#000C2BFF"),
457 Pressed = new Color("#1473E6FF"),
458 Disabled = new Color("#C3CAD2FF"),
461 Icon = new ImageViewStyle()
463 Size = new Size(48, 48),
464 Color = new Selector<Color>()
466 Normal = new Color("#000C2BFF"),
467 Selected = new Color("#000C2BFF"),
468 Pressed = new Color("#1473E6FF"),
469 Disabled = new Color("#C3CAD2FF"),
472 TopLine = new ViewStyle()
474 Size = new Size(-1, 1),
475 BackgroundColor = new Selector<Color>()
477 Normal = new Color("#000C2BFF"),
478 Selected = new Color("#000C2BFF"),
479 Pressed = new Color("#1473E6FF"),
480 Disabled = new Color("#C3CAD2FF"),
483 BottomLine = new ViewStyle()
485 Size = new Size(-1, 8),
486 Position = new Position(0, 76), // 84 - 8
487 BackgroundColor = new Selector<Color>()
489 Normal = Color.Transparent,
490 Selected = new Color("#000C2BFF"),
491 Pressed = new Color("#1473E6FF"),
492 Disabled = Color.Transparent,
497 theme.AddStyleWithoutClone("NotificationToast", new TextLabelStyle()
499 BackgroundImage = FrameworkInformation.ResourcePath + "IoT_Toast_1.png",
500 BackgroundImageBorder = new Rectangle(28, 28, 28, 28),
501 TextColor = new Color("#000C2B"),
503 WidthResizePolicy = ResizePolicyType.UseNaturalSize,
504 HeightResizePolicy = ResizePolicyType.UseNaturalSize,
505 PositionUsesPivotPoint = true,
506 HorizontalAlignment = HorizontalAlignment.Center,
507 VerticalAlignment = VerticalAlignment.Center,
508 Padding = new Extents(40, 40, 24, 24),
512 theme.AddStyleWithoutClone("Tizen.NUI.Components.AlertDialog", new AlertDialogStyle()
514 Size = new Size(-2, -2),
515 Padding = new Extents(80, 80, 0, 0),
516 BackgroundImage = FrameworkInformation.ResourcePath + "nui_component_default_dialog_bg.#.png",
517 TitleTextLabel = new TextLabelStyle()
519 Size = new Size(1024, -2),
520 Margin = new Extents(0, 0, 40, 40),
522 HorizontalAlignment = HorizontalAlignment.Center,
523 VerticalAlignment = VerticalAlignment.Center,
524 TextColor = new Selector<Color>()
526 Normal = new Color("#000C2BFF"),
529 MessageTextLabel = new TextLabelStyle()
531 Size = new Size(1024, -2),
532 Margin = new Extents(0, 0, 0, 64),
535 HorizontalAlignment = HorizontalAlignment.Center,
536 VerticalAlignment = VerticalAlignment.Center,
537 TextColor = new Selector<Color>()
539 Normal = new Color("#000C2BFF"),
542 ActionContent = new ViewStyle()
544 Size = new Size(1024, -2),
548 theme.AddStyleWithoutClone("Tizen.NUI.Components.TimePicker", new TimePickerStyle()
550 CellPadding = new Size(50, 339),
552 Pickers = new PickerStyle()
554 Size = new Size(160, 339),
555 ItemTextLabel = new TextLabelStyle()
557 //FIXME: Should be check PointSize. given size from UX is too large.
559 VerticalAlignment = VerticalAlignment.Center,
560 HorizontalAlignment = HorizontalAlignment.Center,
561 Size = new Size(0,72),
562 TextColor = new Selector<Color>()
564 Normal = new Color("#000C2BFF"),
566 BackgroundColor = Color.White,
568 Divider = new ViewStyle()
571 WidthResizePolicy = ResizePolicyType.FillToParent,
572 Position = new Position(0, 132),
573 BackgroundColor = new Color("#0A0E4AFF"),
575 StartScrollOffset = new Size2D(0, 12),
579 theme.AddStyleWithoutClone("Tizen.NUI.Components.DatePicker", new DatePickerStyle()
581 CellPadding = new Size(50, 339),
583 Pickers = new PickerStyle()
585 Size = new Size(160, 339),
586 ItemTextLabel = new TextLabelStyle()
588 //FIXME: Should be check PointSize. given size from UX is too large.
590 VerticalAlignment = VerticalAlignment.Center,
591 HorizontalAlignment = HorizontalAlignment.Center,
592 Size = new Size(0,72),
593 TextColor = new Selector<Color>()
595 Normal = new Color("#000C2BFF"),
597 BackgroundColor = Color.White,
599 Divider = new ViewStyle()
602 WidthResizePolicy = ResizePolicyType.FillToParent,
603 Position = new Position(0, 132),
604 BackgroundColor = new Color("#0A0E4AFF"),
606 StartScrollOffset = new Size2D(0, 12),