protected override View CreateContent()
        {
            Layout = new LinearLayout
            {
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
            };

            BackgroundColor = new TColor(0.1f, 0.1f, 0.1f, 0.5f).ToNative();
            var margin1 = (ushort)20d.ToPixel();
            var margin2 = (ushort)10d.ToPixel();
            var radius  = 8d.ToPixel();

            var isHorizontal = Window.Instance.WindowSize.Width > Window.Instance.WindowSize.Height;
            // container
            var content = new View
            {
                CornerRadius = radius,
                BoxShadow    = new Shadow(20d.ToPixel(), TColor.FromHex("#333333").ToNative()),
                Layout       = new LinearLayout
                {
                    VerticalAlignment   = VerticalAlignment.Center,
                    HorizontalAlignment = HorizontalAlignment.Center,
                    LinearOrientation   = LinearLayout.Orientation.Vertical,
                },
                SizeWidth       = Window.Instance.WindowSize.Width * (isHorizontal ? 0.5f : 0.8f),
                BackgroundColor = TColor.White.ToNative(),
            };

            // title
            content.Add(new Label
            {
                Text                    = _title,
                Margin                  = new Extents(margin1, margin1, margin1, margin2),
                WidthSpecification      = LayoutParamPolicies.MatchParent,
                HorizontalTextAlignment = TextAlignment.Start,
                VerticalTextAlignment   = TextAlignment.Center,
                FontAttributes          = FontAttributes.Bold,
                TextColor               = TColor.FromHex("#000000"),
                PixelSize               = 21d.ToPixel(),
            });

            // message
            content.Add(new Label
            {
                Text               = _message,
                Margin             = new Extents(margin1, margin1, 0, margin2),
                LineBreakMode      = LineBreakMode.CharacterWrap,
                PixelSize          = 16d.ToPixel(),
                WidthSpecification = LayoutParamPolicies.MatchParent,
            });

            var hlayout = new View
            {
                Margin = new Extents(margin1, margin1, 0, margin1),
                Layout = new LinearLayout
                {
                    VerticalAlignment   = VerticalAlignment.Center,
                    HorizontalAlignment = HorizontalAlignment.End,
                    LinearOrientation   = LinearLayout.Orientation.Horizontal,
                },
                WidthSpecification  = LayoutParamPolicies.MatchParent,
                HeightSpecification = LayoutParamPolicies.WrapContent
            };

            content.Add(hlayout);

            var cancelButton = new Button
            {
                Text                = _cancel,
                Focusable           = true,
                HeightSpecification = LayoutParamPolicies.WrapContent,
                TextColor           = TColor.Black,
                BackgroundColor     = TColor.Transparent.ToNative(),
            };

            cancelButton.TextLabel.PixelSize = 15d.ToPixel();
            cancelButton.SizeWidth           = cancelButton.TextLabel.NaturalSize.Width + 15d.ToPixel() * 2;
            cancelButton.Clicked            += (s, e) => SendSubmit(false);
            hlayout.Add(cancelButton);

            if (_accept != null)
            {
                var acceptButton = new Button
                {
                    Margin              = new Extents(margin2, 0, 0, 0),
                    Text                = _accept,
                    Focusable           = true,
                    HeightSpecification = LayoutParamPolicies.WrapContent,
                    TextColor           = TColor.Black,
                    BackgroundColor     = TColor.Transparent.ToNative(),
                };
                acceptButton.TextLabel.PixelSize = 15d.ToPixel();
                acceptButton.SizeWidth           = acceptButton.TextLabel.NaturalSize.Width + 15d.ToPixel() * 2;
                acceptButton.Clicked            += (s, e) => SendSubmit(true);
                hlayout.Add(acceptButton);
            }

            Relayout += (s, e) =>
            {
                var isHorizontal = Window.Instance.WindowSize.Width > Window.Instance.WindowSize.Height;
                content.SizeWidth = Window.Instance.WindowSize.Width * (isHorizontal ? 0.5f : 0.8f);
            };

            return(content);
        }
        public override View Run()
        {
            var view = new View
            {
                BackgroundColor = Color.FromHex("#F9AA33").ToNative(),
                Layout          = new LinearLayout
                {
                    LinearAlignment   = LinearLayout.Alignment.Center,
                    LinearOrientation = LinearLayout.Orientation.Vertical,
                }
            };
            var btn1 = new Button
            {
                Text     = "Open popup",
                FontSize = 10,
            };

            view.Add(btn1);
            btn1.Clicked += (s, e) =>
            {
                Popup popup = MakeSimplePopup();
                popup.Open();

                popup.OutsideClicked += (ss, ee) =>
                {
                    Console.WriteLine($"Popup outside clicked");
                };
                popup.Closed += (_, __) =>
                {
                    Console.WriteLine($"Popup is clsoed");
                };
            };

            var btn2 = new Button
            {
                Text = "Open popup 2"
            };

            view.Add(btn2);

            btn2.Clicked += (s, e) =>
            {
                Popup popup = new Popup
                {
                    BackgroundColor = new Color(0.1f, 0.1f, 0.1f, 0.5f).ToNative(),
                    Layout          = new LinearLayout
                    {
                        LinearAlignment = LinearLayout.Alignment.Center
                    },
                };
                var content = new View
                {
                    Layout = new LinearLayout
                    {
                        LinearOrientation = LinearLayout.Orientation.Vertical,
                    },
                    BackgroundColor     = Color.White.ToNative(),
                    SizeWidth           = 500,
                    HeightSpecification = LayoutParamPolicies.WrapContent
                };

                var title = new Label
                {
                    Text = "Title",
                    WidthSpecification      = LayoutParamPolicies.MatchParent,
                    HorizontalTextAlignment = TextAlignment.Center,
                    VerticalTextAlignment   = TextAlignment.Center,
                    FontAttributes          = FontAttributes.Bold,
                    TextColor  = Color.White,
                    FontSize   = 12,
                    SizeHeight = 80,
                };
                title.UpdateBackgroundColor(Color.FromHex("#344955"));
                content.Add(title);
                var text = new Label
                {
                    LineBreakMode      = LineBreakMode.CharacterWrap,
                    Margin             = new Extents(10, 10, 10, 10),
                    Text               = "message... message.... ddddd dddccc dccccc",
                    WidthSpecification = LayoutParamPolicies.MatchParent,
                };
                content.Add(text);
                var btn = new Button
                {
                    Margin = new Extents(10, 10, 10, 10),
                    Text   = "Close",
                    HeightSpecification = LayoutParamPolicies.WrapContent,
                };
                btn.Clicked += (ss, ee) =>
                {
                    popup.Close();
                };
                var hlayout = new View
                {
                    Layout = new LinearLayout
                    {
                        LinearAlignment   = LinearLayout.Alignment.Center,
                        LinearOrientation = LinearLayout.Orientation.Horizontal,
                    },
                    WidthSpecification  = LayoutParamPolicies.MatchParent,
                    HeightSpecification = LayoutParamPolicies.WrapContent
                };
                hlayout.Add(btn);
                content.Add(hlayout);

                popup.Content = content;
                popup.Open();

                popup.OutsideClicked += (ss, ee) =>
                {
                    Console.WriteLine($"Popup outside clicked");
                };
            };


            var btn3 = new Button
            {
                Text = "Yes/No"
            };

            view.Add(btn3);

            btn3.Clicked += (s, e) =>
            {
                Popup popup = new Popup
                {
                    BackgroundColor = new Color(0.1f, 0.1f, 0.1f, 0.5f).ToNative(),
                    Layout          = new LinearLayout
                    {
                        LinearAlignment = LinearLayout.Alignment.Center
                    },
                };
                var content = new View
                {
                    Layout = new LinearLayout
                    {
                        LinearOrientation = LinearLayout.Orientation.Vertical,
                    },
                    BackgroundColor     = Color.White.ToNative(),
                    WidthSpecification  = LayoutParamPolicies.WrapContent,
                    HeightSpecification = LayoutParamPolicies.WrapContent
                };

                var title = new Label
                {
                    Text = "Choose",
                    WidthSpecification      = LayoutParamPolicies.MatchParent,
                    HorizontalTextAlignment = TextAlignment.Center,
                    VerticalTextAlignment   = TextAlignment.Center,
                    FontAttributes          = FontAttributes.Bold,
                    TextColor  = Color.White,
                    FontSize   = 12,
                    SizeHeight = 80,
                };
                title.UpdateBackgroundColor(Color.FromHex("#344955"));
                content.Add(title);
                var text = new Label
                {
                    LineBreakMode      = LineBreakMode.CharacterWrap,
                    Margin             = new Extents(10, 10, 10, 10),
                    Text               = "Do you want exit?",
                    WidthSpecification = LayoutParamPolicies.MatchParent,
                };
                content.Add(text);
                var btn = new Button
                {
                    Margin = new Extents(10, 10, 10, 10),
                    Text   = "Yes",
                    HeightSpecification = LayoutParamPolicies.WrapContent,
                    SizeWidth           = 200,
                };
                btn.Clicked += (ss, ee) =>
                {
                    popup.Close();
                };
                var hlayout = new View
                {
                    Layout = new LinearLayout
                    {
                        LinearAlignment   = LinearLayout.Alignment.Center,
                        LinearOrientation = LinearLayout.Orientation.Horizontal,
                    },
                    WidthSpecification  = LayoutParamPolicies.MatchParent,
                    HeightSpecification = LayoutParamPolicies.WrapContent
                };
                hlayout.Add(btn);

                var no = new Button
                {
                    Margin = new Extents(10, 10, 10, 10),
                    Text   = "No",
                    HeightSpecification = LayoutParamPolicies.WrapContent,
                    SizeWidth           = 200,
                };
                no.Clicked += (ss, ee) =>
                {
                    popup.Close();
                };
                hlayout.Add(no);

                content.Add(hlayout);

                popup.Content = content;
                popup.Open();

                popup.OutsideClicked += (ss, ee) =>
                {
                    Console.WriteLine($"Popup outside clicked");
                };
            };



            var btn4 = new Button
            {
                Text = "Nested popup"
            };

            view.Add(btn4);

            btn4.Clicked += (s, e) =>
            {
                Popup popup = new Popup
                {
                    BackgroundColor = new Color(0.1f, 0.1f, 0.1f, 0.5f).ToNative(),
                    Layout          = new LinearLayout
                    {
                        LinearAlignment = LinearLayout.Alignment.Center
                    },
                };
                var content = new View
                {
                    Layout = new LinearLayout
                    {
                        LinearOrientation = LinearLayout.Orientation.Vertical,
                    },
                    BackgroundColor     = Color.White.ToNative(),
                    SizeWidth           = 500,
                    HeightSpecification = LayoutParamPolicies.WrapContent
                };

                var title = new Label
                {
                    Text = "Nested",
                    WidthSpecification      = LayoutParamPolicies.MatchParent,
                    HorizontalTextAlignment = TextAlignment.Center,
                    VerticalTextAlignment   = TextAlignment.Center,
                    FontAttributes          = FontAttributes.Bold,
                    TextColor  = Color.White,
                    FontSize   = 12,
                    SizeHeight = 80,
                };
                title.UpdateBackgroundColor(Color.FromHex("#344955"));
                content.Add(title);
                var text = new Label
                {
                    LineBreakMode      = LineBreakMode.CharacterWrap,
                    Margin             = new Extents(10, 10, 10, 10),
                    Text               = "first popup ---------------- asfdasfd-asfd- asdfa",
                    SizeHeight         = 600,
                    WidthSpecification = LayoutParamPolicies.MatchParent,
                };
                content.Add(text);
                var btn = new Button
                {
                    Margin = new Extents(10, 10, 10, 10),
                    Text   = "Open second",
                    HeightSpecification = LayoutParamPolicies.WrapContent,
                };
                btn.Clicked += (ss, ee) =>
                {
                    MakeSimplePopup().Open();
                };
                var hlayout = new View
                {
                    Layout = new LinearLayout
                    {
                        LinearAlignment   = LinearLayout.Alignment.Center,
                        LinearOrientation = LinearLayout.Orientation.Horizontal,
                    },
                    WidthSpecification  = LayoutParamPolicies.MatchParent,
                    HeightSpecification = LayoutParamPolicies.WrapContent
                };
                hlayout.Add(btn);
                content.Add(hlayout);

                popup.Content = content;
                popup.Open();

                popup.OutsideClicked += (ss, ee) =>
                {
                    Console.WriteLine($"Popup outside clicked");
                };
            };


            var btn5 = new Button
            {
                Text = "Unclosed pupup"
            };

            view.Add(btn5);
            btn5.Clicked += (s, e) =>
            {
                var popup = new NotClosedPopup();

                popup.Open();
            };
            return(view);
        }
Exemple #3
0
        protected override View CreateContent()
        {
            Layout = new LinearLayout
            {
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center
            };
            BackgroundColor = new TColor(0.1f, 0.1f, 0.1f, 0.5f).ToNative();
            var margin1 = (ushort)20d.ToPixel();
            var margin2 = (ushort)10d.ToPixel();
            var radius  = 8d.ToPixel();

            var isHorizontal = Window.Instance.WindowSize.Width > Window.Instance.WindowSize.Height;
            // container
            var content = new View
            {
                CornerRadius = radius,
                BoxShadow    = new Shadow(20d.ToPixel(), TColor.Black.ToNative()),
                Layout       = new LinearLayout
                {
                    VerticalAlignment   = VerticalAlignment.Center,
                    HorizontalAlignment = HorizontalAlignment.Center,
                    LinearOrientation   = LinearLayout.Orientation.Vertical,
                },
                SizeWidth       = Window.Instance.WindowSize.Width * (isHorizontal ? 0.5f : 0.8f),
                BackgroundColor = TColor.White.ToNative(),
            };

            // title
            content.Add(new Label
            {
                Text                    = _title,
                Margin                  = new Extents(margin1, margin1, margin1, margin2),
                WidthSpecification      = LayoutParamPolicies.MatchParent,
                HorizontalTextAlignment = TextAlignment.Start,
                VerticalTextAlignment   = TextAlignment.Center,
                FontAttributes          = FontAttributes.Bold,
                TextColor               = TColor.FromHex("#000000"),
                PixelSize               = 21d.ToPixel(),
            });

            // message
            content.Add(new Label
            {
                Text               = _message,
                Margin             = new Extents(margin1, margin1, 0, margin2),
                LineBreakMode      = LineBreakMode.CharacterWrap,
                PixelSize          = 16d.ToPixel(),
                WidthSpecification = LayoutParamPolicies.MatchParent,
            });

            var entry = new Entry
            {
                Margin                = new Extents(margin1, margin1, 0, margin2),
                Text                  = _initialValue,
                Keyboard              = _keyboard,
                Placeholder           = _placeholder ?? "",
                WidthSpecification    = LayoutParamPolicies.MatchParent,
                PlaceholderColor      = TColor.FromRgb(100, 100, 100),
                VerticalTextAlignment = TextAlignment.Center,
                SizeHeight            = 40d.ToPixel(),
                PixelSize             = 16d.ToPixel(),
                BackgroundColor       = TColor.FromRgb(220, 220, 220).ToNative(),
            };

            if (_maxLength != -1)
            {
                entry.MaxLength = _maxLength;
            }
            content.Add(entry);

            var hlayout = new View
            {
                Margin = new Extents(margin1, margin1, 0, margin1),
                Layout = new LinearLayout
                {
                    HorizontalAlignment = HorizontalAlignment.End,
                    LinearOrientation   = LinearLayout.Orientation.Horizontal,
                },
                WidthSpecification  = LayoutParamPolicies.MatchParent,
                HeightSpecification = LayoutParamPolicies.WrapContent
            };

            content.Add(hlayout);

            var cancelButton = new Button
            {
                Text      = _cancel,
                Focusable = true,

                SizeWidth           = (_cancel.Length + 1) * 15d.ToPixel(),
                HeightSpecification = LayoutParamPolicies.WrapContent,

                TextColor       = TColor.Black,
                BackgroundColor = TColor.Transparent.ToNative(),
            };

            cancelButton.TextLabel.PixelSize = 15d.ToPixel();
            cancelButton.SizeWidth           = cancelButton.TextLabel.NaturalSize.Width + 15d.ToPixel() * 2;

            cancelButton.Clicked += (s, e) => SendCancel();
            hlayout.Add(cancelButton);

            var acceptButton = new Button
            {
                Text      = _accept,
                Focusable = true,

                SizeWidth           = (_accept.Length + 1) * 15d.ToPixel(),
                HeightSpecification = LayoutParamPolicies.WrapContent,
                Margin = new Extents(40, 0, 0, 0),

                TextColor       = TColor.Black,
                BackgroundColor = TColor.Transparent.ToNative(),
            };

            acceptButton.TextLabel.PixelSize = 15d.ToPixel();
            acceptButton.SizeWidth           = acceptButton.TextLabel.NaturalSize.Width + 15d.ToPixel() * 2;

            acceptButton.Clicked += (s, e) => SendSubmit(entry.Text);
            hlayout.Add(acceptButton);

            Relayout += (s, e) =>
            {
                var isHorizontal = Window.Instance.WindowSize.Width > Window.Instance.WindowSize.Height;
                content.SizeWidth = Window.Instance.WindowSize.Width * (isHorizontal ? 0.5f : 0.8f);
            };

            return(content);
        }
Exemple #4
0
        protected override View CreateContent()
        {
            Layout = new LinearLayout
            {
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
            };

            BackgroundColor = new TColor(0.1f, 0.1f, 0.1f, 0.5f).ToNative();
            var margin1 = (ushort)20d.ToPixel();
            var margin2 = (ushort)10d.ToPixel();
            var radius  = 8d.ToPixel();

            var isHorizontal = Window.Instance.WindowSize.Width > Window.Instance.WindowSize.Height;
            // container
            var content = new View
            {
                CornerRadius = radius,
                BoxShadow    = new Shadow(20d.ToPixel(), TColor.Black.ToNative()),
                Layout       = new LinearLayout
                {
                    VerticalAlignment   = VerticalAlignment.Center,
                    HorizontalAlignment = HorizontalAlignment.Center,
                    LinearOrientation   = LinearLayout.Orientation.Vertical,
                },
                SizeWidth       = Window.Instance.WindowSize.Width * (isHorizontal ? 0.5f : 0.8f),
                BackgroundColor = TColor.White.ToNative(),
            };

            // title
            content.Add(new Label
            {
                Text                    = _title,
                Margin                  = new Extents(margin1, margin1, margin1, margin2),
                WidthSpecification      = LayoutParamPolicies.MatchParent,
                HorizontalTextAlignment = TextAlignment.Start,
                VerticalTextAlignment   = TextAlignment.Center,
                FontAttributes          = FontAttributes.Bold,
                TextColor               = TColor.FromHex("#000000"),
                PixelSize               = 21d.ToPixel(),
            });

            if (_buttons != null)
            {
                // separator
                content.Add(new View
                {
                    BackgroundColor    = TColor.FromHex("#cccccc").ToNative(),
                    SizeHeight         = 1.5d.ToPixel(),
                    WidthSpecification = LayoutParamPolicies.MatchParent,
                });

                var scrollview = new ScrollView
                {
                    Margin = new Extents(margin1, margin1, 0, 0),
                    VerticalScrollBarVisibility = ScrollBarVisibility.Default,
                    WidthSpecification          = LayoutParamPolicies.MatchParent,
                };
                scrollview.ContentContainer.Layout = new LinearLayout
                {
                    LinearOrientation = LinearLayout.Orientation.Vertical,
                };
                content.Add(scrollview);

                foreach (var item in _buttons)
                {
                    var itemLabel = new Label
                    {
                        Text      = item,
                        Focusable = true,
                        HorizontalTextAlignment = TextAlignment.Start,
                        PixelSize           = 16d.ToPixel(),
                        WidthSpecification  = LayoutParamPolicies.MatchParent,
                        HeightSpecification = LayoutParamPolicies.WrapContent,
                        Margin = new Extents(0, 0, (ushort)5d.ToPixel(), (ushort)5d.ToPixel()),
                    };
                    itemLabel.TouchEvent += (s, e) =>
                    {
                        var state = e.Touch.GetState(0);
                        if (state == PointStateType.Up && itemLabel.IsInside(e.Touch.GetLocalPosition(0)))
                        {
                            SendSubmit(item);
                            return(true);
                        }
                        return(false);
                    };
                    itemLabel.KeyEvent += (s, e) =>
                    {
                        if (e.Key.IsAcceptKeyEvent())
                        {
                            SendSubmit(item);
                            return(true);
                        }
                        return(false);
                    };
                    scrollview.ContentContainer.Add(itemLabel);
                }
                scrollview.SizeHeight = 30d.ToPixel() * Math.Min(_buttons.Count(), 5);

                // separator
                content.Add(new View
                {
                    BackgroundColor    = TColor.FromHex("#cccccc").ToNative(),
                    SizeHeight         = 1.5d.ToPixel(),
                    WidthSpecification = LayoutParamPolicies.MatchParent,
                });
            }

            var hlayout = new View
            {
                Margin = new Extents(margin1, margin1, margin2, margin1),
                Layout = new LinearLayout
                {
                    VerticalAlignment   = VerticalAlignment.Center,
                    HorizontalAlignment = HorizontalAlignment.End,
                    LinearOrientation   = LinearLayout.Orientation.Horizontal,
                },
                WidthSpecification  = LayoutParamPolicies.MatchParent,
                HeightSpecification = LayoutParamPolicies.WrapContent
            };

            content.Add(hlayout);

            if (_destruction != null)
            {
                var destructionButton = new Button
                {
                    Focusable       = true,
                    Text            = _destruction,
                    Margin          = new Extents(0, margin2, 0, 0),
                    TextColor       = TColor.Black,
                    BackgroundColor = TColor.Transparent.ToNative(),
                };
                destructionButton.TextLabel.PixelSize = 15d.ToPixel();
                destructionButton.SizeWidth           = destructionButton.TextLabel.NaturalSize.Width + 15d.ToPixel() * 2;
                destructionButton.Clicked            += (s, e) => SendSubmit(_destruction);
                hlayout.Add(destructionButton);
            }

            var cancelButton = new Button
            {
                Focusable       = true,
                Text            = _cancel,
                TextColor       = TColor.Black,
                BackgroundColor = TColor.Transparent.ToNative(),
            };

            cancelButton.TextLabel.PixelSize = 15d.ToPixel();
            cancelButton.SizeWidth           = cancelButton.TextLabel.NaturalSize.Width + 15d.ToPixel() * 2;
            cancelButton.Clicked            += (s, e) => SendCancel();
            hlayout.Add(cancelButton);

            Relayout += (s, e) =>
            {
                var isHorizontal = Window.Instance.WindowSize.Width > Window.Instance.WindowSize.Height;
                content.SizeWidth = Window.Instance.WindowSize.Width * (isHorizontal ? 0.5f : 0.8f);
            };

            return(content);
        }
        public override View Run()
        {
            var scrollview = new Tizen.UIExtensions.NUI.ScrollView();

            scrollview.ContentContainer.Layout = new LinearLayout
            {
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                LinearOrientation   = LinearLayout.Orientation.Vertical,
            };

            var view = scrollview.ContentContainer;

            view.Add(new Label
            {
                Text                  = "MaterialIconButton",
                TextColor             = Color.White,
                FontSize              = 9,
                FontAttributes        = FontAttributes.Bold,
                VerticalTextAlignment = TextAlignment.Center,
                WidthSpecification    = LayoutParamPolicies.MatchParent,
                SizeHeight            = 100,
                Padding               = new Extents(20, 10, 10, 10),
                BackgroundColor       = Color.FromHex("#2196f3").ToNative(),
                BoxShadow             = new Shadow(5, Color.FromHex("#bbbbbb").ToNative(), new Vector2(0, 5))
            });

            view.Add(new View
            {
                SizeHeight = 20,
            });

            foreach (var icon in Enum.GetValues(typeof(MaterialIcons)))
            {
                view.Add(new Label
                {
                    Padding  = new Extents(10, 0, 0, 0),
                    Text     = icon.ToString(),
                    FontSize = 7,
                    HorizontalTextAlignment = TextAlignment.Start,
                    WidthSpecification      = LayoutParamPolicies.MatchParent,
                    HeightSpecification     = LayoutParamPolicies.WrapContent,
                });

                {
                    var button = new MaterialIconButton()
                    {
                        Icon = (MaterialIcons)icon,
                    };

                    button.SizeHeight = (float)button.Measure(300, 300).Height;
                    button.SizeWidth  = (float)button.Measure(300, 300).Width;
                    view.Add(button);
                }
            }


            foreach (var icon in Enum.GetValues(typeof(MaterialIcons)).Cast <MaterialIcons>().Take(3))
            {
                view.Add(new Label
                {
                    Padding  = new Extents(10, 0, 0, 0),
                    Text     = icon.ToString(),
                    FontSize = 7,
                    HorizontalTextAlignment = TextAlignment.Start,
                    WidthSpecification      = LayoutParamPolicies.MatchParent,
                    HeightSpecification     = LayoutParamPolicies.WrapContent,
                });

                {
                    var button = new MaterialIconButton()
                    {
                        Icon = icon,
                    };

                    button.SizeHeight = 100;
                    button.SizeWidth  = 100;
                    button.UpdateBackgroundColor(Color.Yellow);
                    view.Add(button);
                }
            }

            foreach (var icon in Enum.GetValues(typeof(MaterialIcons)).Cast <MaterialIcons>().Take(3))
            {
                view.Add(new Label
                {
                    Padding  = new Extents(10, 0, 0, 0),
                    Text     = icon.ToString(),
                    FontSize = 7,
                    HorizontalTextAlignment = TextAlignment.Start,
                    WidthSpecification      = LayoutParamPolicies.MatchParent,
                    HeightSpecification     = LayoutParamPolicies.WrapContent,
                });

                {
                    var button = new MaterialIconButton()
                    {
                        Icon = icon,
                    };

                    button.SizeHeight = (float)DeviceInfo.ScalingFactor * 10;
                    button.SizeWidth  = (float)DeviceInfo.ScalingFactor * 10;
                    button.UpdateBackgroundColor(Color.Yellow);
                    view.Add(button);
                }
            }

            return(scrollview);
        }
        public override View Run()
        {
            var scrollview = new Tizen.UIExtensions.NUI.ScrollView();

            scrollview.ContentContainer.Layout = new LinearLayout
            {
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                LinearOrientation   = LinearLayout.Orientation.Vertical,
            };

            var view = scrollview.ContentContainer;

            view.UpdateBackgroundColor(TColor.FromHex("#eeeeee"));

            view.Add(new TitleView
            {
                Title = "Title view 1",
                Icon  = new MaterialIconButton
                {
                    Icon       = MaterialIcons.ArrowBack,
                    SizeWidth  = (float)(25 * DeviceInfo.ScalingFactor),
                    SizeHeight = (float)(25 * DeviceInfo.ScalingFactor),
                    Color      = TColor.White
                },
                Actions =
                {
                    new MaterialIconButton
                    {
                        Icon       = MaterialIcons.MoreVert,
                        SizeWidth  = (float)(25 * DeviceInfo.ScalingFactor),
                        SizeHeight = (float)(25 * DeviceInfo.ScalingFactor),
                        Color      = TColor.White
                    },
                }
            });

            view.Add(new View
            {
                SizeHeight = 20,
            });

            var title2 = new TitleView
            {
                Title = "Title view 2"
            };

            title2.UpdateBackgroundColor(TColor.White);
            title2.Label.TextColor = TColor.Black;
            title2.Icon            = new MaterialIconButton
            {
                Icon       = MaterialIcons.Menu,
                SizeWidth  = (float)(25 * DeviceInfo.ScalingFactor),
                SizeHeight = (float)(25 * DeviceInfo.ScalingFactor),
            };
            title2.Actions.Add(new MaterialIconButton
            {
                Icon       = MaterialIcons.Close,
                SizeWidth  = (float)(25 * DeviceInfo.ScalingFactor),
                SizeHeight = (float)(25 * DeviceInfo.ScalingFactor),
            });


            view.Add(title2);

            view.Add(new View
            {
                SizeHeight = 20,
            });

            var title3 = new TitleView();

            title3.UpdateBackgroundColor(TColor.FromHex("6200EE"));
            title3.Icon = new MaterialIconButton
            {
                Icon       = MaterialIcons.ArrowBack,
                Color      = TColor.White,
                SizeWidth  = (float)(25 * DeviceInfo.ScalingFactor),
                SizeHeight = (float)(25 * DeviceInfo.ScalingFactor),
            };
            title3.Content = new Tizen.UIExtensions.NUI.Entry
            {
                PlaceholderText       = "Search",
                PlaceholderColor      = TColor.FromHex("#222222"),
                VerticalTextAlignment = TextAlignment.Center,
                HeightSpecification   = LayoutParamPolicies.MatchParent,
                WidthSpecification    = LayoutParamPolicies.MatchParent,
                Margin = new Extents(0, 10, 5, 5),
            };
            title3.Content.UpdateBackgroundColor(TColor.FromHex("#eeeeee"));
            title3.Icon = new MaterialIconButton
            {
                Icon       = MaterialIcons.Check,
                SizeWidth  = (float)(25 * DeviceInfo.ScalingFactor),
                SizeHeight = (float)(25 * DeviceInfo.ScalingFactor),
                Color      = TColor.White,
            };
            view.Add(title3);


            view.Add(new View
            {
                SizeHeight = 20,
            });

            var title4 = new TitleView();

            title4.UpdateBackgroundColor(TColor.FromHex("6200EE"));
            title4.Icon = new MaterialIconButton
            {
                Icon       = MaterialIcons.ArrowBack,
                Color      = TColor.White,
                SizeWidth  = (float)(25 * DeviceInfo.ScalingFactor),
                SizeHeight = (float)(25 * DeviceInfo.ScalingFactor),
            };
            title4.Content = new Tizen.UIExtensions.NUI.Entry
            {
                PlaceholderText       = "Search",
                PlaceholderColor      = TColor.FromHex("#222222"),
                VerticalTextAlignment = TextAlignment.Center,
                HeightSpecification   = LayoutParamPolicies.MatchParent,
                WidthSpecification    = LayoutParamPolicies.MatchParent,
                Margin = new Extents(0, 10, 5, 5),
            };
            title4.Content.UpdateBackgroundColor(TColor.FromHex("#eeeeee"));
            title4.Icon = new MaterialIconButton
            {
                Icon       = MaterialIcons.Menu,
                SizeWidth  = (float)(25 * DeviceInfo.ScalingFactor),
                SizeHeight = (float)(25 * DeviceInfo.ScalingFactor),
                Color      = TColor.White,
            };
            title4.Actions.Add(new MaterialIconButton
            {
                Icon       = MaterialIcons.Check,
                SizeWidth  = (float)(25 * DeviceInfo.ScalingFactor),
                SizeHeight = (float)(25 * DeviceInfo.ScalingFactor),
                Color      = TColor.White,
            });
            title4.Actions.Add(new MaterialIconButton
            {
                Icon       = MaterialIcons.Close,
                SizeWidth  = (float)(25 * DeviceInfo.ScalingFactor),
                SizeHeight = (float)(25 * DeviceInfo.ScalingFactor),
                Color      = TColor.White,
            });
            view.Add(title4);

            return(scrollview);
        }