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),
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.Begin,
142 Icon = new ImageViewStyle()
144 Size = new Size(36, 36),
145 ResourceUrl = new Selector<string>()
147 Normal = FrameworkInformation.ResourcePath + "IoT_radiobutton_off.svg",
148 Pressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_p.svg",
149 Disabled = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_d.svg",
150 Focused = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_f.svg",
151 Selected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on.svg",
152 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_p.svg",
153 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_f.svg",
154 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_d.svg",
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.Begin,
197 Track = new ImageViewStyle()
199 Size = new Size(80, 40),
200 ResourceUrl = new Selector<string>()
202 Normal = FrameworkInformation.ResourcePath + "IoT_switch_track_off.svg",
203 Pressed = FrameworkInformation.ResourcePath + "IoT_switch_track_off_p.svg",
204 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_track_off_d.svg",
205 Focused = FrameworkInformation.ResourcePath + "IoT_switch_track_off_f.svg",
206 Selected = FrameworkInformation.ResourcePath + "IoT_switch_track_on.svg",
207 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_track_on_p.svg",
208 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_track_on_f.svg",
209 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_switch_track_on_d.svg",
212 Thumb = new ImageViewStyle()
214 Size = new Size(40, 40),
215 ResourceUrl = new Selector<string>()
217 Normal = FrameworkInformation.ResourcePath + "IoT_switch_thumb.svg",
218 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_thumb_d.svg",
219 Selected = FrameworkInformation.ResourcePath + "IoT_switch_thumb_s.svg",
220 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sp.svg",
221 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sf.svg",
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.RecyclerViewItem", new RecyclerViewItemStyle()
259 BackgroundColor = new Selector<Color>()
261 Normal = new Color(1, 1, 1, 1),
262 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
263 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
264 Selected = new Color(0.701f, 0.898f, 0.937f, 1),
268 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultLinearItem", new DefaultLinearItemStyle()
271 Padding = new Extents(64, 64, 18, 17),
272 BackgroundColor = new Selector<Color>()
274 Normal = new Color(1, 1, 1, 1),
275 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
276 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
277 Selected = new Color(0.85f, 0.85f, 0.85f, 1),
279 Label = new TextLabelStyle()
283 FontFamily = "BreezeSans", //FXIME Font Weight is Light
284 TextColor = new Color("#001447FF"),
286 SubLabel = new TextLabelStyle()
290 FontFamily = "BreezeSans",
291 TextColor = new Color("#001447FF"),
293 Icon = new ViewStyle()
295 Margin = new Extents(0, 32, 0, 0)
297 Extra = new ViewStyle()
299 Margin = new Extents(32, 0, 0, 0)
301 Seperator = new ViewStyle()
304 Margin = new Extents(64, 64, 0, 0),
305 BackgroundColor = new Color("#C3CAD2FF"),
308 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultGridItem", new DefaultGridItemStyle()
310 Padding = new Extents(5, 5, 5, 5),
311 Caption = new TextLabelStyle()
315 LineWrapMode = LineWrapMode.Character,
317 Badge = new ViewStyle()
319 Margin = new Extents(5, 5, 5, 5),
323 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultTitleItem", new DefaultTitleItemStyle()
326 Padding = new Extents(64, 64, 12, 12),
327 BackgroundColor = new Selector<Color>()
329 Normal = new Color("#EEEEF1FF"),
331 Label = new TextLabelStyle()
335 TextColor = new Color("#001447FF"),
337 Icon = new ViewStyle()
339 Margin = new Extents(40, 0, 0, 0)
341 Seperator = new ViewStyle()
343 Margin = new Extents(0, 0, 0, 0),
344 BackgroundColor = new Color(0, 0, 0, 0),
348 theme.AddStyleWithoutClone("Tizen.NUI.Components.AppBar", new AppBarStyle()
350 Size = new Size(-1, 120),
351 BackgroundColor = new Color("#EEEFF1FF"),
352 BackButton = new ButtonStyle()
354 Size = new Size(48, 48),
356 BackgroundColor = new Color(0, 0, 0, 0),
357 Icon = new ImageViewStyle()
359 Size = new Size(48, 48),
360 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_back_button.png",
361 Color = new Selector<Color>()
363 Normal = new Color("#0A0E4AFF"),
364 Focused = new Color("#00338BFF"),
365 Pressed = new Color("#1B69CAFF"),
366 Disabled = new Color("#C3CAD2FF"),
370 TitleTextLabel = new TextLabelStyle()
373 VerticalAlignment = VerticalAlignment.Center,
374 TextColor = new Selector<Color>()
376 Normal = new Color("#000C2BFF"),
379 ActionView = new ViewStyle()
381 Size = new Size(-1, 48),
383 BackgroundColor = new Color(0, 0, 0, 0),
385 ActionButton = new ButtonStyle()
387 Size = new Size(-1, 48),
389 BackgroundColor = new Color(0, 0, 0, 0),
390 Text = new TextLabelStyle()
393 TextColor = new Selector<Color>()
395 Normal = new Color("#0A0E4AFF"),
396 Focused = new Color("#00338BFF"),
397 Pressed = new Color("#1B69CAFF"),
398 Disabled = new Color("#C3CAD2FF"),
401 Icon = new ImageViewStyle()
403 Size = new Size(-1, 48),
404 Color = new Selector<Color>()
406 Normal = new Color("#0A0E4AFF"),
407 Focused = new Color("#00338BFF"),
408 Pressed = new Color("#1B69CAFF"),
409 Disabled = new Color("#C3CAD2FF"),
413 Padding = new Extents(64, 64, 0, 0),
414 NavigationPadding = new Extents(0, 24, 0, 0),
415 ActionPadding = new Extents(40, 0, 0, 0),
416 ActionCellPadding = new Size2D(40, 0),
419 theme.AddStyleWithoutClone("Tizen.NUI.Components.Picker", new PickerStyle()
421 Size = new Size(160, 339),
422 ItemTextLabel = new TextLabelStyle()
424 //FIXME: Should be check PointSize. given size from UX is too large.
426 VerticalAlignment = VerticalAlignment.Center,
427 HorizontalAlignment = HorizontalAlignment.Center,
428 Size = new Size(0,72),
429 TextColor = new Selector<Color>()
431 Normal = new Color("#000C2BFF"),
433 BackgroundColor = Color.White,
435 Divider = new ViewStyle()
438 WidthResizePolicy = ResizePolicyType.FillToParent,
439 Position = new Position(0, 132),
440 BackgroundColor = new Color("#0A0E4AFF"),
442 StartScrollOffset = new Size(0, 12),
445 theme.AddStyleWithoutClone("Tizen.NUI.Components.TabButton", new TabButtonStyle()
447 Size = new Size(-1, 84),
449 BackgroundColor = Color.White,
450 Text = new TextLabelStyle()
453 Size = new Size(-2, -2),
454 TextColor = new Selector<Color>()
456 Normal = new Color("#000C2BFF"),
457 Selected = new Color("#000C2BFF"),
458 Pressed = new Color("#1473E6FF"),
459 Disabled = new Color("#C3CAD2FF"),
462 Icon = new ImageViewStyle()
464 Size = new Size(48, 48),
465 Color = new Selector<Color>()
467 Normal = new Color("#000C2BFF"),
468 Selected = new Color("#000C2BFF"),
469 Pressed = new Color("#1473E6FF"),
470 Disabled = new Color("#C3CAD2FF"),
473 TopLine = new ViewStyle()
475 Size = new Size(-1, 1),
476 BackgroundColor = new Selector<Color>()
478 Normal = new Color("#000C2BFF"),
479 Selected = new Color("#000C2BFF"),
480 Pressed = new Color("#1473E6FF"),
481 Disabled = new Color("#C3CAD2FF"),
484 BottomLine = new ViewStyle()
486 Size = new Size(-1, 8),
487 Position = new Position(0, 76), // 84 - 8
488 BackgroundColor = new Selector<Color>()
490 Normal = Color.Transparent,
491 Selected = new Color("#000C2BFF"),
492 Pressed = new Color("#1473E6FF"),
493 Disabled = Color.Transparent,
498 theme.AddStyleWithoutClone("NotificationToast", new TextLabelStyle()
500 BackgroundImage = FrameworkInformation.ResourcePath + "IoT_Toast_1.png",
501 BackgroundImageBorder = new Rectangle(28, 28, 28, 28),
502 TextColor = new Color("#000C2B"),
504 WidthResizePolicy = ResizePolicyType.UseNaturalSize,
505 HeightResizePolicy = ResizePolicyType.UseNaturalSize,
506 PositionUsesPivotPoint = true,
507 HorizontalAlignment = HorizontalAlignment.Center,
508 VerticalAlignment = VerticalAlignment.Center,
509 Padding = new Extents(40, 40, 24, 24),
513 theme.AddStyleWithoutClone("Tizen.NUI.Components.AlertDialog", new AlertDialogStyle()
515 Size = new Size(-2, -2),
516 Padding = new Extents(80, 80, 0, 0),
517 BackgroundImage = FrameworkInformation.ResourcePath + "nui_component_default_dialog_bg.#.png",
518 TitleTextLabel = new TextLabelStyle()
520 Size = new Size(1024, -2),
521 Margin = new Extents(0, 0, 40, 40),
523 HorizontalAlignment = HorizontalAlignment.Center,
524 VerticalAlignment = VerticalAlignment.Center,
525 TextColor = new Selector<Color>()
527 Normal = new Color("#000C2BFF"),
530 MessageTextLabel = new TextLabelStyle()
532 Size = new Size(1024, -2),
533 Margin = new Extents(0, 0, 0, 64),
536 HorizontalAlignment = HorizontalAlignment.Center,
537 VerticalAlignment = VerticalAlignment.Center,
538 TextColor = new Selector<Color>()
540 Normal = new Color("#000C2BFF"),
543 ActionContent = new ViewStyle()
545 Size = new Size(1024, -2),
549 theme.AddStyleWithoutClone("Tizen.NUI.Components.TimePicker", new TimePickerStyle()
551 CellPadding = new Size(50, 339),
553 Pickers = new PickerStyle()
555 Size = new Size(160, 339),
556 ItemTextLabel = new TextLabelStyle()
558 //FIXME: Should be check PointSize. given size from UX is too large.
560 VerticalAlignment = VerticalAlignment.Center,
561 HorizontalAlignment = HorizontalAlignment.Center,
562 Size = new Size(0,72),
563 TextColor = new Selector<Color>()
565 Normal = new Color("#000C2BFF"),
567 BackgroundColor = Color.White,
569 Divider = new ViewStyle()
572 WidthResizePolicy = ResizePolicyType.FillToParent,
573 Position = new Position(0, 132),
574 BackgroundColor = new Color("#0A0E4AFF"),
576 StartScrollOffset = new Size2D(0, 12),
580 theme.AddStyleWithoutClone("Tizen.NUI.Components.DatePicker", new DatePickerStyle()
582 CellPadding = new Size(50, 339),
584 Pickers = new PickerStyle()
586 Size = new Size(160, 339),
587 ItemTextLabel = new TextLabelStyle()
589 //FIXME: Should be check PointSize. given size from UX is too large.
591 VerticalAlignment = VerticalAlignment.Center,
592 HorizontalAlignment = HorizontalAlignment.Center,
593 Size = new Size(0,72),
594 TextColor = new Selector<Color>()
596 Normal = new Color("#000C2BFF"),
598 BackgroundColor = Color.White,
600 Divider = new ViewStyle()
603 WidthResizePolicy = ResizePolicyType.FillToParent,
604 Position = new Position(0, 132),
605 BackgroundColor = new Color("#0A0E4AFF"),
607 StartScrollOffset = new Size2D(0, 12),