[NUI] Add the default images of Pagination (#1641)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / PreloadStyle / DefaultTheme.cs
1 /*
2  * Copyright(c) 2020 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 using System.ComponentModel;
18 using Tizen.NUI.BaseComponents;
19
20 namespace Tizen.NUI.Components
21 {
22     /// <summary>
23     /// Interface that includes styles for all components for a default theme
24     /// </summary>
25     [EditorBrowsable(EditorBrowsableState.Never)]
26     internal class DefaultTheme : Theme
27     {
28         internal static Theme Instance { get; } = new DefaultTheme();
29
30         protected DefaultTheme() : base()
31         {
32         }
33
34         protected override ButtonStyle GetButtonStyle()
35         {
36             return new ButtonStyle
37             {
38                 Size = new Size(100, 45),
39                 BackgroundColor = new Selector<Color>
40                 {
41                     Normal = new Color(0.88f, 0.88f, 0.88f, 1),
42                     Pressed = new Color(0.77f, 0.77f, 0.77f, 1),
43                     Disabled = new Color(0.88f, 0.88f, 0.88f, 1)
44                 },
45                 Text = new TextLabelStyle
46                 {
47                     PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
48                     WidthResizePolicy = ResizePolicyType.FillToParent,
49                     HeightResizePolicy = ResizePolicyType.FillToParent,
50                     HorizontalAlignment = HorizontalAlignment.Center,
51                     VerticalAlignment = VerticalAlignment.Center,
52                     TextColor = new Selector<Color>
53                     {
54                         Normal = new Color(0.22f, 0.22f, 0.22f, 1),
55                         Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
56                         Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
57                     },
58                     Text = "Button",
59                 }
60             };
61         }
62
63         protected override ButtonStyle GetCheckBoxStyle()
64         {
65             return new ButtonStyle
66             {
67                 Size = new Size(30, 30),
68                 Icon = new ImageViewStyle
69                 {
70                     WidthResizePolicy = ResizePolicyType.DimensionDependency,
71                     HeightResizePolicy = ResizePolicyType.SizeRelativeToParent,
72                     SizeModeFactor = new Vector3(1, 1, 1),
73                     Opacity = new Selector<float?>
74                     {
75                         Normal = 1.0f,
76                         Selected = 1.0f,
77                         Disabled = 0.4f,
78                         DisabledSelected = 0.4f
79                     },
80                     BackgroundImage = new Selector<string>
81                     {
82                         Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_n.png"),
83                         Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_p.png"),
84                         Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_p.png"),
85                         Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_n.png"),
86                         DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_p.png"),
87                     },
88                     ResourceUrl = new Selector<string>
89                     {
90                         Normal = "",
91                         Pressed = "",
92                         Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_s.png"),
93                         Disabled = "",
94                         DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_s.png"),
95                     }
96                 },
97                 Text = new TextLabelStyle
98                 {
99                     PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
100                     WidthResizePolicy = ResizePolicyType.FillToParent,
101                     HeightResizePolicy = ResizePolicyType.FillToParent,
102                     HorizontalAlignment = HorizontalAlignment.Center,
103                     VerticalAlignment = VerticalAlignment.Center,
104                     TextColor = new Selector<Color>
105                     {
106                         Normal = new Color(0.22f, 0.22f, 0.22f, 1),
107                         Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
108                         Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
109                     }
110                 }
111             };
112         }
113
114         protected override DropDownStyle GetDropDownStyle()
115         {
116             return new DropDownStyle
117             {
118                 Position = new Position(50, 50),
119                 Button = new ButtonStyle
120                 {
121                     ParentOrigin = ParentOrigin.TopLeft,
122                     PivotPoint = PivotPoint.TopLeft,
123                     BackgroundImage = new Selector<string>
124                     {
125                         Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_n.png"),
126                         Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_p.png")
127                     },
128                     BackgroundImageBorder = (Rectangle)6,
129                     Text = new TextLabelStyle
130                     {
131                         Text = "Select an item",
132                         PointSize = StyleManager.PointSizeNormal,
133                         TextColor = Color.Black,
134                     },
135                     Icon = new ImageViewStyle
136                     {
137                         Size = new Size(28, 28),
138                         ResourceUrl = StyleManager.GetFrameworkResourcePath("nui_component_default_dropdown_button_icon.png"),
139                     },
140                     IconRelativeOrientation = Button.IconOrientation.Right,
141                     IconPadding = 6,
142                 },
143                 ListBackgroundImage = new ImageViewStyle
144                 {
145                     ResourceUrl = StyleManager.GetFrameworkResourcePath("nui_component_default_dropdown_list_bg.png"),
146                     Border = (Rectangle)6,
147                     Size = new Size(280, 360),
148                 },
149                 SpaceBetweenButtonTextAndIcon = 10,
150                 ListPadding = 5,
151             };
152         }
153
154         protected override DropDownItemStyle GetDropDownItemStyle()
155         {
156             return new DropDownItemStyle
157             {
158                 Size = new Size(360, 50),
159                 BackgroundColor = new Selector<Color>
160                 {
161                     Pressed = new Color(0.05f, 0.63f, 0.9f, 1),
162                     Selected = new Color(0.8f, 0.8f, 0.8f, 1),
163                     Normal = new Color(1, 1, 1, 1),
164                 },
165                 Text = new TextLabelStyle
166                 {
167                     PointSize = StyleManager.PointSizeNormal,
168                     Position = new Position(28, 0),
169                     Text = "List item",
170                 },
171             };
172         }
173
174         protected override PopupStyle GetPopupStyle()
175         {
176             return new PopupStyle
177             {
178                 Size = new Size(500, 280),
179                 BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1),
180                 ImageShadow = new ImageShadow
181                 {
182                     Url = StyleManager.GetFrameworkResourcePath("nui_component_default_popup_shadow.png"),
183                     Border = new Rectangle(24, 24, 24, 24),
184                     Offset = new Vector2(-24, -24),
185                     Extents = new Vector2(48, 48),
186                 },
187                 Title = new TextLabelStyle
188                 {
189                     PointSize = 16,
190                     TextColor = Color.Black,
191                     PositionUsesPivotPoint = true,
192                     ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
193                     PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
194                     HorizontalAlignment = HorizontalAlignment.Begin,
195                     VerticalAlignment = VerticalAlignment.Bottom,
196                     Padding = 20,
197                     Text = "Title",
198                 },
199                 Buttons = new ButtonStyle
200                 {
201                     Size = new Size(0, 80),
202                     PositionUsesPivotPoint = true,
203                     ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
204                     PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
205                     BackgroundColor = new Selector<Color>
206                     {
207                         Normal = new Color(1, 1, 1, 1),
208                         Pressed = new Color(1, 1, 1, 0.5f),
209                     },
210                     Overlay = new ImageViewStyle
211                     {
212                         PositionUsesPivotPoint = true,
213                         ParentOrigin = Tizen.NUI.ParentOrigin.Center,
214                         PivotPoint = Tizen.NUI.PivotPoint.Center,
215                         WidthResizePolicy = ResizePolicyType.FillToParent,
216                         HeightResizePolicy = ResizePolicyType.FillToParent,
217                         BackgroundColor = new Selector<Color>
218                         {
219                             Normal = new Color(1.0f, 1.0f, 1.0f, 1.0f),
220                             Pressed = new Color(0.0f, 0.0f, 0.0f, 0.1f),
221                             Selected = new Color(1.0f, 1.0f, 1.0f, 1.0f),
222                         }
223                     },
224                     Text = new TextLabelStyle
225                     {
226                         PositionUsesPivotPoint = true,
227                         ParentOrigin = Tizen.NUI.ParentOrigin.Center,
228                         PivotPoint = Tizen.NUI.PivotPoint.Center,
229                         HorizontalAlignment = HorizontalAlignment.Center,
230                         VerticalAlignment = VerticalAlignment.Center,
231                         TextColor = new Color(0.05f, 0.63f, 0.9f, 1)
232                     },
233                 },
234             };
235         }
236
237         protected override ProgressStyle GetProgressStyle()
238         {
239             return new ProgressStyle
240             {
241                 Size = new Size(200, 5),
242                 Track = new ImageViewStyle
243                 {
244                     BackgroundColor = new Color(0, 0, 0, 0.1f),
245                 },
246                 Buffer = new ImageViewStyle
247                 {
248                     BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 0.3f)
249                 },
250                 Progress = new ImageViewStyle
251                 {
252                     BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1)
253                 },
254             };
255         }
256
257         protected override ButtonStyle GetRadioButtonStyle()
258         {
259             return new ButtonStyle
260             {
261                 Size = new Size(30, 30),
262                 Icon = new ImageViewStyle
263                 {
264                     WidthResizePolicy = ResizePolicyType.DimensionDependency,
265                     HeightResizePolicy = ResizePolicyType.SizeRelativeToParent,
266                     SizeModeFactor = new Vector3(1, 1, 1),
267                     Opacity = new Selector<float?>
268                     {
269                         Normal = 1.0f,
270                         Selected = 1.0f,
271                         Disabled = 0.4f,
272                         DisabledSelected = 0.4f
273                     },
274                     BackgroundImage = new Selector<string>
275                     {
276                         Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_n.png"),
277                         Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_p.png"),
278                         Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_s.png"),
279                         Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_n.png"),
280                         DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_s.png"),
281                     }
282                 },
283                 Text = new TextLabelStyle
284                 {
285                     PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
286                     WidthResizePolicy = ResizePolicyType.FillToParent,
287                     HeightResizePolicy = ResizePolicyType.FillToParent,
288                     HorizontalAlignment = HorizontalAlignment.Center,
289                     VerticalAlignment = VerticalAlignment.Center,
290                     TextColor = new Selector<Color>
291                     {
292                         Normal = new Color(0.22f, 0.22f, 0.22f, 1),
293                         Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
294                         Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
295                     }
296                 }
297             };
298         }
299
300         protected override SliderStyle GetSliderStyle()
301         {
302             return new SliderStyle
303             {
304                 Size = new Size(200, 50),
305                 TrackThickness = 5,
306                 Track = new ImageViewStyle
307                 {
308                     BackgroundColor = new Color(0, 0, 0, 0.1f),
309                 },
310
311                 Progress = new ImageViewStyle
312                 {
313                     BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
314                 },
315
316                 Thumb = new ImageViewStyle
317                 {
318                     Size = new Size(50, 50),
319                     ResourceUrl = StyleManager.GetFrameworkResourcePath("nui_component_default_slider_thumb_n.png"),
320                     BackgroundImage = new Selector<string>
321                     {
322                         Normal = "",
323                         Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_slider_thumb_bg_p.png"),
324                     }
325                 },
326
327             };
328         }
329
330         protected override SwitchStyle GetSwitchStyle()
331         {
332             return new SwitchStyle
333             {
334                 Size = new Size(96, 60),
335                 Track = new ImageViewStyle
336                 {
337                     Size = new Size(96, 60),
338                     ResourceUrl = new Selector<string>
339                     {
340                         Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_n.png"),
341                         Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_s.png"),
342                         Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_d.png"),
343                         DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_ds.png"),
344                     },
345                     Border = new Rectangle(30, 30, 30, 30),
346                 },
347                 Thumb = new ImageViewStyle
348                 {
349                     Size = new Size(60, 60),
350                     ResourceUrl = new Selector<string>
351                     {
352                         Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_n.png"),
353                         Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_n.png"),
354                         Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_d.png"),
355                         DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_d.png"),
356                     },
357                 },
358                 Text = new TextLabelStyle
359                 {
360                     PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
361                     WidthResizePolicy = ResizePolicyType.FillToParent,
362                     HeightResizePolicy = ResizePolicyType.FillToParent,
363                     HorizontalAlignment = HorizontalAlignment.Center,
364                     VerticalAlignment = VerticalAlignment.Center,
365                     TextColor = new Selector<Color>
366                     {
367                         Normal = new Color(0.22f, 0.22f, 0.22f, 1),
368                         Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
369                         Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
370                     }
371                 },
372             };
373         }
374
375         protected override TabStyle GetTabStyle()
376         {
377             return new TabStyle
378             {
379                 BackgroundColor = Color.Yellow,
380                 Size = new Size(480, 80),
381                 UnderLine = new ViewStyle
382                 {
383                     Size = new Size(0, 6),
384                     PositionUsesPivotPoint = true,
385                     ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
386                     PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
387                     BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
388                 },
389                 Text = new TextLabelStyle
390                 {
391                     PointSize = StyleManager.PointSizeTitle,
392                     TextColor = new Selector<Color>
393                     {
394                         Normal = Color.Black,
395                         Selected = new Color(0.05f, 0.63f, 0.9f, 1),
396                     },
397                 },
398             };
399         }
400
401         protected override ToastStyle GetToastStyle()
402         {
403             return new ToastStyle
404             {
405                 WidthResizePolicy = ResizePolicyType.FitToChildren,
406                 HeightResizePolicy = ResizePolicyType.FitToChildren,
407                 BackgroundColor = new Color(0, 0, 0, 0.8f),
408                 Text = new TextLabelStyle()
409                 {
410                     PositionUsesPivotPoint = true,
411                     ParentOrigin = Tizen.NUI.ParentOrigin.Center,
412                     PivotPoint = Tizen.NUI.PivotPoint.Center,
413                     WidthResizePolicy = ResizePolicyType.UseNaturalSize,
414                     HeightResizePolicy = ResizePolicyType.UseNaturalSize,
415                     HorizontalAlignment = HorizontalAlignment.Center,
416                     VerticalAlignment = VerticalAlignment.Center,
417                     TextColor = Color.White,
418                     Padding = new Extents(12, 12, 8, 8),
419                 }
420             };
421         }
422
423         protected override LoadingStyle GetLoadingStyle()
424         {
425             return new LoadingStyle
426             {
427                 LoadingSize = new Size(100, 100)
428             };
429         }
430
431         protected override PaginationStyle GetPaginationStyle()
432         {
433             return new PaginationStyle
434             {
435                 IndicatorImageURL = new Selector<string>()
436                 {
437                     Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_normal_dot.png"),
438                     Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_focus_dot.png"),
439                 },
440             };
441         }
442     }
443 }