[NUI] CheckBox, RadioButton and Switch can place text without setting text size ...
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Theme / DefaultThemeWearable.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
18 #if PROFILE_WEARABLE
19
20 using Tizen.NUI.BaseComponents;
21 using Tizen.NUI.Components.Extension;
22
23 namespace Tizen.NUI.Components
24 {
25     // It is a C# version of res/Tizen.NUI.Components_Tizen.NUI.Theme.Wearable.xaml
26     internal partial class DefaultThemeCreator : IThemeCreator
27     {
28         public Theme Create()
29         {
30             var theme = new Theme()
31             {
32                 Id = Tizen.NUI.DefaultThemeCreator.DefaultId,
33                 Version = Tizen.NUI.DefaultThemeCreator.DefaultVersion
34             };
35
36             theme.AddStyleWithoutClone("Tizen.NUI.Components.Popup", new PopupStyle()
37             {
38                 Size = new Size(500, 280),
39                 BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1),
40                 ImageShadow = new ImageShadow()
41                 {
42                     Url = FrameworkInformation.ResourcePath + "nui_component_default_popup_shadow.png",
43                     Border = new Rectangle(24, 24, 24, 24),
44                     Extents = new Vector2(48, 48)
45                 },
46                 Title = new TextLabelStyle()
47                 {
48                     PointSize = 16,
49                     Padding = new Extents(20, 20, 20, 20),
50                 },
51                 Buttons = new ButtonStyle()
52                 {
53                     Size = new Size(0, 80),
54                     BackgroundColor = new Selector<Color>()
55                     {
56                         Normal = new Color(1, 1, 1, 1),
57                         Pressed = new Color(1, 1, 1, 0.5f),
58                     },
59                     Overlay = new ImageViewStyle()
60                     {
61                         BackgroundColor = new Selector<Color>()
62                         {
63                             Pressed = new Color(0, 0, 0, 0.1f),
64                             Other = new Color(1, 1, 1, 1),
65                         },
66                     },
67                     Text = new TextLabelStyle()
68                     {
69                         TextColor = new Color(0.05f, 0.63f, 0.9f, 1),
70                     }
71                 }
72             });
73
74             theme.AddStyleWithoutClone("Tizen.NUI.Components.Progress", new ProgressStyle()
75             {
76                 Size = new Size(200, 5),
77                 Track = new ImageViewStyle()
78                 {
79                     BackgroundColor = new Color(0, 0, 0, 0.1f),
80                 },
81                 Buffer = new ImageViewStyle()
82                 {
83                     BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 0.3f),
84                 },
85                 Progress = new ImageViewStyle()
86                 {
87                     BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
88                 },
89             });
90
91             theme.AddStyleWithoutClone("Tizen.NUI.Components.Slider", new SliderStyle()
92             {
93                 Size = new Size(200, 50),
94                 TrackThickness = 5,
95                 Track = new ImageViewStyle()
96                 {
97                     BackgroundColor = new Color(0, 0, 0, 0.1f),
98                 },
99                 Progress = new ImageViewStyle()
100                 {
101                     BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
102                 },
103                 Thumb = new ImageViewStyle()
104                 {
105                     Size = new Size(50, 50),
106                     ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_n.png",
107                     BackgroundImage = new Selector<string>()
108                     {
109                         Normal = "",
110                         Pressed = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
111                     }
112                 },
113             });
114
115             theme.AddStyleWithoutClone("Tizen.NUI.Components.Tab", new TabStyle()
116             {
117                 Size = new Size(480, 80),
118                 BackgroundColor = Color.Yellow,
119                 UnderLine = new ViewStyle()
120                 {
121                     Size = new Size(0, 6),
122                     BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
123                 },
124                 Text = new TextLabelStyle()
125                 {
126                     PointSize = 16,
127                     TextColor = new Selector<Color>()
128                     {
129                         Normal = Color.Black,
130                         Selected = new Color(0.05f, 0.63f, 0.9f, 1),
131                     }
132                 }
133             });
134
135             theme.AddStyleWithoutClone("Tizen.NUI.Components.Toast", new ToastStyle()
136             {
137                 Size = new Size(480, 80),
138                 BackgroundColor = new Color(0, 0, 0, 0.8f),
139                 Text = new TextLabelStyle()
140                 {
141                     Padding = new Extents(12, 12, 8, 8)
142                 }
143             });
144
145             theme.AddStyleWithoutClone("Tizen.NUI.Components.Pagination", new PaginationStyle()
146             {
147                 IndicatorImageUrl = new Selector<string>()
148                 {
149                     Normal = FrameworkInformation.ResourcePath + "nui_component_default_pagination_normal_dot.png",
150                     Selected = FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
151                 }
152             });
153
154             theme.AddStyleWithoutClone("Tizen.NUI.Components.Scrollbar", new ScrollbarStyle()
155             {
156                 TrackThickness = 6,
157                 ThumbThickness = 6,
158                 TrackColor = new Color(1, 1, 1, 0.15f),
159                 ThumbColor = new Color(0.6f, 0.6f, 0.6f, 1),
160                 TrackPadding = 4
161             });
162
163             theme.AddStyleWithoutClone("Tizen.NUI.Components.Button", new ButtonStyle()
164             {
165                 Size = new Size(210, 72),
166                 CornerRadius = 36,
167                 BackgroundColor = new Selector<Color>()
168                 {
169                     Normal = new Color(0, 0.1647f, 0.3019f, 0.85f),
170                     Pressed = new Color(0, 0.2475f, 0.5019f, 0.85f),
171                     Disabled = new Color(0.2392f, 0.2392f, 0.2392f, 0.85f),
172                 },
173                 Opacity = new Selector<float?>()
174                 {
175                     Other = 1.0f,
176                     Disabled = 0.3f,
177                 },
178                 Text = new TextLabelStyle()
179                 {
180                     FontFamily = "SamsungOne 700",
181                     PixelSize = 28,
182                     Padding = new Extents(20, 20, 0, 0),
183                     HorizontalAlignment = HorizontalAlignment.Center,
184                     VerticalAlignment = VerticalAlignment.Center,
185                     TextColor = new Selector<Color>()
186                     {
187                         Normal = new Color(0.2196f, 0.6131f, 0.9882f, 1),
188                         Disabled = new Color(1, 1, 1, 0.35f),
189                     }
190                 }
191             });
192
193             theme.AddStyleWithoutClone("Tizen.NUI.Components.CheckBox", new LottieButtonStyle()
194             {
195                 LottieUrl = FrameworkInformation.ResourcePath + "nui_wearable_checkbox_icon.png",
196                 PlayRange = new Selector<LottieFrameInfo>()
197                 {
198                     Selected = new LottieFrameInfo(19, 36),
199                     Normal = new LottieFrameInfo(0, 18)
200                 },
201                 Opacity = new Selector<float?>()
202                 {
203                     Other = 1.0f,
204                     Pressed = 0.6f,
205                     Disabled = 0.3f,
206                 },
207             });
208
209             theme.AddStyleWithoutClone("Tizen.NUI.Components.RadioButton", new LottieButtonStyle()
210             {
211                 LottieUrl = FrameworkInformation.ResourcePath + "nui_wearable_radiobutton_icon.png",
212                 PlayRange = new Selector<LottieFrameInfo>()
213                 {
214                     Selected = new LottieFrameInfo(0, 12),
215                     Normal = new LottieFrameInfo(13, 25)
216                 },
217                 Opacity = new Selector<float?>()
218                 {
219                     Other = 1.0f,
220                     Pressed = 0.6f,
221                     Disabled = 0.3f,
222                 },
223             });
224
225             theme.AddStyleWithoutClone("Tizen.NUI.Components.Switch", new LottieSwitchStyle()
226             {
227                 LottieUrl = FrameworkInformation.ResourcePath + "nui_wearable_switch_icon.png",
228                 PlayRange = new Selector<LottieFrameInfo>()
229                 {
230                     Selected = new LottieFrameInfo(0, 18),
231                     Normal = new LottieFrameInfo(19, 36)
232                 },
233                 Opacity = new Selector<float?>()
234                 {
235                     Other = 1.0f,
236                     Pressed = 0.6f,
237                     Disabled = 0.3f,
238                 },
239             });
240
241             theme.AddStyleWithoutClone("Tizen.NUI.Components.Loading", new LoadingStyle()
242             {
243                 LoadingSize = new Size(360, 360),
244             });
245
246             return theme;
247         }
248     }
249 }
250
251 #endif