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 BackgroundColor = new Selector<Color>()
43 Normal = new Color(0.039f, 0.055f, 0.29f, 1),
44 Pressed = new Color(0.106f, 0.412f, 0.792f, 1),
45 Focused = new Color(0, 0.2f, 0.545f, 1),
46 Disabled = new Color(0.765f, 0.792f, 0.824f, 1),
48 Text = new TextLabelStyle()
51 TextColor = Color.White,
55 theme.AddStyleWithoutClone("Tizen.NUI.Components.CheckBox", new ButtonStyle()
57 TextPadding = new Extents(32, 0, 0, 0),
58 Icon = new ImageViewStyle()
60 Size = new Size(36, 36),
61 ResourceUrl = new Selector<string>()
63 Normal = FrameworkInformation.ResourcePath + "IoT_check_off.svg",
64 Pressed = FrameworkInformation.ResourcePath + "IoT_check_off_p.svg",
65 Disabled = FrameworkInformation.ResourcePath + "IoT_check_off_d.svg",
66 Focused = FrameworkInformation.ResourcePath + "IoT_check_off_f.svg",
67 Selected = FrameworkInformation.ResourcePath + "IoT_check_on.svg",
68 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_check_on_p.svg",
69 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_check_on_f.svg",
70 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_check_on_d.svg",
73 Text = new TextLabelStyle()
76 TextColor = new Color("#001447")
80 theme.AddStyleWithoutClone("Tizen.NUI.Components.Popup", new PopupStyle()
82 Size = new Size(500, 280),
83 BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1),
84 ImageShadow = new ImageShadow()
86 Url = FrameworkInformation.ResourcePath + "nui_component_default_popup_shadow.png",
87 Border = new Rectangle(24, 24, 24, 24),
88 Extents = new Vector2(48, 48)
90 Title = new TextLabelStyle()
93 Padding = new Extents(20, 20, 20, 20),
95 Buttons = new ButtonStyle()
97 Size = new Size(0, 80),
98 BackgroundColor = new Selector<Color>()
100 Normal = new Color(1, 1, 1, 1),
101 Pressed = new Color(1, 1, 1, 0.5f),
103 Overlay = new ImageViewStyle()
105 BackgroundColor = new Selector<Color>()
107 Pressed = new Color(0, 0, 0, 0.1f),
108 Other = new Color(1, 1, 1, 0.1f),
111 Text = new TextLabelStyle()
113 TextColor = new Color(0.05f, 0.63f, 0.9f, 1),
118 theme.AddStyleWithoutClone("Tizen.NUI.Components.Progress", new ProgressStyle()
120 Size = new Size(200, 5),
121 Track = new ImageViewStyle()
123 BackgroundColor = new Color(0, 0, 0, 0.1f),
125 Buffer = new ImageViewStyle()
127 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 0.3f),
129 Progress = new ImageViewStyle()
131 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
135 theme.AddStyleWithoutClone("Tizen.NUI.Components.RadioButton", new ButtonStyle()
137 TextPadding = new Extents(32, 0, 0, 0),
138 Icon = new ImageViewStyle()
140 Size = new Size(36, 36),
141 ResourceUrl = new Selector<string>()
143 Normal = FrameworkInformation.ResourcePath + "IoT_radiobutton_off.svg",
144 Pressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_p.svg",
145 Disabled = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_d.svg",
146 Focused = FrameworkInformation.ResourcePath + "IoT_radiobutton_off_f.svg",
147 Selected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on.svg",
148 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_p.svg",
149 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_f.svg",
150 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_radiobutton_on_d.svg",
153 Text = new TextLabelStyle()
156 TextColor = new Color("#001447")
160 theme.AddStyleWithoutClone("Tizen.NUI.Components.Slider", new SliderStyle()
162 Size = new Size(200, 50),
164 Track = new ImageViewStyle()
166 BackgroundColor = new Color(0, 0, 0, 0.1f),
168 Progress = new ImageViewStyle()
170 BackgroundColor = new Color(0.5f, 0.63f, 0.9f, 1),
172 Thumb = new ImageViewStyle()
174 Size = new Size(50, 50),
175 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_n.png",
176 BackgroundImage = new Selector<string>()
178 Normal = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
179 Pressed = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
182 ValueIndicatorImage = new ImageViewStyle()
184 Size = new Size(83, 54),
185 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_slider_value_indicator.png",
189 theme.AddStyleWithoutClone("Tizen.NUI.Components.Switch", new SwitchStyle()
191 TextPadding = new Extents(32, 0, 0, 0),
192 Track = new ImageViewStyle()
194 Size = new Size(80, 40),
195 ResourceUrl = new Selector<string>()
197 Normal = FrameworkInformation.ResourcePath + "IoT_switch_track_off.svg",
198 Pressed = FrameworkInformation.ResourcePath + "IoT_switch_track_off_p.svg",
199 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_track_off_d.svg",
200 Focused = FrameworkInformation.ResourcePath + "IoT_switch_track_off_f.svg",
201 Selected = FrameworkInformation.ResourcePath + "IoT_switch_track_on.svg",
202 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_track_on_p.svg",
203 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_track_on_f.svg",
204 DisabledSelected = FrameworkInformation.ResourcePath + "IoT_switch_track_on_d.svg",
207 Thumb = new ImageViewStyle()
209 Size = new Size(40, 40),
210 ResourceUrl = new Selector<string>()
212 Normal = FrameworkInformation.ResourcePath + "IoT_switch_thumb.svg",
213 Disabled = FrameworkInformation.ResourcePath + "IoT_switch_thumb_d.svg",
214 Selected = FrameworkInformation.ResourcePath + "IoT_switch_thumb_s.svg",
215 SelectedPressed = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sp.svg",
216 SelectedFocused = FrameworkInformation.ResourcePath + "IoT_switch_thumb_sf.svg",
219 Text = new TextLabelStyle()
222 TextColor = new Color("#001447")
226 theme.AddStyleWithoutClone("Tizen.NUI.Components.Loading", new LoadingStyle()
228 LoadingSize = new Size(100, 100),
231 theme.AddStyleWithoutClone("Tizen.NUI.Components.Pagination", new PaginationStyle()
233 IndicatorImageUrl = new Selector<string>()
235 Normal = FrameworkInformation.ResourcePath + "nui_component_default_pagination_normal_dot.png",
236 Selected = FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
238 IndicatorSize = new Size(10, 10),
241 theme.AddStyleWithoutClone("Tizen.NUI.Components.Scrollbar", new ScrollbarStyle()
245 TrackColor = new Color(1, 1, 1, 0.15f),
246 ThumbColor = new Color(0.6f, 0.6f, 0.6f, 1.0f),
250 theme.AddStyleWithoutClone("Tizen.NUI.Components.RecyclerViewItem", new RecyclerViewItemStyle()
252 BackgroundColor = new Selector<Color>()
254 Normal = new Color(1, 1, 1, 1),
255 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
256 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
257 Selected = new Color(0.701f, 0.898f, 0.937f, 1),
261 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultLinearItem", new DefaultLinearItemStyle()
264 Padding = new Extents(64, 64, 18, 17),
265 BackgroundColor = new Selector<Color>()
267 Normal = new Color(1, 1, 1, 1),
268 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
269 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
270 Selected = new Color(0.85f, 0.85f, 0.85f, 1),
272 Label = new TextLabelStyle()
276 FontFamily = "BreezeSans", //FXIME Font Weight is Light
277 TextColor = new Color("#001447FF"),
279 SubLabel = new TextLabelStyle()
283 FontFamily = "BreezeSans",
284 TextColor = new Color("#001447FF"),
286 Icon = new ViewStyle()
288 Margin = new Extents(0, 32, 0, 0)
290 Extra = new ViewStyle()
292 Margin = new Extents(32, 0, 0, 0)
294 Seperator = new ViewStyle()
297 Margin = new Extents(64, 64, 0, 0),
298 BackgroundColor = new Color("#C3CAD2FF"),
301 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultGridItem", new DefaultGridItemStyle()
303 Padding = new Extents(5, 5, 5, 5),
304 Caption = new TextLabelStyle()
308 LineWrapMode = LineWrapMode.Character,
310 Badge = new ViewStyle()
312 Margin = new Extents(5, 5, 5, 5),
316 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultTitleItem", new DefaultTitleItemStyle()
319 Padding = new Extents(64, 64, 12, 12),
320 BackgroundColor = new Selector<Color>()
322 Normal = new Color("#EEEEF1FF"),
324 Label = new TextLabelStyle()
328 TextColor = new Color("#001447FF"),
330 Icon = new ViewStyle()
332 Margin = new Extents(40, 0, 0, 0)
334 Seperator = new ViewStyle()
336 Margin = new Extents(0, 0, 0, 0),
337 BackgroundColor = new Color(0, 0, 0, 0),
341 theme.AddStyleWithoutClone("Tizen.NUI.Components.AppBar", new AppBarStyle()
343 Size = new Size(-1, 120),
344 BackgroundColor = new Color("#EEEFF1FF"),
345 BackButton = new ButtonStyle()
347 Size = new Size(48, 48),
349 BackgroundColor = new Color(0, 0, 0, 0),
350 Icon = new ImageViewStyle()
352 Size = new Size(48, 48),
353 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_back_button.png",
354 Color = new Selector<Color>()
356 Normal = new Color("#0A0E4AFF"),
357 Focused = new Color("#00338BFF"),
358 Pressed = new Color("#1B69CAFF"),
359 Disabled = new Color("#C3CAD2FF"),
363 TitleTextLabel = new TextLabelStyle()
366 VerticalAlignment = VerticalAlignment.Center,
367 TextColor = new Selector<Color>()
369 Normal = new Color("#000C2BFF"),
372 ActionView = new ViewStyle()
374 Size = new Size(-1, 48),
376 BackgroundColor = new Color(0, 0, 0, 0),
378 ActionButton = new ButtonStyle()
380 Size = new Size(-1, 48),
382 BackgroundColor = new Color(0, 0, 0, 0),
383 Text = new TextLabelStyle()
386 TextColor = new Selector<Color>()
388 Normal = new Color("#0A0E4AFF"),
389 Focused = new Color("#00338BFF"),
390 Pressed = new Color("#1B69CAFF"),
391 Disabled = new Color("#C3CAD2FF"),
394 Icon = new ImageViewStyle()
396 Size = new Size(-1, 48),
397 Color = new Selector<Color>()
399 Normal = new Color("#0A0E4AFF"),
400 Focused = new Color("#00338BFF"),
401 Pressed = new Color("#1B69CAFF"),
402 Disabled = new Color("#C3CAD2FF"),
406 Padding = new Extents(64, 64, 0, 0),
407 NavigationPadding = new Extents(0, 24, 0, 0),
408 ActionPadding = new Extents(40, 0, 0, 0),
409 ActionCellPadding = new Size2D(40, 0),
412 theme.AddStyleWithoutClone("Tizen.NUI.Components.Picker", new PickerStyle()
414 Size = new Size(160, 339),
415 ItemTextLabel = new TextLabelStyle()
417 //FIXME: Should be check PointSize. given size from UX is too large.
419 VerticalAlignment = VerticalAlignment.Center,
420 HorizontalAlignment = HorizontalAlignment.Center,
421 Size = new Size(0,72),
422 TextColor = new Selector<Color>()
424 Normal = new Color("#000C2BFF"),
426 BackgroundColor = Color.White,
428 Divider = new ViewStyle()
431 WidthResizePolicy = ResizePolicyType.FillToParent,
432 Position = new Position(0, 132),
433 BackgroundColor = new Color("#0A0E4AFF"),
435 StartScrollOffset = new Size2D(0, 12),