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()
58 Icon = new ImageViewStyle()
60 Size = new Size(30, 30),
61 Opacity = new Selector<float?>()
67 BackgroundImage = new Selector<string>()
69 Pressed = FrameworkInformation.ResourcePath + "nui_component_default_checkbox_bg_p.png",
70 Selected = FrameworkInformation.ResourcePath + "nui_component_default_checkbox_bg_p.png",
71 Other = FrameworkInformation.ResourcePath + "nui_component_default_checkbox_bg_n.png",
73 ResourceUrl = new Selector<string>()
76 Selected = FrameworkInformation.ResourcePath + "nui_component_default_checkbox_s.png",
80 Text = new TextLabelStyle()
83 TextColor = new Selector<Color>()
85 Normal = new Color(0.22f, 0.22f, 0.22f, 1),
86 Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
87 Disabled = new Color(0.66f, 0.66f, 0.66f, 1),
92 theme.AddStyleWithoutClone("Tizen.NUI.Components.Popup", new PopupStyle()
94 Size = new Size(500, 280),
95 BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1),
96 ImageShadow = new ImageShadow()
98 Url = FrameworkInformation.ResourcePath + "nui_component_default_popup_shadow.png",
99 Border = new Rectangle(24, 24, 24, 24),
100 Extents = new Vector2(48, 48)
102 Title = new TextLabelStyle()
105 Padding = new Extents(20, 20, 20, 20),
107 Buttons = new ButtonStyle()
109 Size = new Size(0, 80),
110 BackgroundColor = new Selector<Color>()
112 Normal = new Color(1, 1, 1, 1),
113 Pressed = new Color(1, 1, 1, 0.5f),
115 Overlay = new ImageViewStyle()
117 BackgroundColor = new Selector<Color>()
119 Pressed = new Color(0, 0, 0, 0.1f),
120 Other = new Color(1, 1, 1, 0.1f),
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()
150 Icon = new ImageViewStyle()
152 Size = new Size(30, 30),
153 Opacity = new Selector<float?>()
159 BackgroundImage = new Selector<string>()
161 Pressed = FrameworkInformation.ResourcePath + "nui_component_default_radiobutton_p.png",
162 Selected = FrameworkInformation.ResourcePath + "nui_component_default_radiobutton_s.png",
163 Other = FrameworkInformation.ResourcePath + "nui_component_default_radiobutton_n.png",
166 Text = new TextLabelStyle()
169 TextColor = new Selector<Color>()
171 Normal = new Color(0.22f, 0.22f, 0.22f, 1),
172 Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
173 Disabled = new Color(0.66f, 0.66f, 0.66f, 1),
178 theme.AddStyleWithoutClone("Tizen.NUI.Components.Slider", new SliderStyle()
180 Size = new Size(200, 50),
182 Track = new ImageViewStyle()
184 BackgroundColor = new Color(0, 0, 0, 0.1f),
186 Progress = new ImageViewStyle()
188 BackgroundColor = new Color(0.5f, 0.63f, 0.9f, 1),
190 Thumb = new ImageViewStyle()
192 Size = new Size(50, 50),
193 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_n.png",
194 BackgroundImage = new Selector<string>()
196 Normal = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
197 Pressed = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
200 ValueIndicatorImage = new ImageViewStyle()
202 Size = new Size(83, 54),
203 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_slider_value_indicator.png",
207 theme.AddStyleWithoutClone("Tizen.NUI.Components.Switch", new SwitchStyle()
210 Track = new ImageViewStyle()
212 Size = new Size(96, 60),
213 ResourceUrl = new Selector<string>()
215 Normal = FrameworkInformation.ResourcePath + "nui_component_default_switch_track_n.png",
216 Selected = FrameworkInformation.ResourcePath + "nui_component_default_switch_track_s.png",
217 Disabled = FrameworkInformation.ResourcePath + "nui_component_default_switch_track_d.png",
218 DisabledSelected = FrameworkInformation.ResourcePath + "nui_component_default_switch_track_ds.png",
221 Thumb = new ImageViewStyle()
223 Size = new Size(60, 60),
224 ResourceUrl = new Selector<string>()
226 Normal = FrameworkInformation.ResourcePath + "nui_component_default_switch_thumb_n.png",
227 Disabled = FrameworkInformation.ResourcePath + "nui_component_default_switch_thumb_d.png",
228 Selected = FrameworkInformation.ResourcePath + "nui_component_default_switch_thumb_n.png",
231 Text = new TextLabelStyle()
234 TextColor = new Selector<Color>()
236 Normal = new Color(0.22f, 0.22f, 0.22f, 1),
237 Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
238 Disabled = new Color(0.66f, 0.66f, 0.66f, 1),
243 theme.AddStyleWithoutClone("Tizen.NUI.Components.Loading", new LoadingStyle()
245 LoadingSize = new Size(100, 100),
248 theme.AddStyleWithoutClone("Tizen.NUI.Components.Pagination", new PaginationStyle()
250 IndicatorImageUrl = new Selector<string>()
252 Normal = FrameworkInformation.ResourcePath + "nui_component_default_pagination_normal_dot.png",
253 Selected = FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
255 IndicatorSize = new Size(10, 10),
258 theme.AddStyleWithoutClone("Tizen.NUI.Components.Scrollbar", new ScrollbarStyle()
262 TrackColor = new Color(1, 1, 1, 0.15f),
263 ThumbColor = new Color(0.6f, 0.6f, 0.6f, 1.0f),
267 theme.AddStyleWithoutClone("Tizen.NUI.Components.RecyclerViewItem", new RecyclerViewItemStyle()
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.701f, 0.898f, 0.937f, 1),
278 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultLinearItem", new DefaultLinearItemStyle()
281 Padding = new Extents(20, 20, 5, 5),
282 BackgroundColor = new Selector<Color>()
284 Normal = new Color(1, 1, 1, 1),
285 Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
286 Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
287 Selected = new Color(0.701f, 0.898f, 0.937f, 1),
289 Label = new TextLabelStyle()
294 SubLabel = new TextLabelStyle()
299 Icon = new ViewStyle()
301 Margin = new Extents(0, 20, 0, 0)
303 Extra = new ViewStyle()
305 Margin = new Extents(20, 0, 0, 0)
307 Seperator = new ViewStyle()
309 Margin = new Extents(5, 5, 0, 0),
310 BackgroundColor = new Color(0.78f, 0.78f, 0.78f, 1),
313 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultGridItem", new DefaultGridItemStyle()
315 Padding = new Extents(5, 5, 5, 5),
316 Caption = new TextLabelStyle()
321 Badge = new ViewStyle()
323 Margin = new Extents(5, 5, 5, 5),
327 theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultTitleItem", new DefaultTitleItemStyle()
330 Padding = new Extents(10, 10, 5, 5),
331 BackgroundColor = new Selector<Color>()
333 Normal = new Color(0.78f, 0.78f, 0.78f, 1),
335 Label = new TextLabelStyle()
340 Icon = new ViewStyle()
342 Margin = new Extents(10, 0, 0, 0)
344 Seperator = new ViewStyle()
346 Margin = new Extents(0, 0, 0, 0),
347 BackgroundColor = new Color(0.85f, 0.85f, 0.85f, 1),
351 theme.AddStyleWithoutClone("Tizen.NUI.Components.AppBar", new AppBarStyle()
353 Size = new Size(-1, 120),
354 BackgroundColor = new Color("#EEEFF1FF"),
355 BackButton = new ButtonStyle()
357 Size = new Size(48, 48),
359 BackgroundColor = new Color(0, 0, 0, 0),
360 Icon = new ImageViewStyle()
362 Size = new Size(48, 48),
363 ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_back_button.png",
364 Color = new Selector<Color>()
366 Normal = new Color("#0A0E4AFF"),
367 Focused = new Color("#00338BFF"),
368 Pressed = new Color("#1B69CAFF"),
369 Disabled = new Color("#C3CAD2FF"),
373 TitleTextLabel = new TextLabelStyle()
376 VerticalAlignment = VerticalAlignment.Center,
377 TextColor = new Selector<Color>()
379 Normal = new Color("#000C2BFF"),
382 ActionView = new ViewStyle()
384 Size = new Size(-1, 48),
386 BackgroundColor = new Color(0, 0, 0, 0),
388 ActionButton = new ButtonStyle()
390 Size = new Size(-1, 48),
392 BackgroundColor = new Color(0, 0, 0, 0),
393 Text = new TextLabelStyle()
396 TextColor = new Selector<Color>()
398 Normal = new Color("#0A0E4AFF"),
399 Focused = new Color("#00338BFF"),
400 Pressed = new Color("#1B69CAFF"),
401 Disabled = new Color("#C3CAD2FF"),
404 Icon = new ImageViewStyle()
406 Size = new Size(-1, 48),
407 Color = new Selector<Color>()
409 Normal = new Color("#0A0E4AFF"),
410 Focused = new Color("#00338BFF"),
411 Pressed = new Color("#1B69CAFF"),
412 Disabled = new Color("#C3CAD2FF"),
416 Padding = new Extents(64, 64, 0, 0),
417 NavigationPadding = new Extents(0, 24, 0, 0),
418 ActionPadding = new Extents(40, 0, 0, 0),
419 ActionCellPadding = new Size2D(40, 0),