[NUI] Merge Button action state and support experimental theme by profile. (#1525)
authorJiyun Yang <ji.yang@samsung.com>
Thu, 9 Apr 2020 04:51:56 +0000 (13:51 +0900)
committerGitHub <noreply@github.com>
Thu, 9 Apr 2020 04:51:56 +0000 (13:51 +0900)
* Fix a bug in LottieFrameInfo.Show()
* Introduce ThemeStyle
* Merge Button action state to View.ControlStates

Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
34 files changed:
src/Tizen.NUI.Components/Controls/Button.cs
src/Tizen.NUI.Components/Controls/Control.cs
src/Tizen.NUI.Components/Controls/DropDown.cs
src/Tizen.NUI.Components/Controls/Extension/LottieButtonExtension.cs
src/Tizen.NUI.Components/PreloadStyle/DefaultButtonStyle.cs [deleted file]
src/Tizen.NUI.Components/PreloadStyle/DefaultCheckBoxStyle.cs [deleted file]
src/Tizen.NUI.Components/PreloadStyle/DefaultDropDownStyle.cs [deleted file]
src/Tizen.NUI.Components/PreloadStyle/DefaultPopupStyle.cs [deleted file]
src/Tizen.NUI.Components/PreloadStyle/DefaultProgressStyle.cs [deleted file]
src/Tizen.NUI.Components/PreloadStyle/DefaultRadioButtonStyle.cs [deleted file]
src/Tizen.NUI.Components/PreloadStyle/DefaultSliderStyle.cs [deleted file]
src/Tizen.NUI.Components/PreloadStyle/DefaultStyle.cs [deleted file]
src/Tizen.NUI.Components/PreloadStyle/DefaultSwitchStyle.cs [deleted file]
src/Tizen.NUI.Components/PreloadStyle/DefaultTabStyle.cs [deleted file]
src/Tizen.NUI.Components/PreloadStyle/DefaultTheme.cs [new file with mode: 0644]
src/Tizen.NUI.Components/PreloadStyle/DefaultToastStyle.cs [deleted file]
src/Tizen.NUI.Components/PreloadStyle/OverlayAnimationButtonStyle.cs [moved from src/Tizen.NUI.Wearable/src/public/Style/OverlayAnimationButtonStyle.cs with 95% similarity]
src/Tizen.NUI.Components/PreloadStyle/WearableTheme.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Style/ButtonStyle.cs
src/Tizen.NUI.Components/Style/Extension/ILottieButtonStyle.cs
src/Tizen.NUI.Components/Style/Extension/LottieButtonStyle.cs
src/Tizen.NUI.Components/Style/Extension/LottieSwitchStyle.cs
src/Tizen.NUI.Components/Style/Theme.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Tizen.NUI.Components.csproj
src/Tizen.NUI.Components/Utils/StyleManager.cs
src/Tizen.NUI.Wearable/src/public/Style/WearableButtonStyle.cs [deleted file]
src/Tizen.NUI.Wearable/src/public/Style/WearableCheckBoxStyle.cs [deleted file]
src/Tizen.NUI.Wearable/src/public/Style/WearableRadioButtonStyle.cs [deleted file]
src/Tizen.NUI.Wearable/src/public/Style/WearableStyle.cs [deleted file]
src/Tizen.NUI.Wearable/src/public/Style/WearableSwitchStyle.cs [deleted file]
src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs
src/Tizen.NUI/src/public/BaseComponents/Style/Constants.cs
src/Tizen.NUI/src/public/BaseComponents/Style/Selector.cs
src/Tizen.NUI/src/public/BaseComponents/View.cs

index ec6a25b..e150f44 100755 (executable)
@@ -842,13 +842,24 @@ namespace Tizen.NUI.Components
             ControlStates sourceState = ControlState;
             ControlStates targetState;
 
-            if(isEnabled)
+            if (isEnabled)
             {
-                targetState = isPressed ? ControlStates.Pressed : (IsFocused ? (IsSelected ? ControlStates.SelectedFocused : ControlStates.Focused) : (IsSelected ? ControlStates.Selected : ControlStates.Normal));
+                // Normal
+                targetState = ControlStates.Normal;
+
+                // Selected
+                targetState |= (IsSelected ? ControlStates.Selected : 0);
+
+                // Pressed, PressedSelected, Focused, SelectedFocused
+                targetState |= (isPressed ? ControlStates.Pressed : (IsFocused ? ControlStates.Focused : 0));
             }
             else
             {
-                targetState = IsSelected ? ControlStates.DisabledSelected : (IsFocused ? ControlStates.DisabledFocused : ControlStates.Disabled);
+                // Disabled
+                targetState = ControlStates.Disabled;
+
+                // DisabledSelected, DisabledFocused
+                targetState |= (IsSelected ? ControlStates.Selected : (IsFocused ? ControlStates.Focused : 0));
             }
 
             if (SetControlState(targetState, touchInfo))
@@ -1131,55 +1142,6 @@ namespace Tizen.NUI.Components
         }
 
         /// <summary>
-        /// A Selector class that describes Buttons state by actions.
-        /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public class ActionSelector<T>
-        {
-            /// <summary>
-            /// Value used when the Button is created.
-            /// </summary>
-            [EditorBrowsable(EditorBrowsableState.Never)]
-            public T OnCreate { get; set; }
-
-            /// <summary>
-            /// Value used when the Button is selected.
-            /// </summary>
-            [EditorBrowsable(EditorBrowsableState.Never)]
-            public T OnSelect { get; set; }
-
-            /// <summary>
-            /// Value used when the Button is unselected.
-            /// </summary>
-            [EditorBrowsable(EditorBrowsableState.Never)]
-            public T OnUnselect { get; set; }
-
-            /// <summary>
-            /// Value used when the Button is disabled.
-            /// </summary>
-            [EditorBrowsable(EditorBrowsableState.Never)]
-            public T OnDisable { get; set; }
-
-            /// <summary>
-            /// Value used when the Button is disabled in selected state.
-            /// </summary>
-            [EditorBrowsable(EditorBrowsableState.Never)]
-            public T OnDisableSelected { get; set; }
-
-            /// <summary>
-            /// Value used when the Button is pressed.
-            /// </summary>
-            [EditorBrowsable(EditorBrowsableState.Never)]
-            public T OnPress { get; set; }
-
-            /// <summary>
-            /// Value used when the Button is pressed in selected state.
-            /// </summary>
-            [EditorBrowsable(EditorBrowsableState.Never)]
-            public T OnPressSelected { get; set; }
-        }
-
-        /// <summary>
         /// Get current text part to the attached ButtonExtension.
         /// </summary>
         /// <remarks>
index 7055824..9a178b0 100755 (executable)
@@ -212,14 +212,14 @@ namespace Tizen.NUI.Components
             {
                 case PointStateType.Down:
                     ControlState = ControlStates.Pressed;
-                    return true;
+                    break;
                 case PointStateType.Interrupted:
                 case PointStateType.Up:
                     if (ControlState == ControlStates.Pressed)
                     {
                         ControlState = ControlStates.Normal;
                     }
-                    return true;
+                    break;
                 default:
                     break;
             }
index d539b79..1603c3c 100755 (executable)
@@ -439,7 +439,7 @@ namespace Tizen.NUI.Components
             if (null != buttonText)
             {
                 buttonText.Text = Style.Button.Text.Text.All;
-                buttonText.PointSize = Style.Button.Text.PointSize?.GetValue(ControlState) ?? DefaultStyle.PointSizeNormal;
+                buttonText.PointSize = Style.Button.Text.PointSize?.GetValue(ControlState) ?? StyleManager.PointSizeNormal;
                 buttonTextWidth = buttonText.NaturalSize.Width;
             }
             float fitWidth = (Style.Button.Icon.Size?.Width ?? 48) + Style.SpaceBetweenButtonTextAndIcon + buttonTextWidth;
index da50bc8..b884f00 100644 (file)
@@ -70,48 +70,12 @@ namespace Tizen.NUI.Components.Extension
             var lottieStyle = (ILottieButtonStyle)button.Style;
             lottieView.URL = lottieStyle.LottieUrl;
             lottieView.StopBehavior = LottieAnimationView.StopBehaviorType.MaximumFrame;
-            lottieStyle.LottieFrameInfo.OnCreate?.Show(lottieView, true);
+            lottieStyle.PlayRange?.GetValue(ControlStates.Normal)?.Show(lottieView, true);
         }
 
         internal static void UpdateLottieView(Button button, ControlStates previousState, Touch touchInfo, LottieAnimationView lottieView)
         {
-            var lottieStyle = (ILottieButtonStyle)button.Style;
-
-            switch (button.ControlState)
-            {
-                case ControlStates.Normal:
-                    lottieStyle.LottieFrameInfo?.OnUnselect?.Show(lottieView, previousState == ControlStates.Disabled);
-                    break;
-
-                case ControlStates.Focused:
-                    lottieStyle.LottieFrameInfo?.OnUnselect?.Show(lottieView, previousState == ControlStates.DisabledFocused);
-                    break;
-
-                case ControlStates.Selected:
-                case ControlStates.SelectedFocused:
-                    lottieStyle.LottieFrameInfo?.OnSelect?.Show(lottieView);
-                    break;
-
-                case ControlStates.Disabled:
-                case ControlStates.DisabledFocused:
-                    lottieStyle.LottieFrameInfo?.OnDisable?.Show(lottieView);
-                    break;
-
-                case ControlStates.DisabledSelected:
-                    lottieStyle.LottieFrameInfo?.OnDisableSelected?.Show(lottieView);
-                    break;
-
-                case ControlStates.Pressed:
-                    if (button.IsSelected)
-                    {
-                        lottieStyle.LottieFrameInfo?.OnPressSelected?.Show(lottieView);
-                    }
-                    else
-                    {
-                        lottieStyle.LottieFrameInfo?.OnPress?.Show(lottieView);
-                    }
-                    break;
-            }
+            ((ILottieButtonStyle)button.Style).PlayRange?.GetValue(button.ControlState)?.Show(lottieView, ((int)previousState & (int)ControlStates.Pressed) == 0);
         }
     }
 }
diff --git a/src/Tizen.NUI.Components/PreloadStyle/DefaultButtonStyle.cs b/src/Tizen.NUI.Components/PreloadStyle/DefaultButtonStyle.cs
deleted file mode 100755 (executable)
index 9e4bb20..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI.Components
-{
-    /// <summary>
-    /// The default Button style
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    public class DefaultButtonStyle : StyleBase
-    {
-        /// <summary>
-        /// Return default Button style
-        /// </summary>
-        internal protected override ViewStyle GetViewStyle()
-        {
-            ButtonStyle style = new ButtonStyle
-            {
-                Size = new Size(100, 45),
-                BackgroundColor = new Selector<Color>
-                {
-                    Normal = new Color(0.88f, 0.88f, 0.88f, 1),
-                    Pressed = new Color(0.77f, 0.77f, 0.77f, 1),
-                    Disabled = new Color(0.88f, 0.88f, 0.88f, 1)
-                },
-                Text = new TextLabelStyle
-                {
-                    PointSize = new Selector<float?> { All = DefaultStyle.PointSizeNormal },
-                    WidthResizePolicy = ResizePolicyType.FillToParent,
-                    HeightResizePolicy = ResizePolicyType.FillToParent,
-                    HorizontalAlignment = HorizontalAlignment.Center,
-                    VerticalAlignment = VerticalAlignment.Center,
-                    TextColor = new Selector<Color>
-                    {
-                        Normal = new Color(0.22f, 0.22f, 0.22f, 1),
-                        Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
-                        Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
-                    },
-                    Text = "Button",
-                }
-            };
-            return style;
-        }
-    }
-}
diff --git a/src/Tizen.NUI.Components/PreloadStyle/DefaultCheckBoxStyle.cs b/src/Tizen.NUI.Components/PreloadStyle/DefaultCheckBoxStyle.cs
deleted file mode 100755 (executable)
index 3dfdeb7..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI.Components
-{
-    /// <summary>
-    /// The default CheckBox style
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    public class DefaultCheckBoxStyle : StyleBase
-    {
-        /// <summary>
-        /// Return default CheckBox style
-        /// </summary>
-        internal protected override ViewStyle GetViewStyle()
-        {
-            ButtonStyle style = new ButtonStyle
-            {
-                Size = new Size(30, 30),
-                Icon = new ImageViewStyle
-                {
-                    WidthResizePolicy = ResizePolicyType.DimensionDependency,
-                    HeightResizePolicy = ResizePolicyType.SizeRelativeToParent,
-                    SizeModeFactor = new Vector3(1, 1, 1),
-                    Opacity = new Selector<float?>
-                    {
-                        Normal = 1.0f,
-                        Selected = 1.0f,
-                        Disabled = 0.4f,
-                        DisabledSelected = 0.4f
-                    },
-                    BackgroundImage = new Selector<string>
-                    {
-                        Normal = DefaultStyle.GetResourcePath("nui_component_default_checkbox_bg_n.png"),
-                        Pressed = DefaultStyle.GetResourcePath("nui_component_default_checkbox_bg_p.png"),
-                        Selected = DefaultStyle.GetResourcePath("nui_component_default_checkbox_bg_p.png"),
-                        Disabled = DefaultStyle.GetResourcePath("nui_component_default_checkbox_bg_n.png"),
-                        DisabledSelected = DefaultStyle.GetResourcePath("nui_component_default_checkbox_bg_p.png"),
-                    },
-                    ResourceUrl = new Selector<string>
-                    {
-                        Normal = "",
-                        Pressed = "",
-                        Selected = DefaultStyle.GetResourcePath("nui_component_default_checkbox_s.png"),
-                        Disabled = "",
-                        DisabledSelected = DefaultStyle.GetResourcePath("nui_component_default_checkbox_s.png"),
-                    }
-                },
-                Text = new TextLabelStyle
-                {
-                    PointSize = new Selector<float?> { All = DefaultStyle.PointSizeNormal },
-                    WidthResizePolicy = ResizePolicyType.FillToParent,
-                    HeightResizePolicy = ResizePolicyType.FillToParent,
-                    HorizontalAlignment = HorizontalAlignment.Center,
-                    VerticalAlignment = VerticalAlignment.Center,
-                    TextColor = new Selector<Color>
-                    {
-                        Normal = new Color(0.22f, 0.22f, 0.22f, 1),
-                        Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
-                        Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
-                    }
-                }
-            };
-            return style;
-        }
-    }
-}
diff --git a/src/Tizen.NUI.Components/PreloadStyle/DefaultDropDownStyle.cs b/src/Tizen.NUI.Components/PreloadStyle/DefaultDropDownStyle.cs
deleted file mode 100755 (executable)
index e2ba859..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI.Components
-{
-    /// <summary>
-    /// The default DropDown style
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    public class DefaultDropDownStyle : StyleBase
-    {
-        /// <summary>
-        /// Return default DropDown style
-        /// </summary>
-        internal protected override ViewStyle GetViewStyle()
-        {
-            DropDownStyle style = new DropDownStyle
-            {
-                Position = new Position(50, 50),
-                // WidthResizePolicy = ResizePolicyType.FitToChildren,
-                // HeightResizePolicy = ResizePolicyType.FitToChildren,
-                // HeaderText = new TextLabelStyle
-                // {
-                //     Text = new Selector<string> { All = "TitleArea" },
-                //     PointSize = new Selector<float?> { All = 28 },
-                //     TextColor = new Selector<Color> { All = new Color(0, 0, 0, 1) },
-                //     FontFamily = "SamsungOneUI 500C",
-                // },
-                // BackgroundColor = new Selector<Color> { All = new Color(1, 1, 1, 1) },
-
-                Button = new ButtonStyle
-                {
-                    ParentOrigin = ParentOrigin.TopLeft,
-                    PivotPoint = PivotPoint.TopLeft,
-                    BackgroundImage = new Selector<string>
-                    {
-                        Normal = DefaultStyle.GetResourcePath("nui_component_default_checkbox_bg_n.png"),
-                        Pressed = DefaultStyle.GetResourcePath("nui_component_default_checkbox_bg_p.png")
-                    },
-                    BackgroundImageBorder = (Rectangle)6,
-                    Text = new TextLabelStyle
-                    {
-                        Text = "Select an item",
-                        PointSize = DefaultStyle.PointSizeNormal,
-                        TextColor = Color.Black,
-                    },
-                    Icon = new ImageViewStyle
-                    {
-                        Size = new Size(28, 28),
-                        ResourceUrl = DefaultStyle.GetResourcePath("nui_component_default_dropdown_button_icon.png"),
-                    },
-                    IconRelativeOrientation = Button.IconOrientation.Right,
-                    IconPadding = 6,
-                },
-                ListBackgroundImage = new ImageViewStyle
-                {
-                    ResourceUrl = DefaultStyle.GetResourcePath("nui_component_default_dropdown_list_bg.png"),
-                    Border = (Rectangle)6,
-                    Size = new Size(280, 360),
-                },
-                SpaceBetweenButtonTextAndIcon = 10,
-                ListPadding = 5,
-            };
-            return style;
-        }
-    }
-
-    /// <summary>
-    /// The default DropDownItem style
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    public class DefaultDropDownItemStyle : StyleBase
-    {
-        /// <summary>
-        /// Return default DropDownItem style
-        /// </summary>
-        internal protected override ViewStyle GetViewStyle()
-        {
-            DropDownItemStyle style = new DropDownItemStyle
-            {
-                Size = new Size(360, 50),
-                BackgroundColor = new Selector<Color>
-                {
-                    Pressed = new Color(0.05f, 0.63f, 0.9f, 1),
-                    Selected = new Color(0.8f, 0.8f, 0.8f, 1),
-                    Normal = new Color(1, 1, 1, 1),
-                },
-                Text = new TextLabelStyle
-                {
-                    PointSize = DefaultStyle.PointSizeNormal,
-                    Position = new Position(28, 0),
-                    Text = "List item",
-                },
-            };
-            return style;
-        }
-    }
-}
diff --git a/src/Tizen.NUI.Components/PreloadStyle/DefaultPopupStyle.cs b/src/Tizen.NUI.Components/PreloadStyle/DefaultPopupStyle.cs
deleted file mode 100755 (executable)
index 2e4e328..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI.Components
-{
-    /// <summary>
-    /// The default Popup style
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    public class DefaultPopupStyle : StyleBase
-    {
-        /// <summary>
-        /// Return default Popup style
-        /// </summary>
-        internal protected override ViewStyle GetViewStyle()
-        {
-            PopupStyle style = new PopupStyle
-            {
-                Size = new Size(500, 280),
-                BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1),
-                ImageShadow = new ImageShadow
-                {
-                    Url = DefaultStyle.GetResourcePath("nui_component_default_popup_shadow.png"),
-                    Border = new Rectangle(24, 24, 24, 24),
-                    Offset = new Vector2(-24, -24),
-                    Extents = new Vector2(48, 48),
-                },
-                Title = new TextLabelStyle
-                {
-                    PointSize = 16,
-                    TextColor = Color.Black,
-                    PositionUsesPivotPoint = true,
-                    ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
-                    PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
-                    HorizontalAlignment = HorizontalAlignment.Begin,
-                    VerticalAlignment = VerticalAlignment.Bottom,
-                    Padding = 20,
-                    Text = "Title",
-                },
-                Buttons = new ButtonStyle
-                {
-                    Size = new Size(0, 80),
-                    PositionUsesPivotPoint = true,
-                    ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
-                    PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
-                    BackgroundColor = new Selector<Color>
-                    {
-                        Normal = new Color(1, 1, 1, 1),
-                        Pressed = new Color(1, 1, 1, 0.5f),
-                    },
-                    Overlay = new ImageViewStyle
-                    {
-                        PositionUsesPivotPoint = true,
-                        ParentOrigin = Tizen.NUI.ParentOrigin.Center,
-                        PivotPoint = Tizen.NUI.PivotPoint.Center,
-                        WidthResizePolicy = ResizePolicyType.FillToParent,
-                        HeightResizePolicy = ResizePolicyType.FillToParent,
-                        BackgroundColor = new Selector<Color>
-                        {
-                            Normal = new Color(1.0f, 1.0f, 1.0f, 1.0f),
-                            Pressed = new Color(0.0f, 0.0f, 0.0f, 0.1f),
-                            Selected = new Color(1.0f, 1.0f, 1.0f, 1.0f),
-                        }
-                    },
-                    Text = new TextLabelStyle
-                    {
-                        PositionUsesPivotPoint = true,
-                        ParentOrigin = Tizen.NUI.ParentOrigin.Center,
-                        PivotPoint = Tizen.NUI.PivotPoint.Center,
-                        HorizontalAlignment = HorizontalAlignment.Center,
-                        VerticalAlignment = VerticalAlignment.Center,
-                        TextColor = new Color(0.05f, 0.63f, 0.9f, 1)
-                    },
-                },
-            };
-            return style;
-        }
-    }
-}
diff --git a/src/Tizen.NUI.Components/PreloadStyle/DefaultProgressStyle.cs b/src/Tizen.NUI.Components/PreloadStyle/DefaultProgressStyle.cs
deleted file mode 100755 (executable)
index 8f664c5..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI.Components
-{
-    /// <summary>
-    /// The default Progress style
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    public class DefaultProgressStyle : StyleBase
-    {
-        /// <summary>
-        /// Return default Progress style
-        /// </summary>
-        internal protected override ViewStyle GetViewStyle()
-        {
-            ProgressStyle style = new ProgressStyle
-            {
-                Size = new Size(200, 5),
-                Track = new ImageViewStyle
-                {
-                    BackgroundColor = new Color(0, 0, 0, 0.1f),
-                },
-                Buffer = new ImageViewStyle
-                {
-                    BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 0.3f)
-                },
-                Progress = new ImageViewStyle
-                {
-                    BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1)
-                },
-
-            };
-            return style;
-        }
-    }
-}
diff --git a/src/Tizen.NUI.Components/PreloadStyle/DefaultRadioButtonStyle.cs b/src/Tizen.NUI.Components/PreloadStyle/DefaultRadioButtonStyle.cs
deleted file mode 100755 (executable)
index 1573894..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI.Components
-{
-    /// <summary>
-    /// The default RadioButton style
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    public class DefaultRadioButtonStyle : StyleBase
-    {
-        /// <summary>
-        /// Return default RadioButton style
-        /// </summary>
-        internal protected override ViewStyle GetViewStyle()
-        {
-            ButtonStyle style = new ButtonStyle
-            {
-                Size = new Size(30, 30),
-                Icon = new ImageViewStyle
-                {
-                    WidthResizePolicy = ResizePolicyType.DimensionDependency,
-                    HeightResizePolicy = ResizePolicyType.SizeRelativeToParent,
-                    SizeModeFactor = new Vector3(1, 1, 1),
-                    Opacity = new Selector<float?>
-                    {
-                        Normal = 1.0f,
-                        Selected = 1.0f,
-                        Disabled = 0.4f,
-                        DisabledSelected = 0.4f
-                    },
-                    BackgroundImage = new Selector<string>
-                    {
-                        Normal = DefaultStyle.GetResourcePath("nui_component_default_radiobutton_n.png"),
-                        Pressed = DefaultStyle.GetResourcePath("nui_component_default_radiobutton_p.png"),
-                        Selected = DefaultStyle.GetResourcePath("nui_component_default_radiobutton_s.png"),
-                        Disabled = DefaultStyle.GetResourcePath("nui_component_default_radiobutton_n.png"),
-                        DisabledSelected = DefaultStyle.GetResourcePath("nui_component_default_radiobutton_s.png"),
-                    }
-                },
-                Text = new TextLabelStyle
-                {
-                    PointSize = new Selector<float?> { All = DefaultStyle.PointSizeNormal },
-                    WidthResizePolicy = ResizePolicyType.FillToParent,
-                    HeightResizePolicy = ResizePolicyType.FillToParent,
-                    HorizontalAlignment = HorizontalAlignment.Center,
-                    VerticalAlignment = VerticalAlignment.Center,
-                    TextColor = new Selector<Color>
-                    {
-                        Normal = new Color(0.22f, 0.22f, 0.22f, 1),
-                        Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
-                        Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
-                    }
-                }
-            };
-            return style;
-        }
-    }
-}
diff --git a/src/Tizen.NUI.Components/PreloadStyle/DefaultSliderStyle.cs b/src/Tizen.NUI.Components/PreloadStyle/DefaultSliderStyle.cs
deleted file mode 100755 (executable)
index 7e7ec7b..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI.Components
-{
-    /// <summary>
-    /// The default Slider style
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    public class DefaultSliderStyle : StyleBase
-    {
-        /// <summary>
-        /// Return default Slider style
-        /// </summary>
-        internal protected override ViewStyle GetViewStyle()
-        {
-            SliderStyle style = new SliderStyle
-            {
-                Size = new Size(200, 50),
-                TrackThickness = 5,
-                Track = new ImageViewStyle
-                {
-                    BackgroundColor = new Color(0, 0, 0, 0.1f),
-                },
-
-                Progress = new ImageViewStyle
-                {
-                    BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
-                },
-
-                Thumb = new ImageViewStyle
-                {
-                    Size = new Size(50, 50),
-                    ResourceUrl = DefaultStyle.GetResourcePath("nui_component_default_slider_thumb_n.png"),
-                    BackgroundImage = new Selector<string>
-                    {
-                        Normal = "",
-                        Pressed = DefaultStyle.GetResourcePath("nui_component_default_slider_thumb_bg_p.png"),
-                    }
-                },
-
-            };
-            return style;
-        }
-    }
-}
diff --git a/src/Tizen.NUI.Components/PreloadStyle/DefaultStyle.cs b/src/Tizen.NUI.Components/PreloadStyle/DefaultStyle.cs
deleted file mode 100644 (file)
index 0445042..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using System.ComponentModel;
-
-namespace Tizen.NUI.Components
-{
-    internal static class DefaultStyle
-    {
-        internal const float PointSizeNormal = 12;
-
-        internal const float PointSizeTitle = 16;
-
-        static internal string GetResourcePath(string filename)
-        {
-            return "/usr/share/dotnet.tizen/framework/res/" + filename;
-        }
-    }
-}
diff --git a/src/Tizen.NUI.Components/PreloadStyle/DefaultSwitchStyle.cs b/src/Tizen.NUI.Components/PreloadStyle/DefaultSwitchStyle.cs
deleted file mode 100755 (executable)
index ee88c91..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI.Components
-{
-    /// <summary>
-    /// The default Switch style
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    public class DefaultSwitchStyle : StyleBase
-    {
-        /// <summary>
-        /// Return default Switch style
-        /// </summary>
-        internal protected override ViewStyle GetViewStyle()
-        {
-            SwitchStyle style = new SwitchStyle
-            {
-                Size = new Size(96, 60),
-                Track = new ImageViewStyle
-                {
-                    Size = new Size(96, 60),
-                    ResourceUrl = new Selector<string>
-                    {
-                        Normal = DefaultStyle.GetResourcePath("nui_component_default_switch_track_n.png"),
-                        Selected = DefaultStyle.GetResourcePath("nui_component_default_switch_track_s.png"),
-                        Disabled = DefaultStyle.GetResourcePath("nui_component_default_switch_track_d.png"),
-                        DisabledSelected = DefaultStyle.GetResourcePath("nui_component_default_switch_track_ds.png"),
-                    },
-                    Border = new Rectangle(30, 30, 30, 30),
-                },
-                Thumb = new ImageViewStyle
-                {
-                    Size = new Size(60, 60),
-                    ResourceUrl = new Selector<string>
-                    {
-                        Normal = DefaultStyle.GetResourcePath("nui_component_default_switch_thumb_n.png"),
-                        Selected = DefaultStyle.GetResourcePath("nui_component_default_switch_thumb_n.png"),
-                        Disabled = DefaultStyle.GetResourcePath("nui_component_default_switch_thumb_d.png"),
-                        DisabledSelected = DefaultStyle.GetResourcePath("nui_component_default_switch_thumb_d.png"),
-                    },
-                },
-                Text = new TextLabelStyle
-                {
-                    PointSize = new Selector<float?> { All = DefaultStyle.PointSizeNormal },
-                    WidthResizePolicy = ResizePolicyType.FillToParent,
-                    HeightResizePolicy = ResizePolicyType.FillToParent,
-                    HorizontalAlignment = HorizontalAlignment.Center,
-                    VerticalAlignment = VerticalAlignment.Center,
-                    TextColor = new Selector<Color>
-                    {
-                        Normal = new Color(0.22f, 0.22f, 0.22f, 1),
-                        Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
-                        Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
-                    }
-                },
-            };
-            return style;
-        }
-    }
-}
diff --git a/src/Tizen.NUI.Components/PreloadStyle/DefaultTabStyle.cs b/src/Tizen.NUI.Components/PreloadStyle/DefaultTabStyle.cs
deleted file mode 100755 (executable)
index 3f0919d..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI.Components
-{
-    /// <summary>
-    /// The default Tab style
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    public class DefaultTabStyle : StyleBase
-    {
-        /// <summary>
-        /// Return default Tab style
-        /// </summary>
-        internal protected override ViewStyle GetViewStyle()
-        {
-            TabStyle style = new TabStyle
-            {
-                BackgroundColor = Color.Yellow,
-                Size = new Size(480, 80),
-                UnderLine = new ViewStyle
-                {
-                    Size = new Size(0, 6),
-                    PositionUsesPivotPoint = true,
-                    ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
-                    PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
-                    BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
-                },
-                Text = new TextLabelStyle
-                {
-                    PointSize = DefaultStyle.PointSizeTitle,
-                    TextColor = new Selector<Color>
-                    {
-                        Normal = Color.Black,
-                        Selected = new Color(0.05f, 0.63f, 0.9f, 1),
-                    },
-                },
-            };
-            return style;
-        }
-    }
-}
diff --git a/src/Tizen.NUI.Components/PreloadStyle/DefaultTheme.cs b/src/Tizen.NUI.Components/PreloadStyle/DefaultTheme.cs
new file mode 100644 (file)
index 0000000..344c2a7
--- /dev/null
@@ -0,0 +1,403 @@
+/*
+ * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Components
+{
+    /// <summary>
+    /// Interface that includes styles for all components for a default theme
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    internal class DefaultTheme : Theme
+    {
+        internal static Theme Instance { get; } = new DefaultTheme();
+
+        protected DefaultTheme() : base()
+        {
+        }
+
+        protected override ButtonStyle GetButtonStyle()
+        {
+            return new ButtonStyle
+            {
+                Size = new Size(100, 45),
+                BackgroundColor = new Selector<Color>
+                {
+                    Normal = new Color(0.88f, 0.88f, 0.88f, 1),
+                    Pressed = new Color(0.77f, 0.77f, 0.77f, 1),
+                    Disabled = new Color(0.88f, 0.88f, 0.88f, 1)
+                },
+                Text = new TextLabelStyle
+                {
+                    PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
+                    WidthResizePolicy = ResizePolicyType.FillToParent,
+                    HeightResizePolicy = ResizePolicyType.FillToParent,
+                    HorizontalAlignment = HorizontalAlignment.Center,
+                    VerticalAlignment = VerticalAlignment.Center,
+                    TextColor = new Selector<Color>
+                    {
+                        Normal = new Color(0.22f, 0.22f, 0.22f, 1),
+                        Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
+                        Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
+                    },
+                    Text = "Button",
+                }
+            };
+        }
+
+        protected override ButtonStyle GetCheckBoxStyle()
+        {
+            return new ButtonStyle
+            {
+                Size = new Size(30, 30),
+                Icon = new ImageViewStyle
+                {
+                    WidthResizePolicy = ResizePolicyType.DimensionDependency,
+                    HeightResizePolicy = ResizePolicyType.SizeRelativeToParent,
+                    SizeModeFactor = new Vector3(1, 1, 1),
+                    Opacity = new Selector<float?>
+                    {
+                        Normal = 1.0f,
+                        Selected = 1.0f,
+                        Disabled = 0.4f,
+                        DisabledSelected = 0.4f
+                    },
+                    BackgroundImage = new Selector<string>
+                    {
+                        Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_n.png"),
+                        Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_p.png"),
+                        Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_p.png"),
+                        Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_n.png"),
+                        DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_p.png"),
+                    },
+                    ResourceUrl = new Selector<string>
+                    {
+                        Normal = "",
+                        Pressed = "",
+                        Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_s.png"),
+                        Disabled = "",
+                        DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_s.png"),
+                    }
+                },
+                Text = new TextLabelStyle
+                {
+                    PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
+                    WidthResizePolicy = ResizePolicyType.FillToParent,
+                    HeightResizePolicy = ResizePolicyType.FillToParent,
+                    HorizontalAlignment = HorizontalAlignment.Center,
+                    VerticalAlignment = VerticalAlignment.Center,
+                    TextColor = new Selector<Color>
+                    {
+                        Normal = new Color(0.22f, 0.22f, 0.22f, 1),
+                        Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
+                        Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
+                    }
+                }
+            };
+        }
+
+        protected override DropDownStyle GetDropDownStyle()
+        {
+            return new DropDownStyle
+            {
+                Position = new Position(50, 50),
+                Button = new ButtonStyle
+                {
+                    ParentOrigin = ParentOrigin.TopLeft,
+                    PivotPoint = PivotPoint.TopLeft,
+                    BackgroundImage = new Selector<string>
+                    {
+                        Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_n.png"),
+                        Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_p.png")
+                    },
+                    BackgroundImageBorder = (Rectangle)6,
+                    Text = new TextLabelStyle
+                    {
+                        Text = "Select an item",
+                        PointSize = StyleManager.PointSizeNormal,
+                        TextColor = Color.Black,
+                    },
+                    Icon = new ImageViewStyle
+                    {
+                        Size = new Size(28, 28),
+                        ResourceUrl = StyleManager.GetFrameworkResourcePath("nui_component_default_dropdown_button_icon.png"),
+                    },
+                    IconRelativeOrientation = Button.IconOrientation.Right,
+                    IconPadding = 6,
+                },
+                ListBackgroundImage = new ImageViewStyle
+                {
+                    ResourceUrl = StyleManager.GetFrameworkResourcePath("nui_component_default_dropdown_list_bg.png"),
+                    Border = (Rectangle)6,
+                    Size = new Size(280, 360),
+                },
+                SpaceBetweenButtonTextAndIcon = 10,
+                ListPadding = 5,
+            };
+        }
+
+        protected override PopupStyle GetPopupStyle()
+        {
+            return new PopupStyle
+            {
+                Size = new Size(500, 280),
+                BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1),
+                ImageShadow = new ImageShadow
+                {
+                    Url = StyleManager.GetFrameworkResourcePath("nui_component_default_popup_shadow.png"),
+                    Border = new Rectangle(24, 24, 24, 24),
+                    Offset = new Vector2(-24, -24),
+                    Extents = new Vector2(48, 48),
+                },
+                Title = new TextLabelStyle
+                {
+                    PointSize = 16,
+                    TextColor = Color.Black,
+                    PositionUsesPivotPoint = true,
+                    ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+                    PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
+                    HorizontalAlignment = HorizontalAlignment.Begin,
+                    VerticalAlignment = VerticalAlignment.Bottom,
+                    Padding = 20,
+                    Text = "Title",
+                },
+                Buttons = new ButtonStyle
+                {
+                    Size = new Size(0, 80),
+                    PositionUsesPivotPoint = true,
+                    ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
+                    PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
+                    BackgroundColor = new Selector<Color>
+                    {
+                        Normal = new Color(1, 1, 1, 1),
+                        Pressed = new Color(1, 1, 1, 0.5f),
+                    },
+                    Overlay = new ImageViewStyle
+                    {
+                        PositionUsesPivotPoint = true,
+                        ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+                        PivotPoint = Tizen.NUI.PivotPoint.Center,
+                        WidthResizePolicy = ResizePolicyType.FillToParent,
+                        HeightResizePolicy = ResizePolicyType.FillToParent,
+                        BackgroundColor = new Selector<Color>
+                        {
+                            Normal = new Color(1.0f, 1.0f, 1.0f, 1.0f),
+                            Pressed = new Color(0.0f, 0.0f, 0.0f, 0.1f),
+                            Selected = new Color(1.0f, 1.0f, 1.0f, 1.0f),
+                        }
+                    },
+                    Text = new TextLabelStyle
+                    {
+                        PositionUsesPivotPoint = true,
+                        ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+                        PivotPoint = Tizen.NUI.PivotPoint.Center,
+                        HorizontalAlignment = HorizontalAlignment.Center,
+                        VerticalAlignment = VerticalAlignment.Center,
+                        TextColor = new Color(0.05f, 0.63f, 0.9f, 1)
+                    },
+                },
+            };
+        }
+
+        protected override ProgressStyle GetProgressStyle()
+        {
+            return new ProgressStyle
+            {
+                Size = new Size(200, 5),
+                Track = new ImageViewStyle
+                {
+                    BackgroundColor = new Color(0, 0, 0, 0.1f),
+                },
+                Buffer = new ImageViewStyle
+                {
+                    BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 0.3f)
+                },
+                Progress = new ImageViewStyle
+                {
+                    BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1)
+                },
+            };
+        }
+
+        protected override ButtonStyle GetRadioButtonStyle()
+        {
+            return new ButtonStyle
+            {
+                Size = new Size(30, 30),
+                Icon = new ImageViewStyle
+                {
+                    WidthResizePolicy = ResizePolicyType.DimensionDependency,
+                    HeightResizePolicy = ResizePolicyType.SizeRelativeToParent,
+                    SizeModeFactor = new Vector3(1, 1, 1),
+                    Opacity = new Selector<float?>
+                    {
+                        Normal = 1.0f,
+                        Selected = 1.0f,
+                        Disabled = 0.4f,
+                        DisabledSelected = 0.4f
+                    },
+                    BackgroundImage = new Selector<string>
+                    {
+                        Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_n.png"),
+                        Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_p.png"),
+                        Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_s.png"),
+                        Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_n.png"),
+                        DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_s.png"),
+                    }
+                },
+                Text = new TextLabelStyle
+                {
+                    PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
+                    WidthResizePolicy = ResizePolicyType.FillToParent,
+                    HeightResizePolicy = ResizePolicyType.FillToParent,
+                    HorizontalAlignment = HorizontalAlignment.Center,
+                    VerticalAlignment = VerticalAlignment.Center,
+                    TextColor = new Selector<Color>
+                    {
+                        Normal = new Color(0.22f, 0.22f, 0.22f, 1),
+                        Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
+                        Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
+                    }
+                }
+            };
+        }
+
+        protected override SliderStyle GetSliderStyle()
+        {
+            return new SliderStyle
+            {
+                Size = new Size(200, 50),
+                TrackThickness = 5,
+                Track = new ImageViewStyle
+                {
+                    BackgroundColor = new Color(0, 0, 0, 0.1f),
+                },
+
+                Progress = new ImageViewStyle
+                {
+                    BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
+                },
+
+                Thumb = new ImageViewStyle
+                {
+                    Size = new Size(50, 50),
+                    ResourceUrl = StyleManager.GetFrameworkResourcePath("nui_component_default_slider_thumb_n.png"),
+                    BackgroundImage = new Selector<string>
+                    {
+                        Normal = "",
+                        Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_slider_thumb_bg_p.png"),
+                    }
+                },
+
+            };
+        }
+
+        protected override SwitchStyle GetSwitchStyle()
+        {
+            return new SwitchStyle
+            {
+                Size = new Size(96, 60),
+                Track = new ImageViewStyle
+                {
+                    Size = new Size(96, 60),
+                    ResourceUrl = new Selector<string>
+                    {
+                        Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_n.png"),
+                        Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_s.png"),
+                        Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_d.png"),
+                        DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_ds.png"),
+                    },
+                    Border = new Rectangle(30, 30, 30, 30),
+                },
+                Thumb = new ImageViewStyle
+                {
+                    Size = new Size(60, 60),
+                    ResourceUrl = new Selector<string>
+                    {
+                        Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_n.png"),
+                        Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_n.png"),
+                        Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_d.png"),
+                        DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_d.png"),
+                    },
+                },
+                Text = new TextLabelStyle
+                {
+                    PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
+                    WidthResizePolicy = ResizePolicyType.FillToParent,
+                    HeightResizePolicy = ResizePolicyType.FillToParent,
+                    HorizontalAlignment = HorizontalAlignment.Center,
+                    VerticalAlignment = VerticalAlignment.Center,
+                    TextColor = new Selector<Color>
+                    {
+                        Normal = new Color(0.22f, 0.22f, 0.22f, 1),
+                        Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
+                        Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
+                    }
+                },
+            };
+        }
+
+        protected override TabStyle GetTabStyle()
+        {
+            return new TabStyle
+            {
+                BackgroundColor = Color.Yellow,
+                Size = new Size(480, 80),
+                UnderLine = new ViewStyle
+                {
+                    Size = new Size(0, 6),
+                    PositionUsesPivotPoint = true,
+                    ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
+                    PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
+                    BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
+                },
+                Text = new TextLabelStyle
+                {
+                    PointSize = StyleManager.PointSizeTitle,
+                    TextColor = new Selector<Color>
+                    {
+                        Normal = Color.Black,
+                        Selected = new Color(0.05f, 0.63f, 0.9f, 1),
+                    },
+                },
+            };
+        }
+
+        protected override ToastStyle GetToastStyle()
+        {
+            return new ToastStyle
+            {
+                WidthResizePolicy = ResizePolicyType.FitToChildren,
+                HeightResizePolicy = ResizePolicyType.FitToChildren,
+                BackgroundColor = new Color(0, 0, 0, 0.8f),
+                Text = new TextLabelStyle()
+                {
+                    PositionUsesPivotPoint = true,
+                    ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+                    PivotPoint = Tizen.NUI.PivotPoint.Center,
+                    WidthResizePolicy = ResizePolicyType.UseNaturalSize,
+                    HeightResizePolicy = ResizePolicyType.UseNaturalSize,
+                    HorizontalAlignment = HorizontalAlignment.Center,
+                    VerticalAlignment = VerticalAlignment.Center,
+                    TextColor = Color.White,
+                    Padding = new Extents(12, 12, 8, 8),
+                }
+            };
+        }
+    }
+}
diff --git a/src/Tizen.NUI.Components/PreloadStyle/DefaultToastStyle.cs b/src/Tizen.NUI.Components/PreloadStyle/DefaultToastStyle.cs
deleted file mode 100755 (executable)
index 6006ba8..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI.Components
-{
-    /// <summary>
-    /// The default Toast style
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    public class DefaultToastStyle : StyleBase
-    {
-        /// <summary>
-        /// Return default Toast style
-        /// </summary>
-        internal protected override ViewStyle GetViewStyle()
-        {
-            ToastStyle style = new ToastStyle
-            {
-                WidthResizePolicy = ResizePolicyType.FitToChildren,
-                HeightResizePolicy = ResizePolicyType.FitToChildren,
-                BackgroundColor = new Color(0, 0, 0, 0.8f),
-                Text = new TextLabelStyle()
-                {
-                    PositionUsesPivotPoint = true,
-                    ParentOrigin = Tizen.NUI.ParentOrigin.Center,
-                    PivotPoint = Tizen.NUI.PivotPoint.Center,
-                    WidthResizePolicy = ResizePolicyType.UseNaturalSize,
-                    HeightResizePolicy = ResizePolicyType.UseNaturalSize,
-                    HorizontalAlignment = HorizontalAlignment.Center,
-                    VerticalAlignment = VerticalAlignment.Center,
-                    TextColor = Color.White,
-                    Padding = new Extents(12, 12, 8, 8),
-                }
-            };
-            return style;
-        }
-    }
-}
@@ -19,7 +19,7 @@ using Tizen.NUI.BaseComponents;
 using Tizen.NUI.Components;
 using Tizen.NUI.Components.Extension;
 
-namespace Tizen.NUI.Wearable
+namespace Tizen.NUI.Components
 {
     /// <summary>
     /// Describes Button Animation used in OneUI_Watch2.X
@@ -79,7 +79,7 @@ namespace Tizen.NUI.Wearable
     /// OverlayAnimationButtonExtension class is a extended ButtonExtension class that make the overlay image blinking on a Button pressed.
     /// </summary>
     [EditorBrowsable(EditorBrowsableState.Never)]
-    public class OverlayAnimationButtonExtension : ButtonExtension
+    internal class OverlayAnimationButtonExtension : ButtonExtension
     {
         private Animation PressAnimation { get; set; }
 
@@ -123,10 +123,10 @@ namespace Tizen.NUI.Wearable
                 keyFrames.Add(0.25f, 1.0f, new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear));
                 keyFrames.Add(1.0f, 0.0f, new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOut));
 
-                PressAnimation = new Animation(400);
+                PressAnimation = new Animation(600);
                 PressAnimation.EndAction = Animation.EndActions.StopFinal;
                 PressAnimation.AnimateBetween(overlayImage, "Opacity", keyFrames);
-                PressAnimation.AnimateTo(overlayImage, "Scale", new Vector3(1, 1, 1), 0, 300, new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOut));
+                PressAnimation.AnimateTo(overlayImage, "Scale", new Vector3(1, 1, 1), 0, 600, new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOut));
             }
 
             if (PressAnimation.State == Animation.States.Playing)
@@ -139,7 +139,7 @@ namespace Tizen.NUI.Wearable
             overlayImage.CornerRadius = button.CornerRadius;
             overlayImage.Background = button.Background;
             overlayImage.Size = button.Size;
-            overlayImage.Scale = new Vector3(0.86f, 0.86f, 1);
+            overlayImage.Scale = new Vector3(0.80f, 0.80f, 1);
             overlayImage.Show();
 
             PressAnimation.Play();
diff --git a/src/Tizen.NUI.Components/PreloadStyle/WearableTheme.cs b/src/Tizen.NUI.Components/PreloadStyle/WearableTheme.cs
new file mode 100644 (file)
index 0000000..63b07e1
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+ * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components.Extension;
+
+namespace Tizen.NUI.Components
+{
+    /// <summary>
+    /// Interface that includes styles for all components for a wearable theme
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    internal class WearableTheme : DefaultTheme
+    {
+        internal static new Theme Instance { get; } = new WearableTheme();
+
+        private WearableTheme() : base()
+        {
+        }
+
+        protected override ButtonStyle GetButtonStyle()
+        {
+            return new ButtonStyle
+            {
+                Size = new Size(210, 72),
+                CornerRadius = 36,
+                BackgroundColor = new Selector<Color>
+                {
+                    Normal = new Color(0, 42f/255f, 77f/255f, 0.85f),
+                    Pressed = new Color(0, 70f/255f, 128f/255f, 0.70f),
+                    Disabled = new Color(61f/255f, 61f/255f, 61f/255f, 0.85f),
+                },
+                Text = new TextLabelStyle
+                {
+                    FontFamily = "SamsungOne 700",
+                    PixelSize = 28,
+                    TextColor = new Selector<Color>
+                    {
+                        Normal = new Color(56f/255f, 164f/255f, 252f/255f, 1),
+                        Pressed = new Color(56f/255f, 164f/255f, 252f/255f, 1),
+                        Disabled = new Color(1, 1, 1, 0.35f),
+                    },
+                    Padding = new Extents(20, 20, 0, 0),
+                    VerticalAlignment = VerticalAlignment.Center,
+                    HorizontalAlignment = HorizontalAlignment.Center,
+                },
+                Opacity = new Selector<float?>
+                {
+                    Other = 1.0f,
+                    Pressed = 0.6f,
+                    Disabled = 0.3f,
+                }
+            };
+        }
+
+        protected override ButtonStyle GetCheckBoxStyle()
+        {
+            return new LottieButtonStyle
+            {
+                LottieUrl = StyleManager.GetFrameworkResourcePath("nui_wearable_checkbox_icon.json"),
+                PlayRange = new Selector<LottieFrameInfo>
+                {
+                    Selected = (0, 18),
+                    Normal = (19, 36)
+                },
+                Opacity = new Selector<float?>
+                {
+                    Other = 1.0f,
+                    Pressed = 0.6f,
+                    Disabled = 0.3f,
+                },
+            };
+        }
+
+        protected override ButtonStyle GetRadioButtonStyle()
+        {
+            return new LottieButtonStyle
+            {
+                LottieUrl = StyleManager.GetFrameworkResourcePath("nui_wearable_radiobutton_icon.json"),
+                PlayRange = new Selector<LottieFrameInfo>
+                {
+                    Selected = (0, 12),
+                    Normal = (13, 25)
+                },
+                Opacity = new Selector<float?>
+                {
+                    Other = 1.0f,
+                    Pressed = 0.6f,
+                    Disabled = 0.3f,
+                },
+            };
+        }
+
+        protected override SwitchStyle GetSwitchStyle()
+        {
+            return new LottieSwitchStyle
+            {
+                LottieUrl = StyleManager.GetFrameworkResourcePath("nui_wearable_switch_icon.json"),
+                PlayRange = new Selector<LottieFrameInfo>
+                {
+                    Selected = (0, 18),
+                    Normal = (19, 36)
+                },
+                Opacity = new Selector<float?>
+                {
+                    Other = 1.0f,
+                    Pressed = 0.6f,
+                    Disabled = 0.3f,
+                },
+            };
+        }
+    }
+}
index 1056d9e..01e39a6 100755 (executable)
@@ -44,7 +44,10 @@ namespace Tizen.NUI.Components
         public static readonly BindableProperty IsSelectedProperty = BindableProperty.Create(nameof(IsSelected), typeof(bool?), typeof(ButtonStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var buttonStyle = (ButtonStyle)bindable;
-            buttonStyle.isSelected = (bool?)newValue;
+            if (buttonStyle.IsSelectable != null && buttonStyle.IsSelectable == true)
+            {
+                buttonStyle.isSelected = (bool?)newValue;
+            }
         },
         defaultValueCreator: (bindable) =>
         {
index 0325344..8ee064f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,9 +33,9 @@ namespace Tizen.NUI.Components.Extension
         string LottieUrl { get; set; }
 
         /// <summary>
-        /// Get/Set LottieFrameInfo on various action states of attached Button.
+        /// Get/Set LottieFrameInfo for playing on various states of attached Button.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        Button.ActionSelector<LottieFrameInfo> LottieFrameInfo { get; set; }
+        Selector<LottieFrameInfo> PlayRange { get; set; }
     }
 }
index d0105be..729bcc9 100644 (file)
@@ -52,7 +52,7 @@ namespace Tizen.NUI.Components.Extension
 
         /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public Button.ActionSelector<LottieFrameInfo> LottieFrameInfo { get; set; }
+        public Selector<LottieFrameInfo> PlayRange { get; set; }
 
         /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
@@ -68,7 +68,7 @@ namespace Tizen.NUI.Components.Extension
             }
 
             LottieUrl = style.LottieUrl;
-            LottieFrameInfo = style.LottieFrameInfo;
+            PlayRange = style.PlayRange;
         }
 
         /// <inheritdoc/>
index d768afe..6f30488 100644 (file)
@@ -52,7 +52,7 @@ namespace Tizen.NUI.Components.Extension
 
         /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public Button.ActionSelector<LottieFrameInfo> LottieFrameInfo { get; set; }
+        public Selector<LottieFrameInfo> PlayRange { get; set; }
 
         /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
@@ -68,7 +68,7 @@ namespace Tizen.NUI.Components.Extension
             }
 
             LottieUrl = style.LottieUrl;
-            LottieFrameInfo = style.LottieFrameInfo;
+            PlayRange = style.PlayRange;
         }
 
         /// <inheritdoc/>
diff --git a/src/Tizen.NUI.Components/Style/Theme.cs b/src/Tizen.NUI.Components/Style/Theme.cs
new file mode 100644 (file)
index 0000000..fc84192
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Components
+{
+    /// <summary>
+    /// Interface that includes styles for all components for a theme
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    internal abstract class Theme
+    {
+        private Dictionary<Type, ComponentStyleGetter> styleMap;
+
+        protected Theme()
+        {
+            styleMap = new Dictionary<Type, ComponentStyleGetter>();
+            styleMap.Add(typeof(Button), GetButtonStyle);
+            styleMap.Add(typeof(CheckBox), GetCheckBoxStyle);
+            styleMap.Add(typeof(DropDown), GetDropDownStyle);
+            styleMap.Add(typeof(Popup), GetPopupStyle);
+            styleMap.Add(typeof(Progress), GetProgressStyle);
+            styleMap.Add(typeof(RadioButton), GetRadioButtonStyle);
+            styleMap.Add(typeof(Slider), GetSliderStyle);
+            styleMap.Add(typeof(Switch), GetSwitchStyle);
+            styleMap.Add(typeof(Tab), GetTabStyle);
+            styleMap.Add(typeof(Toast), GetToastStyle);
+        }
+
+        internal delegate ViewStyle ComponentStyleGetter();
+
+        internal ViewStyle GetComponentStyle(Type type)
+        {
+            return styleMap.ContainsKey(type) ? styleMap[type]() : null;
+        }
+
+        internal void OverwriteComponentStyle(Type type, ComponentStyleGetter styleGetter)
+        {
+            styleMap.Add(typeof(Toast), GetToastStyle);
+        }
+
+        protected abstract ButtonStyle GetButtonStyle();
+
+        protected abstract ButtonStyle GetCheckBoxStyle();
+
+        protected abstract DropDownStyle GetDropDownStyle();
+
+        protected abstract PopupStyle GetPopupStyle();
+
+        protected abstract ProgressStyle GetProgressStyle();
+
+        protected abstract ButtonStyle GetRadioButtonStyle();
+
+        protected abstract SliderStyle GetSliderStyle();
+
+        protected abstract SwitchStyle GetSwitchStyle();
+
+        protected abstract TabStyle GetTabStyle();
+
+        protected abstract ToastStyle GetToastStyle();
+    }
+}
index 039d6e9..cde3690 100755 (executable)
@@ -17,6 +17,7 @@
   <ItemGroup>
     <ProjectReference Include="..\Tizen.Log\Tizen.Log.csproj" />
     <ProjectReference Include="..\Tizen.NUI\Tizen.NUI.csproj" />
+    <ProjectReference Include="..\Tizen.System.Information\Tizen.System.Information.csproj" />
   </ItemGroup>
 
   <ItemGroup>
index 6f4b397..e057cba 100755 (executable)
@@ -26,18 +26,36 @@ namespace Tizen.NUI.Components
     /// <since_tizen> 8 </since_tizen>
     public sealed class StyleManager
     {
-        private static readonly string defaultThemeName = "default";
-        private string theme = defaultThemeName;
+        internal const float PointSizeNormal = 12;
+        internal const float PointSizeTitle = 16;
+
+        private const string defaultThemeName = "default";
+        private const string wearableThemeName = "wearable";
+        
+        private string currentThemeName = defaultThemeName;
         private Dictionary<string, Dictionary<string, StyleBase>> themeStyleSet = new Dictionary<string, Dictionary<string, StyleBase>>();
         private Dictionary<string, StyleBase> defaultStyleSet = new Dictionary<string, StyleBase>();
+
+        /// <summary>
+        /// (Theme name, Theme instance)
+        /// </summary>
         private Dictionary<string, Dictionary<Type, StyleBase>> componentStyleByTheme = new Dictionary<string, Dictionary<Type, StyleBase>>();
+        
+        /// <summary>
+        /// (Theme name, Theme instance)
+        /// </summary>
+        private Dictionary<string, Theme> themeMap = new Dictionary<string, Theme>();
+
         private EventHandler<ThemeChangeEventArgs> themeChangeHander;
 
+        private Theme currentTheme;
+
         /// <summary>
         /// StyleManager construct.
         /// </summary>
         private StyleManager()
         {
+            SetInitialThemeByDeviceProfile();
         }
 
         /// <summary>
@@ -60,7 +78,7 @@ namespace Tizen.NUI.Components
         /// StyleManager static instance.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
-        public static StyleManager Instance { get; internal set; } = new StyleManager();
+        public static StyleManager Instance { get; } = new StyleManager();
 
         /// <summary>
         /// Style theme.
@@ -70,15 +88,17 @@ namespace Tizen.NUI.Components
         {
             get
             {
-                return theme;
+                return currentThemeName;
             }
 
             set
             {
-                if (theme != value)
+                if (currentThemeName != value)
                 {
-                    theme = value;
-                    themeChangeHander?.Invoke(null, new ThemeChangeEventArgs { CurrentTheme = theme });
+                    currentThemeName = value.ToLower();
+                    themeChangeHander?.Invoke(null, new ThemeChangeEventArgs { CurrentTheme = currentThemeName });
+
+                    UpdateTheme();
                 }
             }
         }
@@ -152,9 +172,9 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Register a style for a component to theme.
         /// </summary>
-        /// <param name="targetTheme">Theme</param>
+        /// <param name="targetTheme">The target theme name to register a component style. It theme should be a known one.</param>
         /// <param name="component">The type of ComponentStyle</param>
-        /// <param name="style">The type of style</param>
+        /// <param name="style">The derived class of StyleBase</param>
         /// <since_tizen> 8 </since_tizen>
         public void RegisterComponentStyle(string targetTheme, Type component, Type style)
         {
@@ -163,10 +183,10 @@ namespace Tizen.NUI.Components
                 throw new ArgumentException("The argument targetTheme must be specified");
             }
 
-            if (defaultThemeName.Equals(targetTheme))
+            if (!themeMap.ContainsKey(targetTheme))
             {
-                // Ensure default component styles have loaded before override custom default style
-                LoadDefaultComponentStyle();
+                Tizen.Log.Error("NUI", "The theme name should be a known one.");
+                return;
             }
 
             if (!componentStyleByTheme.ContainsKey(targetTheme))
@@ -192,24 +212,12 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 8 </since_tizen>
         public ViewStyle GetComponentStyle(Type component)
         {
-            var currentTheme = theme;
-
-            if (!componentStyleByTheme.ContainsKey(theme))
-            {
-                currentTheme = defaultThemeName;
-            }
-
-            if (defaultThemeName.Equals(currentTheme))
+            if (componentStyleByTheme.ContainsKey(currentThemeName) && componentStyleByTheme[currentThemeName].ContainsKey(component))
             {
-                LoadDefaultComponentStyle();
-            }
-
-            if (!componentStyleByTheme[currentTheme].ContainsKey(component))
-            {
-                return null;
+                return componentStyleByTheme[currentThemeName][component].GetViewStyle();
             }
 
-            return (componentStyleByTheme[currentTheme][component])?.GetViewStyle();
+            return currentTheme.GetComponentStyle(component);
         }
 
         /// <summary>
@@ -225,27 +233,49 @@ namespace Tizen.NUI.Components
             public string CurrentTheme;
         }
 
-        private void LoadDefaultComponentStyle()
+        internal static string GetFrameworkResourcePath(string resourceFileName)
         {
-            if (componentStyleByTheme.ContainsKey(defaultThemeName))
+            return "/usr/share/dotnet.tizen/framework/res/" + resourceFileName;
+        }
+
+        private void SetInitialThemeByDeviceProfile()
+        {
+            themeMap.Add(wearableThemeName, WearableTheme.Instance);
+            themeMap.Add(defaultThemeName, DefaultTheme.Instance);
+
+            currentThemeName = defaultThemeName;
+            currentTheme = DefaultTheme.Instance;
+
+            string currentProfile;
+
+            try
+            {
+                System.Information.TryGetValue<string>("tizen.org/feature/profile", out currentProfile);
+                Tizen.Log.Info("NUI", "Profile for initial theme found : " + currentProfile);
+            }
+            catch
             {
+                Tizen.Log.Error("NUI", "Unknown device profile");
                 return;
             }
 
-            componentStyleByTheme.Add(defaultThemeName, new Dictionary<Type, StyleBase>());
-
-            var defaultComponentsStyle = componentStyleByTheme[defaultThemeName];
-            defaultComponentsStyle.Add(typeof(Tizen.NUI.Components.Button), new DefaultButtonStyle());
-            defaultComponentsStyle.Add(typeof(Tizen.NUI.Components.CheckBox), new DefaultCheckBoxStyle());
-            defaultComponentsStyle.Add(typeof(Tizen.NUI.Components.RadioButton), new DefaultRadioButtonStyle());
-            defaultComponentsStyle.Add(typeof(Tizen.NUI.Components.Switch), new DefaultSwitchStyle());
-            defaultComponentsStyle.Add(typeof(Tizen.NUI.Components.Progress), new DefaultProgressStyle());
-            defaultComponentsStyle.Add(typeof(Tizen.NUI.Components.Slider), new DefaultSliderStyle());
-            defaultComponentsStyle.Add(typeof(Tizen.NUI.Components.Toast), new DefaultToastStyle());
-            defaultComponentsStyle.Add(typeof(Tizen.NUI.Components.Popup), new DefaultPopupStyle());
-            defaultComponentsStyle.Add(typeof(Tizen.NUI.Components.DropDown), new DefaultDropDownStyle());
-            defaultComponentsStyle.Add(typeof(Tizen.NUI.Components.DropDown.DropDownDataItem), new DefaultDropDownItemStyle());
-            defaultComponentsStyle.Add(typeof(Tizen.NUI.Components.Tab), new DefaultTabStyle());
+            if (string.Equals(currentProfile, wearableThemeName))
+            {
+                currentThemeName = wearableThemeName;
+                currentTheme = WearableTheme.Instance;
+            }
+        }
+
+        private void UpdateTheme()
+        {
+            if (themeMap.ContainsKey(currentThemeName))
+            {
+                currentTheme = themeMap[currentThemeName];
+            }
+            else
+            {
+                currentTheme = DefaultTheme.Instance;
+            }
         }
     }
 }
diff --git a/src/Tizen.NUI.Wearable/src/public/Style/WearableButtonStyle.cs b/src/Tizen.NUI.Wearable/src/public/Style/WearableButtonStyle.cs
deleted file mode 100644 (file)
index 7548652..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-
-namespace Tizen.NUI.Wearable
-{
-    /// <summary>
-    /// A predefined style class for Wearable buttons.
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    public class WearableButtonStyle : ButtonStyle
-    {
-        /// <summary>
-        /// Creates a new class instance.
-        /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public WearableButtonStyle() : base()
-        {
-            Size = new Size(210, 72);
-            CornerRadius = 36;
-            BackgroundColor = new Selector<Color>
-            {
-                Normal = new Color(0, 42f/255f, 77f/255f, 0.85f),
-                Pressed = new Color(0, 70f/255f, 128f/255f, 0.70f),
-                Disabled = new Color(61f/255f, 61f/255f, 61f/255f, 0.85f),
-            };
-            Text = new TextLabelStyle
-            {
-                FontFamily = "SamsungOne 700",
-                PixelSize = 28,
-                TextColor = new Selector<Color>
-                {
-                    Normal = new Color(56f/255f, 164f/255f, 252f/255f, 1),
-                    Pressed = new Color(56f/255f, 164f/255f, 252f/255f, 1),
-                    Disabled = new Color(1, 1, 1, 0.35f),
-                },
-                Padding = new Extents(20, 20, 0, 0),
-                VerticalAlignment = VerticalAlignment.Center,
-                HorizontalAlignment = HorizontalAlignment.Center,
-            };
-            Opacity = new Selector<float?>
-            {
-                Other = 1.0f,
-                Pressed = 0.6f,
-                Disabled = 0.3f,
-            };
-        }
-    }
-}
diff --git a/src/Tizen.NUI.Wearable/src/public/Style/WearableCheckBoxStyle.cs b/src/Tizen.NUI.Wearable/src/public/Style/WearableCheckBoxStyle.cs
deleted file mode 100644 (file)
index 6c7ca28..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-using Tizen.NUI.Components.Extension;
-
-namespace Tizen.NUI.Wearable
-{
-    /// <summary>
-    /// A predefined style class for Wearable check boxes.
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    public class WearableCheckBoxStyle : LottieButtonStyle
-    {
-        /// <summary>
-        /// Creates a new class instance.
-        /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public WearableCheckBoxStyle() : base()
-        {
-            LottieUrl = WearableStyle.GetResourcePath("nui_wearable_checkbox_icon.json");
-            LottieFrameInfo = new Button.ActionSelector<LottieFrameInfo>
-            {
-                OnSelect = (0, 18),
-                OnUnselect = (19, 36)
-            };
-            Opacity = new Selector<float?>
-            {
-                Other = 1.0f,
-                Pressed = 0.6f,
-                Disabled = 0.3f,
-            };
-        }
-    }
-}
diff --git a/src/Tizen.NUI.Wearable/src/public/Style/WearableRadioButtonStyle.cs b/src/Tizen.NUI.Wearable/src/public/Style/WearableRadioButtonStyle.cs
deleted file mode 100644 (file)
index f7b1eaf..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-using Tizen.NUI.Components.Extension;
-
-namespace Tizen.NUI.Wearable
-{
-    /// <summary>
-    /// A predefined style class for Wearable radio buttons.
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    public class WearableRadioButtonStyle : LottieButtonStyle
-    {
-        /// <summary>
-        /// Creates a new class instance.
-        /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public WearableRadioButtonStyle() : base()
-        {
-            LottieUrl = WearableStyle.GetResourcePath("nui_wearable_radiobutton_icon.json");
-            LottieFrameInfo = new Button.ActionSelector<LottieFrameInfo>
-            {
-                OnSelect = (0, 12),
-                OnUnselect = (13, 25)
-            };
-            Opacity = new Selector<float?>
-            {
-                Other = 1.0f,
-                Pressed = 0.6f,
-                Disabled = 0.3f,
-            };
-        }
-    }
-}
diff --git a/src/Tizen.NUI.Wearable/src/public/Style/WearableStyle.cs b/src/Tizen.NUI.Wearable/src/public/Style/WearableStyle.cs
deleted file mode 100644 (file)
index 89d8b09..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-
-namespace Tizen.NUI.Wearable
-{
-    /// <summary>
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    public class WearableStyle
-    {
-        static internal string GetResourcePath(string filename)
-        {
-            return "/usr/share/dotnet.tizen/framework/res/" + filename;
-        }
-    }
-}
diff --git a/src/Tizen.NUI.Wearable/src/public/Style/WearableSwitchStyle.cs b/src/Tizen.NUI.Wearable/src/public/Style/WearableSwitchStyle.cs
deleted file mode 100644 (file)
index 8952bd2..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-using Tizen.NUI.Components.Extension;
-
-namespace Tizen.NUI.Wearable
-{
-    /// <summary>
-    /// A predefined style class for Wearable switches.
-    /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
-    public class WearableSwitchStyle : LottieSwitchStyle
-    {
-        /// <summary>
-        /// Creates a new class instance.
-        /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public WearableSwitchStyle() : base()
-        {
-            LottieUrl = WearableStyle.GetResourcePath("nui_wearable_switch_icon.json");
-            LottieFrameInfo = new Button.ActionSelector<LottieFrameInfo>
-            {
-                OnSelect = (0, 18),
-                OnUnselect = (19, 36)
-            };
-            Opacity = new Selector<float?>
-            {
-                Other = 1.0f,
-                Pressed = 0.6f,
-                Disabled = 0.3f,
-            };
-        }
-    }
-}
index f1442e4..3c1e00e 100755 (executable)
@@ -917,10 +917,14 @@ namespace Tizen.NUI.BaseComponents
             }
 
             lottieView.SetMinMaxFrame(StartFrame, Math.Min(EndFrame, lottieView.TotalFrame - 1));
-            lottieView.CurrentFrame = StartFrame;
 
-            if (!noPlay && !IsStillImage())
+            if (IsStillImage() || noPlay)
             {
+                lottieView.CurrentFrame = EndFrame;
+            }
+            else
+            {
+                lottieView.CurrentFrame = StartFrame;
                 lottieView.Play();
             }
         }
index 7712b4b..28ef04d 100755 (executable)
@@ -33,62 +33,62 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 6 </since_tizen>
         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        Normal,
+        Normal = 0,
         /// <summary>
         /// The focused state.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        Focused,
+        Focused = 1,
         /// <summary>
         /// The disabled state.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        Disabled,
+        Disabled = 2,
         /// <summary>
         /// The Selected state.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        Selected,
+        Selected = 4,
         /// <summary>
         /// The Pressed state.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        Pressed,
+        Pressed = 8,
         /// <summary>
         /// The DisabledFocused state.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        DisabledFocused,
+        DisabledFocused = Disabled | Focused,
         /// <summary>
         /// The SelectedFocused state.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        SelectedFocused,
+        SelectedFocused = Focused | Selected,
         /// <summary>
         /// The DisabledSelected state.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        DisabledSelected,
+        DisabledSelected = Disabled | Selected,
         /// <summary>
-        /// Max all.
+        /// The SelectedPressed state.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        Max
+        PressedSelected = Pressed | Selected,
     }
 }
index 01a016f..8043579 100755 (executable)
@@ -149,6 +149,17 @@ namespace Tizen.NUI.BaseComponents
             get;
             set;
         }
+
+        /// <summary>
+        /// PressedSelected State.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public T PressedSelected
+        {
+            get;
+            set;
+        }
+
         /// <summary>
         /// Other State.
         /// </summary>
@@ -185,11 +196,13 @@ namespace Tizen.NUI.BaseComponents
                 case ControlStates.Selected:
                     return Selected != null? Selected : Other;
                 case ControlStates.DisabledFocused:
-                    return DisabledFocused != null? DisabledFocused : Other;
+                    return DisabledFocused != null? DisabledFocused : (Disabled != null ? Disabled : Other);
                 case ControlStates.DisabledSelected:
                     return DisabledSelected != null ? DisabledSelected : (Disabled != null ? Disabled : Other);
                 case ControlStates.SelectedFocused:
                     return SelectedFocused != null ? SelectedFocused : (Selected != null ? Selected : Other);
+                case ControlStates.PressedSelected:
+                    return PressedSelected != null ? PressedSelected : (Selected != null ? Selected : Other);
                 default:
                     return Other;
             }
@@ -211,6 +224,7 @@ namespace Tizen.NUI.BaseComponents
             DisabledSelected = selector.DisabledSelected;
             DisabledFocused = selector.DisabledFocused;
             SelectedFocused = selector.SelectedFocused;
+            PressedSelected = selector.PressedSelected;
             Other = selector.Other;
         }
 
@@ -227,6 +241,7 @@ namespace Tizen.NUI.BaseComponents
             DisabledSelected = (T)(other.DisabledSelected)?.Clone();
             DisabledFocused = (T)(other.DisabledFocused)?.Clone();
             SelectedFocused = (T)(other.SelectedFocused)?.Clone();
+            PressedSelected = (T)(other.PressedSelected)?.Clone();
             Other = (T)(other.Other)?.Clone();
         }
     }
index 192cadd..fbb9be1 100755 (executable)
@@ -71,7 +71,12 @@ namespace Tizen.NUI.BaseComponents
 
         static View() {}
 
-        private ViewStyle viewStyle;
+        /// <summary>
+        /// The Style instance binded with this View.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected ViewStyle viewStyle;
+
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public ViewStyle ViewStyle