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 Focused = new Color(0, 0.2f, 0.545f, 1),
45 Pressed = new Color(0.106f, 0.412f, 0.792f, 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 Size = new Size(30, 30),
58 Icon = new ImageViewStyle()
60 Opacity = new Selector<float?>()
66 BackgroundImage = new Selector<string>()
68 Pressed = FrameworkInformation.ResourcePath + "nui_component_default_checkbox_bg_p.png",
69 Selected = FrameworkInformation.ResourcePath + "nui_component_default_checkbox_bg_p.png",
70 Other = FrameworkInformation.ResourcePath + "nui_component_default_checkbox_bg_n.png",
72 ResourceUrl = new Selector<string>()
75 Selected = FrameworkInformation.ResourcePath + "nui_component_default_checkbox_s.png",
79 Text = new TextLabelStyle()
82 TextColor = new Selector<Color>()
84 Normal = new Color(0.22f, 0.22f, 0.22f, 1),
85 Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
86 Disabled = new Color(0.66f, 0.66f, 0.66f, 1),
91 theme.AddStyleWithoutClone("Tizen.NUI.Components.Popup", new PopupStyle()
93 Size = new Size(500, 280),
94 BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1),
95 ImageShadow = new ImageShadow()
97 Url = FrameworkInformation.ResourcePath + "nui_component_default_popup_shadow.png",
98 Border = new Rectangle(24, 24, 24, 24),
99 Extents = new Vector2(48, 48)
101 Title = new TextLabelStyle()
104 Padding = new Extents(20, 20, 20, 20),
106 Buttons = new ButtonStyle()
108 Size = new Size(0, 80),
109 BackgroundColor = new Selector<Color>()
111 Normal = new Color(1, 1, 1, 1),
112 Pressed = new Color(1, 1, 1, 0.5f),
114 Overlay = new ImageViewStyle()
116 BackgroundColor = new Selector<Color>()
118 Normal = new Color(1, 1, 1, 1),
119 Pressed = new Color(0, 0, 0, 0.1f),
120 Other = new Color(1, 1, 1, 1),
123 Text = new TextLabelStyle()
125 TextColor = new Color(0.05f, 0.63f, 0.9f, 1),
130 theme.AddStyleWithoutClone("Tizen.NUI.Components.Progress", new ProgressStyle()
132 Size = new Size(200, 5),
133 Track = new ImageViewStyle()
135 BackgroundColor = new Color(0, 0, 0, 0.1f),
137 Buffer = new ImageViewStyle()
139 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 0.3f),
141 Progress = new ImageViewStyle()
143 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
147 theme.AddStyleWithoutClone("Tizen.NUI.Components.RadioButton", new ButtonStyle()
149 Size = new Size(30, 30),
150 Icon = new ImageViewStyle()
152 Opacity = new Selector<float?>()
158 BackgroundImage = new Selector<string>()
160 Pressed = FrameworkInformation.ResourcePath + "nui_component_default_radiobutton_p.png",
161 Selected = FrameworkInformation.ResourcePath + "nui_component_default_radiobutton_s.png",
162 Other = FrameworkInformation.ResourcePath + "nui_component_default_radiobutton_n.png",
165 Text = new TextLabelStyle()
168 TextColor = new Selector<Color>()
170 Normal = new Color(0.22f, 0.22f, 0.22f, 1),
171 Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
172 Disabled = new Color(0.66f, 0.66f, 0.66f, 1),
177 theme.AddStyleWithoutClone("Tizen.NUI.Components.Slider", new SliderStyle()
179 Size = new Size(200, 50),
181 Track = new ImageViewStyle()
183 BackgroundColor = new Color(0, 0, 0, 0.1f),
185 Progress = new ImageViewStyle()
187 BackgroundColor = new Color(0.5f, 0.63f, 0.9f, 1),
189 Thumb = new ImageViewStyle()
191 Size = new Size(50, 50),
192 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_n.png",
193 BackgroundImage = new Selector<string>()
195 Normal = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
196 Pressed = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
199 ValueIndicatorImage = new ImageViewStyle()
201 Size = new Size(83, 54),
202 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_slider_value_indicator.png",
206 theme.AddStyleWithoutClone("Tizen.NUI.Components.Switch", new SwitchStyle()
208 Size = new Size(96, 60),
209 Track = new ImageViewStyle()
211 Size = new Size(96, 60),
212 ResourceUrl = new Selector<string>()
214 Normal = FrameworkInformation.ResourcePath + "nui_component_default_switch_track_n.png",
215 Selected = FrameworkInformation.ResourcePath + "nui_component_default_switch_track_s.png",
216 Disabled = FrameworkInformation.ResourcePath + "nui_component_default_switch_track_d.png",
217 DisabledSelected = FrameworkInformation.ResourcePath + "nui_component_default_switch_track_ds.png",
220 Thumb = new ImageViewStyle()
222 Size = new Size(60, 60),
223 ResourceUrl = new Selector<string>()
225 Normal = FrameworkInformation.ResourcePath + "nui_component_default_switch_thumb_n.png",
226 Disabled = FrameworkInformation.ResourcePath + "nui_component_default_switch_thumb_d.png",
227 Selected = FrameworkInformation.ResourcePath + "nui_component_default_switch_thumb_n.png",
230 Text = new TextLabelStyle()
233 TextColor = new Selector<Color>()
235 Normal = new Color(0.22f, 0.22f, 0.22f, 1),
236 Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
237 Disabled = new Color(0.66f, 0.66f, 0.66f, 1),
242 theme.AddStyleWithoutClone("Tizen.NUI.Components.Loading", new LoadingStyle()
244 LoadingSize = new Size(100, 100),
247 theme.AddStyleWithoutClone("Tizen.NUI.Components.Pagination", new PaginationStyle()
249 IndicatorImageUrl = new Selector<string>()
251 Normal = FrameworkInformation.ResourcePath + "nui_component_default_pagination_normal_dot.png",
252 Selected = FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
254 IndicatorSize = new Size(10, 10),
257 theme.AddStyleWithoutClone("Tizen.NUI.Components.Scrollbar", new ScrollbarStyle()
261 TrackColor = new Color(1, 1, 1, 0.15f),
262 ThumbColor = new Color(0.6f, 0.6f, 0.6f, 1.0f),
266 theme.AddStyleWithoutClone("Tizen.NUI.Components.RecyclerViewItem", new RecyclerViewItemStyle()
268 BackgroundColor = new Selector<Color>()
270 Normal = new Color(1, 1, 1, 1),
271 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
272 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
273 Selected = new Color(0.701f, 0.898f, 0.937f, 1),
277 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultLinearItem", new DefaultLinearItemStyle()
280 Padding = new Extents(20, 20, 5, 5),
281 BackgroundColor = new Selector<Color>()
283 Normal = new Color(1, 1, 1, 1),
284 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
285 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
286 Selected = new Color(0.701f, 0.898f, 0.937f, 1),
288 Label = new TextLabelStyle()
293 SubLabel = new TextLabelStyle()
298 Icon = new ViewStyle()
300 Margin = new Extents(0, 20, 0, 0)
302 Extra = new ViewStyle()
304 Margin = new Extents(20, 0, 0, 0)
306 Seperator = new ViewStyle()
308 Margin = new Extents(5, 5, 0, 0),
309 BackgroundColor = new Color(0.78f, 0.78f, 0.78f, 1),
312 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultGridItem", new DefaultGridItemStyle()
314 Padding = new Extents(5, 5, 5, 5),
315 Caption = new TextLabelStyle()
320 Badge = new ViewStyle()
322 Margin = new Extents(5, 5, 5, 5),
326 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultTitleItem", new DefaultTitleItemStyle()
329 Padding = new Extents(10, 10, 5, 5),
330 BackgroundColor = new Selector<Color>()
332 Normal = new Color(0.78f, 0.78f, 0.78f, 1),
334 Label = new TextLabelStyle()
339 Icon = new ViewStyle()
341 Margin = new Extents(10, 0, 0, 0)
343 Seperator = new ViewStyle()
345 Margin = new Extents(0, 0, 0, 0),
346 BackgroundColor = new Color(0.85f, 0.85f, 0.85f, 1),
350 theme.AddStyleWithoutClone("Tizen.NUI.Components.AppBar", new AppBarStyle()
352 Size = new Size(-1, 120),
353 BackgroundColor = new Color("#EEEFF1FF"),
354 BackButton = new ButtonStyle()
356 Size = new Size(48, 48),
358 BackgroundColor = new Color(0, 0, 0, 0),
359 Icon = new ImageViewStyle()
361 Size = new Size(48, 48),
362 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_back_button.png",
363 Color = new Selector<Color>()
365 Normal = new Color("#0A0E4AFF"),
366 Focused = new Color("#00338BFF"),
367 Pressed = new Color("#1B69CAFF"),
368 Disabled = new Color("#C3CAD2FF"),
372 TitleTextLabel = new TextLabelStyle()
375 VerticalAlignment = VerticalAlignment.Center,
376 TextColor = new Selector<Color>()
378 Normal = new Color("#000C2BFF"),
381 ActionView = new ViewStyle()
383 Size = new Size(-1, 48),
385 BackgroundColor = new Color(0, 0, 0, 0),
387 ActionButton = new ButtonStyle()
389 Size = new Size(-1, 48),
391 BackgroundColor = new Color(0, 0, 0, 0),
392 Text = new TextLabelStyle()
395 TextColor = new Selector<Color>()
397 Normal = new Color("#0A0E4AFF"),
398 Focused = new Color("#00338BFF"),
399 Pressed = new Color("#1B69CAFF"),
400 Disabled = new Color("#C3CAD2FF"),
403 Icon = new ImageViewStyle()
405 Size = new Size(-1, 48),
406 Color = new Selector<Color>()
408 Normal = new Color("#0A0E4AFF"),
409 Focused = new Color("#00338BFF"),
410 Pressed = new Color("#1B69CAFF"),
411 Disabled = new Color("#C3CAD2FF"),
415 Padding = new Extents(64, 64, 0, 0),
416 NavigationPadding = new Extents(0, 24, 0, 0),
417 ActionPadding = new Extents(40, 0, 0, 0),
418 ActionCellPadding = new Size2D(40, 0),