Exemplo n.º 1
0
        public Theme Create()
        {
            var theme = new Theme()
            {
                Id = "Tizen.NUI.Theme.Wearable"
            };

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Popup", new PopupStyle()
            {
                Size            = new Size(500, 280),
                BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1),
                ImageShadow     = new ImageShadow()
                {
                    Url     = FrameworkInformation.ResourcePath + "nui_component_default_popup_shadow.png",
                    Border  = new Rectangle(24, 24, 24, 24),
                    Extents = new Vector2(48, 48)
                },
                Title = new TextLabelStyle()
                {
                    PointSize = 16,
                    Padding   = new Extents(20, 20, 20, 20),
                },
                Buttons = new ButtonStyle()
                {
                    Size            = new Size(0, 80),
                    BackgroundColor = new Selector <Color>()
                    {
                        Normal  = new Color(1, 1, 1, 1),
                        Pressed = new Color(1, 1, 1, 0.5f),
                    },
                    Overlay = new ImageViewStyle()
                    {
                        BackgroundColor = new Selector <Color>()
                        {
                            Pressed = new Color(0, 0, 0, 0.1f),
                            Other   = new Color(1, 1, 1, 1),
                        },
                    },
                    Text = new TextLabelStyle()
                    {
                        TextColor = new Color(0.05f, 0.63f, 0.9f, 1),
                    }
                }
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Progress", 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),
                },
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Slider", 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     = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_n.png",
                    BackgroundImage = new Selector <string>()
                    {
                        Normal  = "",
                        Pressed = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
                    }
                },
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Tab", new TabStyle()
            {
                Size            = new Size(480, 80),
                BackgroundColor = Color.Yellow,
                UnderLine       = new ViewStyle()
                {
                    Size            = new Size(0, 6),
                    BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
                },
                Text = new TextLabelStyle()
                {
                    PointSize = 16,
                    TextColor = new Selector <Color>()
                    {
                        Normal   = Color.Black,
                        Selected = new Color(0.05f, 0.63f, 0.9f, 1),
                    }
                }
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Toast", new ToastStyle()
            {
                Size            = new Size(480, 80),
                BackgroundColor = new Color(0, 0, 0, 0.8f),
                Text            = new TextLabelStyle()
                {
                    Padding = new Extents(12, 12, 8, 8)
                }
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Pagination", new PaginationStyle()
            {
                IndicatorImageUrl = new Selector <string>()
                {
                    Normal   = FrameworkInformation.ResourcePath + "nui_component_default_pagination_normal_dot.png",
                    Selected = FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
                }
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Scrollbar", new ScrollbarStyle()
            {
                TrackThickness = 6,
                ThumbThickness = 6,
                TrackColor     = new Color(1, 1, 1, 0.15f),
                ThumbColor     = new Color(0.6f, 0.6f, 0.6f, 1),
                TrackPadding   = 4
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Button", new ButtonStyle()
            {
                Size            = new Size(210, 72),
                CornerRadius    = 36,
                BackgroundColor = new Selector <Color>()
                {
                    Normal   = new Color(0, 0.1647f, 0.3019f, 0.85f),
                    Pressed  = new Color(0, 0.2475f, 0.5019f, 0.85f),
                    Disabled = new Color(0.2392f, 0.2392f, 0.2392f, 0.85f),
                },
                Opacity = new Selector <float?>()
                {
                    Other    = 1.0f,
                    Disabled = 0.3f,
                },
                Text = new TextLabelStyle()
                {
                    FontFamily          = "SamsungOne 700",
                    PixelSize           = 28,
                    Padding             = new Extents(20, 20, 0, 0),
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                    TextColor           = new Selector <Color>()
                    {
                        Normal   = new Color(0.2196f, 0.6131f, 0.9882f, 1),
                        Disabled = new Color(1, 1, 1, 0.35f),
                    }
                }
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.CheckBox", new LottieButtonStyle()
            {
                LottieUrl = FrameworkInformation.ResourcePath + "nui_wearable_checkbox_icon.png",
                PlayRange = new Selector <LottieFrameInfo>()
                {
                    Selected = new LottieFrameInfo(19, 36),
                    Normal   = new LottieFrameInfo(0, 18)
                },
                Opacity = new Selector <float?>()
                {
                    Other    = 1.0f,
                    Pressed  = 0.6f,
                    Disabled = 0.3f,
                },
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.RadioButton", new LottieButtonStyle()
            {
                LottieUrl = FrameworkInformation.ResourcePath + "nui_wearable_radiobutton_icon.png",
                PlayRange = new Selector <LottieFrameInfo>()
                {
                    Selected = new LottieFrameInfo(0, 12),
                    Normal   = new LottieFrameInfo(13, 25)
                },
                Opacity = new Selector <float?>()
                {
                    Other    = 1.0f,
                    Pressed  = 0.6f,
                    Disabled = 0.3f,
                },
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Switch", new LottieSwitchStyle()
            {
                LottieUrl = FrameworkInformation.ResourcePath + "nui_wearable_switch_icon.png",
                PlayRange = new Selector <LottieFrameInfo>()
                {
                    Selected = new LottieFrameInfo(0, 18),
                    Normal   = new LottieFrameInfo(19, 36)
                },
                Opacity = new Selector <float?>()
                {
                    Other    = 1.0f,
                    Pressed  = 0.6f,
                    Disabled = 0.3f,
                },
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Loading", new LoadingStyle()
            {
                LoadingSize = new Size(360, 360),
            });

            return(theme);
        }
Exemplo n.º 2
0
        public Theme Create()
        {
            var theme = new Theme()
            {
                Id      = Tizen.NUI.DefaultThemeCreator.DefaultId,
                Version = Tizen.NUI.DefaultThemeCreator.DefaultVersion
            };

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Button", new ButtonStyle()
            {
                Size = new Size(339, 96),
                CornerRadiusPolicy = VisualTransformPolicyType.Relative,
                CornerRadius       = 0.2916f,
                BackgroundColor    = new Selector <Color>()
                {
                    Normal   = new Color(0.039f, 0.055f, 0.29f, 1),
                    Focused  = new Color(0, 0.2f, 0.545f, 1),
                    Pressed  = new Color(0.106f, 0.412f, 0.792f, 1),
                    Disabled = new Color(0.765f, 0.792f, 0.824f, 1),
                },
                Text = new TextLabelStyle()
                {
                    PixelSize = 32,
                    TextColor = Color.White,
                }
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.CheckBox", new ButtonStyle()
            {
                Size = new Size(30, 30),
                Icon = new ImageViewStyle()
                {
                    Opacity = new Selector <float?>()
                    {
                        Normal   = 1.0f,
                        Disabled = 0.4f,
                        Selected = 1.0f,
                    },
                    BackgroundImage = new Selector <string>()
                    {
                        Pressed  = FrameworkInformation.ResourcePath + "nui_component_default_checkbox_bg_p.png",
                        Selected = FrameworkInformation.ResourcePath + "nui_component_default_checkbox_bg_p.png",
                        Other    = FrameworkInformation.ResourcePath + "nui_component_default_checkbox_bg_n.png",
                    },
                    ResourceUrl = new Selector <string>()
                    {
                        Pressed  = "",
                        Selected = FrameworkInformation.ResourcePath + "nui_component_default_checkbox_s.png",
                        Other    = "",
                    },
                },
                Text = new TextLabelStyle()
                {
                    PointSize = 12,
                    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),
                    }
                }
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Popup", new PopupStyle()
            {
                Size            = new Size(500, 280),
                BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1),
                ImageShadow     = new ImageShadow()
                {
                    Url     = FrameworkInformation.ResourcePath + "nui_component_default_popup_shadow.png",
                    Border  = new Rectangle(24, 24, 24, 24),
                    Extents = new Vector2(48, 48)
                },
                Title = new TextLabelStyle()
                {
                    PointSize = 16,
                    Padding   = new Extents(20, 20, 20, 20),
                },
                Buttons = new ButtonStyle()
                {
                    Size            = new Size(0, 80),
                    BackgroundColor = new Selector <Color>()
                    {
                        Normal  = new Color(1, 1, 1, 1),
                        Pressed = new Color(1, 1, 1, 0.5f),
                    },
                    Overlay = new ImageViewStyle()
                    {
                        BackgroundColor = new Selector <Color>()
                        {
                            Normal  = new Color(1, 1, 1, 1),
                            Pressed = new Color(0, 0, 0, 0.1f),
                            Other   = new Color(1, 1, 1, 1),
                        },
                    },
                    Text = new TextLabelStyle()
                    {
                        TextColor = new Color(0.05f, 0.63f, 0.9f, 1),
                    }
                }
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Progress", 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),
                },
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.RadioButton", new ButtonStyle()
            {
                Size = new Size(30, 30),
                Icon = new ImageViewStyle()
                {
                    Opacity = new Selector <float?>()
                    {
                        Normal   = 1.0f,
                        Disabled = 0.4f,
                        Selected = 1.0f,
                    },
                    BackgroundImage = new Selector <string>()
                    {
                        Pressed  = FrameworkInformation.ResourcePath + "nui_component_default_radiobutton_p.png",
                        Selected = FrameworkInformation.ResourcePath + "nui_component_default_radiobutton_s.png",
                        Other    = FrameworkInformation.ResourcePath + "nui_component_default_radiobutton_n.png",
                    }
                },
                Text = new TextLabelStyle()
                {
                    PointSize = 12,
                    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),
                    }
                }
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Slider", 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.5f, 0.63f, 0.9f, 1),
                },
                Thumb = new ImageViewStyle()
                {
                    Size            = new Size(50, 50),
                    ResourceUrl     = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_n.png",
                    BackgroundImage = new Selector <string>()
                    {
                        Normal  = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
                        Pressed = FrameworkInformation.ResourcePath + "nui_component_default_slider_thumb_bg_p.png",
                    }
                },
                ValueIndicatorImage = new ImageViewStyle()
                {
                    Size        = new Size(83, 54),
                    ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_slider_value_indicator.png",
                },
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Switch", new SwitchStyle()
            {
                Size  = new Size(96, 60),
                Track = new ImageViewStyle()
                {
                    Size        = new Size(96, 60),
                    ResourceUrl = new Selector <string>()
                    {
                        Normal           = FrameworkInformation.ResourcePath + "nui_component_default_switch_track_n.png",
                        Selected         = FrameworkInformation.ResourcePath + "nui_component_default_switch_track_s.png",
                        Disabled         = FrameworkInformation.ResourcePath + "nui_component_default_switch_track_d.png",
                        DisabledSelected = FrameworkInformation.ResourcePath + "nui_component_default_switch_track_ds.png",
                    }
                },
                Thumb = new ImageViewStyle()
                {
                    Size        = new Size(60, 60),
                    ResourceUrl = new Selector <string>()
                    {
                        Normal   = FrameworkInformation.ResourcePath + "nui_component_default_switch_thumb_n.png",
                        Disabled = FrameworkInformation.ResourcePath + "nui_component_default_switch_thumb_d.png",
                        Selected = FrameworkInformation.ResourcePath + "nui_component_default_switch_thumb_n.png",
                    }
                },
                Text = new TextLabelStyle()
                {
                    PointSize = 12,
                    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),
                    }
                }
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Loading", new LoadingStyle()
            {
                LoadingSize = new Size(100, 100),
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Pagination", new PaginationStyle()
            {
                IndicatorImageUrl = new Selector <string>()
                {
                    Normal   = FrameworkInformation.ResourcePath + "nui_component_default_pagination_normal_dot.png",
                    Selected = FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
                },
                IndicatorSize    = new Size(10, 10),
                IndicatorSpacing = 10,
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.Scrollbar", new ScrollbarStyle()
            {
                TrackThickness = 6,
                ThumbThickness = 6,
                TrackColor     = new Color(1, 1, 1, 0.15f),
                ThumbColor     = new Color(0.6f, 0.6f, 0.6f, 1.0f),
                TrackPadding   = 4
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.RecyclerViewItem", new RecyclerViewItemStyle()
            {
                BackgroundColor = new Selector <Color>()
                {
                    Normal   = new Color(1, 1, 1, 1),
                    Pressed  = new Color(0.85f, 0.85f, 0.85f, 1),
                    Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
                    Selected = new Color(0.701f, 0.898f, 0.937f, 1),
                },
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultLinearItem", new DefaultLinearItemStyle()
            {
                SizeHeight      = 130,
                Padding         = new Extents(20, 20, 5, 5),
                BackgroundColor = new Selector <Color>()
                {
                    Normal   = new Color(1, 1, 1, 1),
                    Pressed  = new Color(0.85f, 0.85f, 0.85f, 1),
                    Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
                    Selected = new Color(0.701f, 0.898f, 0.937f, 1),
                },
                Label = new TextLabelStyle()
                {
                    PointSize = 10,
                    Ellipsis  = true,
                },
                SubLabel = new TextLabelStyle()
                {
                    PointSize = 6,
                    Ellipsis  = true,
                },
                Icon = new ViewStyle()
                {
                    Margin = new Extents(0, 20, 0, 0)
                },
                Extra = new ViewStyle()
                {
                    Margin = new Extents(20, 0, 0, 0)
                },
                Seperator = new ViewStyle()
                {
                    Margin          = new Extents(5, 5, 0, 0),
                    BackgroundColor = new Color(0.78f, 0.78f, 0.78f, 1),
                },
            });
            theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultGridItem", new DefaultGridItemStyle()
            {
                Padding = new Extents(5, 5, 5, 5),
                Caption = new TextLabelStyle()
                {
                    PointSize = 9,
                    Ellipsis  = true,
                },
                Badge = new ViewStyle()
                {
                    Margin = new Extents(5, 5, 5, 5),
                },
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultTitleItem", new DefaultTitleItemStyle()
            {
                SizeHeight      = 90,
                Padding         = new Extents(10, 10, 5, 5),
                BackgroundColor = new Selector <Color>()
                {
                    Normal = new Color(0.78f, 0.78f, 0.78f, 1),
                },
                Label = new TextLabelStyle()
                {
                    PointSize = 10,
                    Ellipsis  = true,
                },
                Icon = new ViewStyle()
                {
                    Margin = new Extents(10, 0, 0, 0)
                },
                Seperator = new ViewStyle()
                {
                    Margin          = new Extents(0, 0, 0, 0),
                    BackgroundColor = new Color(0.85f, 0.85f, 0.85f, 1),
                },
            });

            theme.AddStyleWithoutClone("Tizen.NUI.Components.AppBar", new AppBarStyle()
            {
                Size            = new Size(-1, 120),
                BackgroundColor = new Color("#EEEFF1FF"),
                BackButton      = new ButtonStyle()
                {
                    Size            = new Size(48, 48),
                    CornerRadius    = 0,
                    BackgroundColor = new Color(0, 0, 0, 0),
                    Icon            = new ImageViewStyle()
                    {
                        Size        = new Size(48, 48),
                        ResourceUrl = FrameworkInformation.ResourcePath + "nui_component_default_back_button.png",
                        Color       = new Selector <Color>()
                        {
                            Normal   = new Color("#0A0E4AFF"),
                            Focused  = new Color("#00338BFF"),
                            Pressed  = new Color("#1B69CAFF"),
                            Disabled = new Color("#C3CAD2FF"),
                        },
                    },
                },
                TitleTextLabel = new TextLabelStyle()
                {
                    PixelSize         = 40,
                    VerticalAlignment = VerticalAlignment.Center,
                    TextColor         = new Selector <Color>()
                    {
                        Normal = new Color("#000C2BFF"),
                    }
                },
                ActionView = new ViewStyle()
                {
                    Size            = new Size(-1, 48),
                    CornerRadius    = 0,
                    BackgroundColor = new Color(0, 0, 0, 0),
                },
                ActionButton = new ButtonStyle()
                {
                    Size            = new Size(-1, 48),
                    CornerRadius    = 0,
                    BackgroundColor = new Color(0, 0, 0, 0),
                    Text            = new TextLabelStyle()
                    {
                        PixelSize = 26,
                        TextColor = new Selector <Color>()
                        {
                            Normal   = new Color("#0A0E4AFF"),
                            Focused  = new Color("#00338BFF"),
                            Pressed  = new Color("#1B69CAFF"),
                            Disabled = new Color("#C3CAD2FF"),
                        },
                    },
                    Icon = new ImageViewStyle()
                    {
                        Size  = new Size(-1, 48),
                        Color = new Selector <Color>()
                        {
                            Normal   = new Color("#0A0E4AFF"),
                            Focused  = new Color("#00338BFF"),
                            Pressed  = new Color("#1B69CAFF"),
                            Disabled = new Color("#C3CAD2FF"),
                        },
                    },
                },
                Padding           = new Extents(64, 64, 0, 0),
                NavigationPadding = new Extents(0, 24, 0, 0),
                ActionPadding     = new Extents(40, 0, 0, 0),
                ActionCellPadding = new Size2D(40, 0),
            });

            return(theme);
        }