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(1, 1, 1, 0.15f),
250 ThumbColor = new Color(0.6f, 0.6f, 0.6f, 1.0f),
254 theme.AddStyleWithoutClone("Tizen.NUI.Components.RecyclerViewItem", new RecyclerViewItemStyle()
256 BackgroundColor = new Selector<Color>()
258 Normal = new Color(1, 1, 1, 1),
259 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
260 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
261 Selected = new Color(0.701f, 0.898f, 0.937f, 1),
265 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultLinearItem", new DefaultLinearItemStyle()
268 Padding = new Extents(64, 64, 18, 17),
269 BackgroundColor = new Selector<Color>()
271 Normal = new Color(1, 1, 1, 1),
272 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
273 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
274 Selected = new Color(0.85f, 0.85f, 0.85f, 1),
276 Label = new TextLabelStyle()
280 FontFamily = "BreezeSans", //FXIME Font Weight is Light
281 TextColor = new Color("#001447FF"),
283 SubLabel = new TextLabelStyle()
287 FontFamily = "BreezeSans",
288 TextColor = new Color("#001447FF"),
290 Icon = new ViewStyle()
292 Margin = new Extents(0, 32, 0, 0)
294 Extra = new ViewStyle()
296 Margin = new Extents(32, 0, 0, 0)
298 Seperator = new ViewStyle()
301 Margin = new Extents(64, 64, 0, 0),
302 BackgroundColor = new Color("#C3CAD2FF"),
305 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultGridItem", new DefaultGridItemStyle()
307 Padding = new Extents(5, 5, 5, 5),
308 Caption = new TextLabelStyle()
312 LineWrapMode = LineWrapMode.Character,
314 Badge = new ViewStyle()
316 Margin = new Extents(5, 5, 5, 5),
320 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultTitleItem", new DefaultTitleItemStyle()
323 Padding = new Extents(64, 64, 12, 12),
324 BackgroundColor = new Selector<Color>()
326 Normal = new Color("#EEEEF1FF"),
328 Label = new TextLabelStyle()
332 TextColor = new Color("#001447FF"),
334 Icon = new ViewStyle()
336 Margin = new Extents(40, 0, 0, 0)
338 Seperator = new ViewStyle()
340 Margin = new Extents(0, 0, 0, 0),
341 BackgroundColor = new Color(0, 0, 0, 0),
345 theme.AddStyleWithoutClone("Tizen.NUI.Components.AppBar", new AppBarStyle()
347 Size = new Size(-1, 120),
348 BackgroundColor = new Color("#EEEFF1FF"),
349 BackButton = new ButtonStyle()
351 Size = new Size(48, 48),
353 BackgroundColor = new Color(0, 0, 0, 0),
354 Icon = new ImageViewStyle()
356 Size = new Size(48, 48),
357 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_back_button.png",
358 Color = new Selector<Color>()
360 Normal = new Color("#0A0E4AFF"),
361 Focused = new Color("#00338BFF"),
362 Pressed = new Color("#1B69CAFF"),
363 Disabled = new Color("#C3CAD2FF"),
367 TitleTextLabel = new TextLabelStyle()
370 VerticalAlignment = VerticalAlignment.Center,
371 TextColor = new Selector<Color>()
373 Normal = new Color("#000C2BFF"),
376 ActionView = new ViewStyle()
378 Size = new Size(-1, 48),
380 BackgroundColor = new Color(0, 0, 0, 0),
382 ActionButton = new ButtonStyle()
384 Size = new Size(-1, 48),
386 BackgroundColor = new Color(0, 0, 0, 0),
387 Text = new TextLabelStyle()
390 TextColor = new Selector<Color>()
392 Normal = new Color("#0A0E4AFF"),
393 Focused = new Color("#00338BFF"),
394 Pressed = new Color("#1B69CAFF"),
395 Disabled = new Color("#C3CAD2FF"),
398 Icon = new ImageViewStyle()
400 Size = new Size(-1, 48),
401 Color = new Selector<Color>()
403 Normal = new Color("#0A0E4AFF"),
404 Focused = new Color("#00338BFF"),
405 Pressed = new Color("#1B69CAFF"),
406 Disabled = new Color("#C3CAD2FF"),
410 Padding = new Extents(64, 64, 0, 0),
411 NavigationPadding = new Extents(0, 24, 0, 0),
412 ActionPadding = new Extents(40, 0, 0, 0),
413 ActionCellPadding = new Size2D(40, 0),
416 theme.AddStyleWithoutClone("Tizen.NUI.Components.Picker", new PickerStyle()
418 Size = new Size(160, 339),
419 ItemTextLabel = new TextLabelStyle()
421 //FIXME: Should be check PointSize. given size from UX is too large.
423 VerticalAlignment = VerticalAlignment.Center,
424 HorizontalAlignment = HorizontalAlignment.Center,
425 Size = new Size(0,72),
426 TextColor = new Selector<Color>()
428 Normal = new Color("#000C2BFF"),
430 BackgroundColor = Color.White,
432 Divider = new ViewStyle()
435 WidthResizePolicy = ResizePolicyType.FillToParent,
436 Position = new Position(0, 132),
437 BackgroundColor = new Color("#0A0E4AFF"),
439 StartScrollOffset = new Size(0, 12),
442 theme.AddStyleWithoutClone("Tizen.NUI.Components.TabButton", new TabButtonStyle()
444 Size = new Size(-1, 84),
446 BackgroundColor = Color.White,
447 Text = new TextLabelStyle()
450 Size = new Size(-2, -2),
451 TextColor = new Selector<Color>()
453 Normal = new Color("#000C2BFF"),
454 Selected = new Color("#000C2BFF"),
455 Pressed = new Color("#1473E6FF"),
456 Disabled = new Color("#C3CAD2FF"),
459 Icon = new ImageViewStyle()
461 Size = new Size(48, 48),
462 Color = new Selector<Color>()
464 Normal = new Color("#000C2BFF"),
465 Selected = new Color("#000C2BFF"),
466 Pressed = new Color("#1473E6FF"),
467 Disabled = new Color("#C3CAD2FF"),
470 TopLine = new ViewStyle()
472 Size = new Size(-1, 1),
473 BackgroundColor = new Selector<Color>()
475 Normal = new Color("#000C2BFF"),
476 Selected = new Color("#000C2BFF"),
477 Pressed = new Color("#1473E6FF"),
478 Disabled = new Color("#C3CAD2FF"),
481 BottomLine = new ViewStyle()
483 Size = new Size(-1, 8),
484 Position = new Position(0, 76), // 84 - 8
485 BackgroundColor = new Selector<Color>()
487 Normal = Color.Transparent,
488 Selected = new Color("#000C2BFF"),
489 Pressed = new Color("#1473E6FF"),
490 Disabled = Color.Transparent,
495 theme.AddStyleWithoutClone("NotificationToast", new TextLabelStyle()
497 BackgroundImage = FrameworkInformation.ResourcePath + "IoT_Toast_1.png",
498 BackgroundImageBorder = new Rectangle(28, 28, 28, 28),
499 TextColor = new Color("#000C2B"),
501 WidthResizePolicy = ResizePolicyType.UseNaturalSize,
502 HeightResizePolicy = ResizePolicyType.UseNaturalSize,
503 PositionUsesPivotPoint = true,
504 HorizontalAlignment = HorizontalAlignment.Center,
505 VerticalAlignment = VerticalAlignment.Center,
506 Padding = new Extents(40, 40, 24, 24),
510 theme.AddStyleWithoutClone("Tizen.NUI.Components.AlertDialog", new AlertDialogStyle()
512 Size = new Size(-2, -2),
513 Padding = new Extents(80, 80, 0, 0),
514 BackgroundImage = FrameworkInformation.ResourcePath + "nui_component_default_dialog_bg.#.png",
515 TitleTextLabel = new TextLabelStyle()
517 Size = new Size(1024, -2),
518 Margin = new Extents(0, 0, 40, 40),
520 HorizontalAlignment = HorizontalAlignment.Center,
521 VerticalAlignment = VerticalAlignment.Center,
522 TextColor = new Selector<Color>()
524 Normal = new Color("#000C2BFF"),
527 MessageTextLabel = new TextLabelStyle()
529 Size = new Size(1024, -2),
530 Margin = new Extents(0, 0, 0, 64),
533 HorizontalAlignment = HorizontalAlignment.Center,
534 VerticalAlignment = VerticalAlignment.Center,
535 TextColor = new Selector<Color>()
537 Normal = new Color("#000C2BFF"),
540 ActionContent = new ViewStyle()
542 Size = new Size(1024, -2),
546 theme.AddStyleWithoutClone("Tizen.NUI.Components.TimePicker", new TimePickerStyle()
548 CellPadding = new Size(50, 339),
550 Pickers = new PickerStyle()
552 Size = new Size(160, 339),
553 ItemTextLabel = new TextLabelStyle()
555 //FIXME: Should be check PointSize. given size from UX is too large.
557 VerticalAlignment = VerticalAlignment.Center,
558 HorizontalAlignment = HorizontalAlignment.Center,
559 Size = new Size(0,72),
560 TextColor = new Selector<Color>()
562 Normal = new Color("#000C2BFF"),
564 BackgroundColor = Color.White,
566 Divider = new ViewStyle()
569 WidthResizePolicy = ResizePolicyType.FillToParent,
570 Position = new Position(0, 132),
571 BackgroundColor = new Color("#0A0E4AFF"),
573 StartScrollOffset = new Size2D(0, 12),
577 theme.AddStyleWithoutClone("Tizen.NUI.Components.DatePicker", new DatePickerStyle()
579 CellPadding = new Size(50, 339),
581 Pickers = new PickerStyle()
583 Size = new Size(160, 339),
584 ItemTextLabel = new TextLabelStyle()
586 //FIXME: Should be check PointSize. given size from UX is too large.
588 VerticalAlignment = VerticalAlignment.Center,
589 HorizontalAlignment = HorizontalAlignment.Center,
590 Size = new Size(0,72),
591 TextColor = new Selector<Color>()
593 Normal = new Color("#000C2BFF"),
595 BackgroundColor = Color.White,
597 Divider = new ViewStyle()
600 WidthResizePolicy = ResizePolicyType.FillToParent,
601 Position = new Position(0, 132),
602 BackgroundColor = new Color("#0A0E4AFF"),
604 StartScrollOffset = new Size2D(0, 12),