68ee4117f072b790b7c444c5bae057545f56e9ea
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / PreloadStyle / WearableTheme.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 using Tizen.NUI.Components.Extension;
20
21 namespace Tizen.NUI.Components
22 {
23     /// <summary>
24     /// Interface that includes styles for all components for a wearable theme
25     /// </summary>
26     [EditorBrowsable(EditorBrowsableState.Never)]
27     internal class WearableTheme : DefaultTheme
28     {
29         internal static new Theme Instance { get; } = new WearableTheme();
30
31         private WearableTheme() : base()
32         {
33         }
34
35         protected override ButtonStyle GetButtonStyle()
36         {
37             return new ButtonStyle
38             {
39                 Size = new Size(210, 72),
40                 CornerRadius = 36,
41                 BackgroundColor = new Selector<Color>
42                 {
43                     Normal = new Color(0, 42f/255f, 77f/255f, 0.85f),
44                     Pressed = new Color(0, 70f/255f, 128f/255f, 0.85f),
45                     Disabled = new Color(61f/255f, 61f/255f, 61f/255f, 0.85f),
46                 },
47                 Text = new TextLabelStyle
48                 {
49                     FontFamily = "SamsungOne 700",
50                     PixelSize = 28,
51                     TextColor = new Selector<Color>
52                     {
53                         Normal = new Color(56f/255f, 164f/255f, 252f/255f, 1),
54                         Pressed = new Color(56f/255f, 164f/255f, 252f/255f, 1),
55                         Disabled = new Color(1, 1, 1, 0.35f),
56                     },
57                     Padding = new Extents(20, 20, 0, 0),
58                     VerticalAlignment = VerticalAlignment.Center,
59                     HorizontalAlignment = HorizontalAlignment.Center,
60                 },
61                 Opacity = new Selector<float?>
62                 {
63                     Other = 1.0f,
64                     Disabled = 0.3f,
65                 }
66             };
67         }
68
69         protected override ButtonStyle GetCheckBoxStyle()
70         {
71             return new LottieButtonStyle
72             {
73                 LottieUrl = StyleManager.GetFrameworkResourcePath("nui_wearable_checkbox_icon.json"),
74                 PlayRange = new Selector<LottieFrameInfo>
75                 {
76                     Selected = (0, 18),
77                     Normal = (19, 36)
78                 },
79                 Opacity = new Selector<float?>
80                 {
81                     Other = 1.0f,
82                     Pressed = 0.6f,
83                     Disabled = 0.3f,
84                 },
85             };
86         }
87
88         protected override ButtonStyle GetRadioButtonStyle()
89         {
90             return new LottieButtonStyle
91             {
92                 LottieUrl = StyleManager.GetFrameworkResourcePath("nui_wearable_radiobutton_icon.json"),
93                 PlayRange = new Selector<LottieFrameInfo>
94                 {
95                     Selected = (0, 12),
96                     Normal = (13, 25)
97                 },
98                 Opacity = new Selector<float?>
99                 {
100                     Other = 1.0f,
101                     Pressed = 0.6f,
102                     Disabled = 0.3f,
103                 },
104             };
105         }
106
107         protected override SwitchStyle GetSwitchStyle()
108         {
109             return new LottieSwitchStyle
110             {
111                 LottieUrl = StyleManager.GetFrameworkResourcePath("nui_wearable_switch_icon.json"),
112                 PlayRange = new Selector<LottieFrameInfo>
113                 {
114                     Selected = (0, 18),
115                     Normal = (19, 36)
116                 },
117                 Opacity = new Selector<float?>
118                 {
119                     Other = 1.0f,
120                     Pressed = 0.6f,
121                     Disabled = 0.3f,
122                 },
123             };
124         }
125
126         protected override LoadingStyle GetLoadingStyle()
127         {
128             return new LoadingStyle
129             {
130                 LoadingSize = new Size(360, 360)
131             };
132         }
133
134         protected override PaginationStyle GetPaginationStyle()
135         {
136             return new PaginationStyle
137             {
138                 IndicatorImageURL = new Selector<string>()
139                 {
140                     Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_normal_dot.png"),
141                     Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_focus_dot.png"),
142                 },
143             };
144         }
145     }
146 }