예제 #1
0
        public void Activate()
        {
            Window window = NUIApplication.GetDefaultWindow();

            navigator = new Navigator()
            {
                WidthResizePolicy  = ResizePolicyType.FillToParent,
                HeightResizePolicy = ResizePolicyType.FillToParent
            };

            window.Add(navigator);

            CreateFirstPage();

            textButton = new Button();
            textButton.BackgroundImage       = CommonResource.GetTVResourcePath() + "component/c_buttonbasic/c_basic_button_white_bg_normal_9patch.png";
            textButton.BackgroundImageBorder = new Rectangle(4, 4, 5, 5);
            textButton.Size           = new Size(100, 80);
            textButton.TextLabel.Text = "Left";

            textButton.PositionUsesPivotPoint = true;
            textButton.ParentOrigin           = Tizen.NUI.ParentOrigin.BottomLeft;
            textButton.PivotPoint             = Tizen.NUI.ParentOrigin.BottomLeft;
            window.Add(textButton);

            textButton.Clicked += (object sender, ClickedEventArgs e) =>
            {
                Window.Instance.RequestResizeToServer(ResizeDirection.BottomLeft);
            };

            textButton1 = new Button();
            textButton1.BackgroundImage       = CommonResource.GetTVResourcePath() + "component/c_buttonbasic/c_basic_button_white_bg_normal_9patch.png";
            textButton1.BackgroundImageBorder = new Rectangle(4, 4, 5, 5);
            textButton1.Size           = new Size(100, 80);
            textButton1.TextLabel.Text = "Right";

            textButton1.PositionUsesPivotPoint = true;
            textButton1.ParentOrigin           = Tizen.NUI.ParentOrigin.BottomRight;
            textButton1.PivotPoint             = Tizen.NUI.ParentOrigin.BottomRight;
            window.Add(textButton1);

            textButton1.Clicked += (object sender, ClickedEventArgs e) =>
            {
                Window.Instance.RequestResizeToServer(ResizeDirection.BottomRight);
            };
        }
예제 #2
0
        private void CreateNullStylePart()
        {
            null_style_parent = new View()
            {
                Size = new Size(960, 540)
            };
            null_style_parent.Layout = new LinearLayout()
            {
                LinearOrientation = LinearLayout.Orientation.Vertical, LinearAlignment = LinearLayout.Alignment.Center, CellPadding = new Size2D(0, 50)
            };
            top_parent.Add(null_style_parent);

            // Add Textlabel of "Null style construction"
            text_nullstyle                     = new TextLabel();
            text_nullstyle.Size                = new Size(400, 70);
            text_nullstyle.PointSize           = 20;
            text_nullstyle.HorizontalAlignment = HorizontalAlignment.Center;
            text_nullstyle.VerticalAlignment   = VerticalAlignment.Center;
            text_nullstyle.BackgroundColor     = Color.Magenta;
            text_nullstyle.Text                = "Null style construction";
            text_nullstyle.Focusable           = true;
            null_style_parent.Add(text_nullstyle);

            // Add ScrollBar of Null style construction
            scrollBar[0]              = new ScrollBar();
            scrollBar[0].Size         = new Size(400, 4);
            scrollBar[0].TrackColor   = Color.Green;
            scrollBar[0].MaxValue     = (int)scrollBar[0].SizeWidth / 10;
            scrollBar[0].MinValue     = 0;
            scrollBar[0].ThumbSize    = new Size(30, 4);
            scrollBar[0].CurrentValue = 0; //set after thumbsize
            scrollBar[0].ThumbColor   = Color.Black;
            null_style_parent.Add(scrollBar[0]);

            scrollBar[1]               = new ScrollBar();
            scrollBar[1].Size          = new Size(400, 4);
            scrollBar[1].TrackColor    = Color.Green;
            scrollBar[1].MaxValue      = (int)scrollBar[1].SizeWidth / 10;
            scrollBar[1].MinValue      = 0;
            scrollBar[1].ThumbSize     = new Size(30, 4);
            scrollBar[1].CurrentValue  = 0;//set after thumbsize
            scrollBar[1].ThumbColor    = Color.Yellow;
            scrollBar[1].TrackImageURL = CommonResource.GetTVResourcePath() + "component/c_progressbar/c_progressbar_white_buffering.png";
            null_style_parent.Add(scrollBar[1]);
        }
예제 #3
0
        public void Activate()
        {
            Window window = Window.Instance;

            ///////////////////////////////////////////////Create by Properties//////////////////////////////////////////////////////////
            pagination1                   = new Pagination();
            pagination1.Name              = "Pagination1";
            pagination1.Position2D        = new Position2D(500, 450);
            pagination1.Size2D            = new Size2D(400, 30);
            pagination1.BackgroundColor   = new Color(1.0f, 1.0f, 1.0f, 0.6f);
            pagination1.IndicatorSize     = new Size(26, 26);
            pagination1.IndicatorImageURL = new Selector <string>()
            {
                Normal   = CommonResource.GetFHResourcePath() + "9. Controller/pagination_ic_nor.png",
                Selected = CommonResource.GetFHResourcePath() + "9. Controller/pagination_ic_sel.png",
            };
            pagination1.IndicatorSpacing = 8;
            pagination1.IndicatorCount   = PAGE_COUNT;
            pagination1.SelectedIndex    = 0;
            window.Add(pagination1);

            ///////////////////////////////////////////////Create by Attributes//////////////////////////////////////////////////////////
            PaginationStyle style = new PaginationStyle();

            style.IndicatorSize     = new Size(15, 15);
            style.IndicatorImageURL = new Selector <string>()
            {
                Normal   = CommonResource.GetTVResourcePath() + "component/c_pagination/c_paganation_medium_dot_normal.png",
                Selected = CommonResource.GetTVResourcePath() + "component/c_pagination/c_paganation_medium_dot_focus.png",
            };
            style.IndicatorSpacing      = 14;
            pagination2                 = new Pagination(style);
            pagination2.Name            = "Pagination2";
            pagination2.Position2D      = new Position2D(500, 500);
            pagination2.Size2D          = new Size2D(400, 30);
            pagination2.BackgroundColor = new Color(1.0f, 1.0f, 1.0f, 0.6f);
            pagination2.IndicatorCount  = PAGE_COUNT;
            pagination2.SelectedIndex   = 0;
            window.Add(pagination2);

            window.KeyEvent += Window_KeyEvent;
        }
예제 #4
0
        public void Activate()
        {
            Window window = NUIApplication.GetDefaultWindow();

            //ImageView imageView1 = new ImageView();
            //imageView1.Size2D = new Size2D(48, 48);
            //imageView1.Position2D = new Position2D(200, 200);
            //imageView1.ResourceUrl = CommonResource.GetFHResourcePath() + "9. Controller/controller_btn_check.png";
            //window.Add(imageView1);

            //ImageView imageView2 = new ImageView();
            //imageView2.Size2D = new Size2D(48, 48);
            //imageView2.Position2D = new Position2D(500, 200);
            //imageView2.ResourceUrl = CommonResource.GetFHResourcePath() + "9. Controller/[Controller] App Primary Color/controller_btn_check_on_24c447.png";
            //window.Add(imageView2);

            root = new View()
            {
                Size2D = new Size2D(1920, 1080),
            };
            window.Add(root);
            window.KeyEvent += Window_KeyEvent;

            textButton = new Button();
            textButton.Style.BackgroundImage       = CommonResource.GetTVResourcePath() + "component/c_buttonbasic/c_basic_button_white_bg_normal_9patch.png";
            textButton.Style.BackgroundImageBorder = new Rectangle(4, 4, 5, 5);
            textButton.Size2D          = new Size2D(300, 80);
            textButton.Position2D      = new Position2D(100, 100);
            textButton.Style.Text.Text = "Button";
            root.Add(textButton);

            iconButton = new Button();
            iconButton.Style.BackgroundImage       = CommonResource.GetTVResourcePath() + "component/c_buttonbasic/c_basic_button_white_bg_normal_9patch.png";
            iconButton.Style.BackgroundImageBorder = new Rectangle(4, 4, 5, 5);
            iconButton.Size2D                 = new Size2D(100, 100);
            iconButton.Position2D             = new Position2D(600, 100);
            iconButton.Style.Icon.ResourceUrl = CommonResource.GetTVResourcePath() + "component/c_radiobutton/c_radiobutton_white_check.png";
            root.Add(iconButton);

            iconTextButton = new Button();
            iconTextButton.Style.BackgroundImage       = CommonResource.GetTVResourcePath() + "component/c_buttonbasic/c_basic_button_white_bg_normal_9patch.png";
            iconTextButton.Style.BackgroundImageBorder = new Rectangle(4, 4, 5, 5);
            iconTextButton.IconRelativeOrientation     = Button.IconOrientation.Left;
            iconTextButton.Style.Icon.ResourceUrl      = CommonResource.GetTVResourcePath() + "component/c_radiobutton/c_radiobutton_white_check.png";
            iconTextButton.Style.IconPadding.Top       = 20;
            iconTextButton.Style.IconPadding.Bottom    = 20;
            iconTextButton.Style.IconPadding.Start     = 20;
            iconTextButton.Style.IconPadding.End       = 20;
            iconTextButton.Style.Text.Text             = "IconTextButton";
            iconTextButton.Style.TextPadding.Top       = 20;
            iconTextButton.Style.TextPadding.Bottom    = 20;
            iconTextButton.Style.TextPadding.Start     = 20;
            iconTextButton.Style.TextPadding.End       = 50;
            iconTextButton.Size2D     = new Size2D(500, 300);
            iconTextButton.Position2D = new Position2D(900, 100);
            root.Add(iconTextButton);

            ///////////////////////////////////////////////Create by Property//////////////////////////////////////////////////////////
            utilityBasicButton = new Button();
            utilityBasicButton.IsSelectable                = true;
            utilityBasicButton.Style.BackgroundImage       = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_normal.png";
            utilityBasicButton.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
            utilityBasicButton.Style.ImageShadow           = new ImageShadow
            {
                Url    = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_shadow.png",
                Border = new Rectangle(5, 5, 5, 5)
            };
            utilityBasicButton.Style.Overlay.ResourceUrl = new Selector <string>
            {
                Pressed = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_press_overlay.png",
                Other   = ""
            };
            utilityBasicButton.Style.Overlay.Border = new Rectangle(5, 5, 5, 5);

            utilityBasicButton.Style.Text.TextColor = new Selector <Color>
            {
                Normal   = new Color(0, 0, 0, 1),
                Pressed  = new Color(0, 0, 0, 0.7f),
                Selected = new Color(0.058f, 0.631f, 0.92f, 1),
                Disabled = new Color(0, 0, 0, 0.4f)
            };

            utilityBasicButton.Size2D               = new Size2D(300, 80);
            utilityBasicButton.Position2D           = new Position2D(XBase, 300);
            utilityBasicButton.Style.Text.PointSize = 20;
            utilityBasicButton.Style.Text.Text      = "UtilityBasicButton";
            utilityBasicButton.IsEnabled            = false;
            root.Add(utilityBasicButton);

            /////////////////////////////////////////////////////////////////////////////////////////////////////////
            utilityServiceButton = new Button();
            utilityServiceButton.Style.BackgroundImage       = CommonResource.GetFHResourcePath() + "3. Button/rectangle_point_btn_normal.png";
            utilityServiceButton.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
            utilityServiceButton.Style.ImageShadow           = new ImageShadow
            {
                Url    = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_shadow.png",
                Border = new Rectangle(5, 5, 5, 5)
            };
            utilityServiceButton.Style.Overlay.ResourceUrl = new Selector <string>
            {
                Pressed = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_press_overlay.png",
                Other   = ""
            };
            utilityServiceButton.Style.Overlay.Border = new Rectangle(5, 5, 5, 5);
            utilityServiceButton.Style.Text.TextColor = new Selector <Color>
            {
                Normal   = new Color(1, 1, 1, 1),
                Pressed  = new Color(1, 1, 1, 0.7f),
                Disabled = new Color(1, 1, 1, 0.4f)
            };

            utilityServiceButton.Size2D               = new Size2D(300, 80);
            utilityServiceButton.Position2D           = new Position2D(XBase, 500);
            utilityServiceButton.Style.Text.PointSize = 20;
            utilityServiceButton.Style.Text.Text      = "ServiceBasicButton";
            root.Add(utilityServiceButton);
            /////////////////////////////////////////////////////////////////////////////////////////////////////////
            utilityToggleButton = new Button();
            utilityToggleButton.IsSelectable          = true;
            utilityToggleButton.Style.BackgroundImage = new Selector <string>
            {
                Normal   = CommonResource.GetFHResourcePath() + "3. Button/rectangle_toggle_btn_normal.png",
                Selected = CommonResource.GetFHResourcePath() + "3. Button/rectangle_point_btn_normal.png",
            };

            utilityToggleButton.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
            utilityToggleButton.Style.ImageShadow           = new ImageShadow
            {
                Url    = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_shadow.png",
                Border = new Rectangle(5, 5, 5, 5)
            };
            utilityToggleButton.Style.Overlay.ResourceUrl = new Selector <string>
            {
                Pressed = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_press_overlay.png",
                Other   = ""
            };
            utilityToggleButton.Style.Overlay.Border = new Rectangle(5, 5, 5, 5);


            utilityToggleButton.Style.Text.TextColor = new Selector <Color>
            {
                Normal   = new Color(0.058f, 0.631f, 0.92f, 1),
                Selected = new Color(1, 1, 1, 1),
            };

            utilityToggleButton.Size2D               = new Size2D(300, 80);
            utilityToggleButton.Position2D           = new Position2D(XBase, 700);
            utilityToggleButton.Style.Text.PointSize = 20;
            utilityToggleButton.Style.Text.Text      = new Selector <string>
            {
                Normal   = "Toggle Off",
                Selected = "Toggle On"
            };
            root.Add(utilityToggleButton);
            /////////////////////////////////////////////////////////////////////////////////////////////////////////
            utilityOvalButton = new Button();
            utilityOvalButton.IsSelectable          = true;
            utilityOvalButton.Style.BackgroundImage = new Selector <string>
            {
                Normal   = CommonResource.GetFHResourcePath() + "3. Button/oval_toggle_btn_normal.png",
                Selected = CommonResource.GetFHResourcePath() + "3. Button/oval_toggle_btn_select.png",
            };
            utilityOvalButton.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
            utilityOvalButton.Style.ImageShadow           = new ImageShadow
            {
                Url    = CommonResource.GetFHResourcePath() + "3. Button/oval_toggle_btn_shadow.png",
                Border = new Rectangle(5, 5, 5, 5)
            };
            utilityOvalButton.Style.Overlay.ResourceUrl = new Selector <string>
            {
                Pressed = CommonResource.GetFHResourcePath() + "3. Button/oval_toggle_btn_press_overlay.png",
                Other   = ""
            };
            utilityOvalButton.Style.Overlay.Border = new Rectangle(5, 5, 5, 5);

            utilityOvalButton.Size2D               = new Size2D(104, 104);
            utilityOvalButton.Position2D           = new Position2D(XBase, 900);
            utilityOvalButton.Style.Text.PointSize = 20;
            root.Add(utilityOvalButton);

            ///////////////////////////////////////////////Create by Attributes//////////////////////////////////////////////////////////
            ButtonStyle familyBasicButtonAttributes = new ButtonStyle
            {
                IsSelectable    = true,
                BackgroundImage = new Selector <string> {
                    All = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_normal.png"
                },
                BackgroundImageBorder = new Selector <Rectangle> {
                    All = new Rectangle(5, 5, 5, 5)
                },
                ImageShadow = new ImageShadow
                {
                    Url    = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_shadow.png",
                    Border = new Rectangle(5, 5, 5, 5)
                },

                Overlay = new ImageViewStyle
                {
                    ResourceUrl = new Selector <string> {
                        Pressed = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_press_overlay.png", Other = ""
                    },
                    Border = new Selector <Rectangle> {
                        All = new Rectangle(5, 5, 5, 5)
                    },
                },

                Text = new TextLabelStyle
                {
                    PointSize = new Selector <float?> {
                        All = 20
                    },
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                    WidthResizePolicy   = ResizePolicyType.FillToParent,
                    HeightResizePolicy  = ResizePolicyType.FillToParent,

                    TextColor = new Selector <Color>
                    {
                        Normal   = new Color(0, 0, 0, 1),
                        Pressed  = new Color(0, 0, 0, 0.7f),
                        Selected = new Color(0.141f, 0.769f, 0.278f, 1),
                        Disabled = new Color(0, 0, 0, 0.4f),
                    },
                }
            };

            familyBasicButton                      = new Button(familyBasicButtonAttributes);
            familyBasicButton.Size2D               = new Size2D(300, 80);
            familyBasicButton.Position2D           = new Position2D(XBase + XPadding, 300);
            familyBasicButton.Style.Text.PointSize = 20;
            familyBasicButton.Style.Text.Text      = "FamilyBasicButton";
            root.Add(familyBasicButton);

            //////////////////////////////////////////////////////////////////////////////////////////////////
            ButtonStyle familyServiceButtonAttributes = new ButtonStyle
            {
                IsSelectable    = false,
                BackgroundImage = new Selector <string> {
                    All = CommonResource.GetFHResourcePath() + "3. Button/[Button] App Primary Color/rectangle_point_btn_normal_24c447.png"
                },
                BackgroundImageBorder = new Selector <Rectangle> {
                    All = new Rectangle(5, 5, 5, 5)
                },

                ImageShadow = new ImageShadow
                {
                    Url    = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_shadow.png",
                    Border = new Rectangle(5, 5, 5, 5)
                },

                Overlay = new ImageViewStyle
                {
                    ResourceUrl = new Selector <string> {
                        Pressed = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_press_overlay.png", Other = ""
                    },
                    Border = new Selector <Rectangle> {
                        All = new Rectangle(5, 5, 5, 5)
                    },
                },

                Text = new TextLabelStyle
                {
                    PointSize = new Selector <float?> {
                        All = 20
                    },
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                    WidthResizePolicy   = ResizePolicyType.FillToParent,
                    HeightResizePolicy  = ResizePolicyType.FillToParent,

                    TextColor = new Selector <Color>
                    {
                        Normal   = new Color(1, 1, 1, 1),
                        Pressed  = new Color(1, 1, 1, 0.7f),
                        Disabled = new Color(1, 1, 1, 0.4f),
                    },
                }
            };

            familyServiceButton                      = new Button(familyServiceButtonAttributes);
            familyServiceButton.Size2D               = new Size2D(300, 80);
            familyServiceButton.Position2D           = new Position2D(XBase + XPadding, 500);
            familyServiceButton.Style.Text.PointSize = 20;
            familyServiceButton.Style.Text.Text      = "FamilySeviceButton";
            root.Add(familyServiceButton);
            //////////////////////////////////////////////////////////////////////////////////////////////////
            ButtonStyle familyToggleButtonAttributes = new ButtonStyle
            {
                IsSelectable    = true,
                BackgroundImage = new Selector <string>
                {
                    Normal   = CommonResource.GetFHResourcePath() + "3. Button/[Button] App Primary Color/rectangle_toggle_btn_normal_24c447.png",
                    Selected = CommonResource.GetFHResourcePath() + "3. Button/[Button] App Primary Color/rectangle_point_btn_normal_24c447.png",
                },
                BackgroundImageBorder = new Selector <Rectangle> {
                    All = new Rectangle(5, 5, 5, 5)
                },

                ImageShadow = new ImageShadow
                {
                    Url    = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_shadow.png",
                    Border = new Rectangle(5, 5, 5, 5)
                },

                Overlay = new ImageViewStyle
                {
                    ResourceUrl = new Selector <string> {
                        Pressed = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_press_overlay.png", Other = ""
                    },
                    Border = new Selector <Rectangle> {
                        All = new Rectangle(5, 5, 5, 5)
                    },
                },

                Text = new TextLabelStyle
                {
                    PointSize = new Selector <float?> {
                        All = 20
                    },
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                    WidthResizePolicy   = ResizePolicyType.FillToParent,
                    HeightResizePolicy  = ResizePolicyType.FillToParent,

                    TextColor = new Selector <Color>
                    {
                        Normal   = new Color(0.141f, 0.769f, 0.278f, 1),
                        Selected = new Color(1, 1, 1, 1),
                    },
                }
            };

            familyToggleButton                      = new Button(familyToggleButtonAttributes);
            familyToggleButton.Size2D               = new Size2D(300, 80);
            familyToggleButton.Position2D           = new Position2D(XBase + XPadding, 700);
            familyToggleButton.Style.Text.PointSize = 20;
            familyToggleButton.Style.Text.Text      = new Selector <string>
            {
                Normal   = "Toggle Off",
                Selected = "Toggle On"
            };
            root.Add(familyToggleButton);
            //////////////////////////////////////////////////////////////////////////////////////////////////
            ButtonStyle familyOvalButtonAttributes = new ButtonStyle
            {
                IsSelectable    = true,
                BackgroundImage = new Selector <string>
                {
                    Normal   = CommonResource.GetFHResourcePath() + "3. Button/oval_toggle_btn_normal.png",
                    Selected = CommonResource.GetFHResourcePath() + "3. Button/[Button] App Primary Color/oval_toggle_btn_select_24c447.png",
                },
                BackgroundImageBorder = new Selector <Rectangle> {
                    All = new Rectangle(5, 5, 5, 5)
                },

                ImageShadow = new ImageShadow
                {
                    Url    = CommonResource.GetFHResourcePath() + "3. Button/oval_toggle_btn_shadow.png",
                    Border = new Rectangle(5, 5, 5, 5)
                },

                Overlay = new ImageViewStyle
                {
                    ResourceUrl = new Selector <string> {
                        Pressed = CommonResource.GetFHResourcePath() + "3. Button/oval_toggle_btn_press_overlay.png", Other = ""
                    },
                    Border = new Selector <Rectangle> {
                        All = new Rectangle(5, 5, 5, 5)
                    },
                },
            };

            familyOvalButton                      = new Button(familyOvalButtonAttributes);
            familyOvalButton.Size2D               = new Size2D(104, 104);
            familyOvalButton.Position2D           = new Position2D(XBase + XPadding, 900);
            familyOvalButton.Style.Text.PointSize = 20;
            root.Add(familyOvalButton);
        }
예제 #5
0
        public void Activate()
        {
            Window window = Window.Instance;

            root = new View()
            {
                Size2D = new Size2D(1920, 1080),
            };

            CreateBoardAndButtons();

            scrollBar1_1            = new ScrollBar();
            scrollBar1_1.Position2D = new Position2D(50, 300);
            scrollBar1_1.Size2D     = new Size2D(300, 4);
            scrollBar1_1.Style.Track.BackgroundColor = Color.Green;
            scrollBar1_1.MaxValue                    = (int)scrollBar1_1.SizeWidth / 10;
            scrollBar1_1.MinValue                    = 0;
            scrollBar1_1.Style.Thumb.Size            = new Size(30, 4);
            scrollBar1_1.CurrentValue                = 0; //set after thumbsize
            scrollBar1_1.Style.Thumb.BackgroundColor = Color.Black;
            root.Add(scrollBar1_1);

            scrollBar1_2            = new ScrollBar();
            scrollBar1_2.Position2D = new Position2D(50, 400);
            scrollBar1_2.Size2D     = new Size2D(300, 4);
            scrollBar1_2.Style.Track.BackgroundColor = Color.Green;
            scrollBar1_2.MaxValue                    = (int)scrollBar1_2.SizeWidth / 10;
            scrollBar1_2.MinValue                    = 0;
            scrollBar1_2.Style.Thumb.Size            = new Size(30, 4);
            scrollBar1_2.CurrentValue                = 0;//set after thumbsize
            scrollBar1_2.Style.Thumb.BackgroundColor = Color.Yellow;
            scrollBar1_2.Style.Track.ResourceUrl     = CommonResource.GetTVResourcePath() + "component/c_progressbar/c_progressbar_white_buffering.png";

            root.Add(scrollBar1_2);

            ScrollBarStyle attr = new ScrollBarStyle
            {
                Track = new ImageViewStyle
                {
                    BackgroundColor = new Selector <Color>
                    {
                        All = new Color(0.43f, 0.43f, 0.43f, 0.1f),
                    }
                },
                Thumb = new ImageViewStyle
                {
                    BackgroundColor = new Selector <Color>
                    {
                        All = new Color(1.0f, 0.0f, 0.0f, 0.2f),
                    }
                },
            };

            scrollBar2_1                  = new ScrollBar(attr);
            scrollBar2_1.Position2D       = new Position2D(500, 300);
            scrollBar2_1.Size2D           = new Size2D(300, 4);
            scrollBar2_1.MaxValue         = (int)scrollBar2_1.SizeWidth / 10;
            scrollBar2_1.MinValue         = 0;
            scrollBar2_1.Style.Thumb.Size = new Size(30, 4);
            scrollBar2_1.CurrentValue     = 0; //set after thumbsize
            root.Add(scrollBar2_1);

            board.UpFocusableView = button1;

            window.Add(root);

            FocusManager.Instance.SetCurrentFocusView(button1);
        }
예제 #6
0
        public void Activate()
        {
            Window window = Window.Instance;

            flexibleView1                 = new FlexibleView();
            flexibleView1.Name            = "RecyclerView";
            flexibleView1.Position2D      = new Position2D(500, 200);
            flexibleView1.Size2D          = new Size2D(400, 450);
            flexibleView1.Padding         = new Extents(10, 10, 10, 10);
            flexibleView1.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f);

            List <ListItemData> dataList = new List <ListItemData>();

            for (int i = 0; i < 131; ++i)
            {
                dataList.Add(new ListItemData(i));
            }
            adapter = new ListBridge(dataList);
            flexibleView1.SetAdapter(adapter);

            LinearLayoutManager layoutManager1 = new LinearLayoutManager(LinearLayoutManager.VERTICAL);

            //GridLayoutManager layoutManager1 = new GridLayoutManager(3, LinearLayoutManager.VERTICAL);
            flexibleView1.SetLayoutManager(layoutManager1);

            flexibleView1.FocusedItemIndex = 0;

            window.Add(flexibleView1);

            flexibleView1.Focusable = true;

            flexibleView1.KeyEvent    += RecyclerView_KeyEvent;
            flexibleView1.FocusGained += FlexibleView_FocusGained;
            flexibleView1.FocusLost   += FlexibleView_FocusLost;

            scrollBar1            = new ScrollBar();
            scrollBar1.Direction  = ScrollBar.DirectionType.Vertical;
            scrollBar1.Position2D = new Position2D(394, 2);
            scrollBar1.Size2D     = new Size2D(4, 446);
            scrollBar1.Style.Track.BackgroundColor = Color.Green;
            scrollBar1.Style.Thumb.Size            = new Size(4, 30);
            scrollBar1.Style.Thumb.BackgroundColor = Color.Yellow;
            scrollBar1.Style.Track.ResourceUrl     = CommonResource.GetTVResourcePath() + "component/c_progressbar/c_progressbar_white_buffering.png";
            flexibleView1.AttachScrollBar(scrollBar1);


            flexibleView2                 = new FlexibleView();
            flexibleView2.Name            = "RecyclerView";
            flexibleView2.Position2D      = new Position2D(500, 800);
            flexibleView2.Size2D          = new Size2D(700, 200);
            flexibleView2.Padding         = new Extents(10, 10, 10, 10);
            flexibleView2.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f);

            flexibleView2.SetAdapter(adapter);

            GridLayoutManager layoutManager2 = new GridLayoutManager(3, LinearLayoutManager.HORIZONTAL);

            flexibleView2.SetLayoutManager(layoutManager2);

            flexibleView2.FocusedItemIndex = 0;

            window.Add(flexibleView2);

            flexibleView2.Focusable = true;

            flexibleView2.KeyEvent    += RecyclerView_KeyEvent;
            flexibleView2.FocusGained += FlexibleView_FocusGained;
            flexibleView2.FocusLost   += FlexibleView_FocusLost;

            scrollBar2            = new ScrollBar();
            scrollBar2.Position2D = new Position2D(2, 194);
            scrollBar2.Size2D     = new Size2D(696, 4);
            scrollBar2.Style.Track.BackgroundColor = Color.Green;
            scrollBar2.Style.Thumb.Size            = new Size(30, 4);
            scrollBar2.Style.Thumb.BackgroundColor = Color.Yellow;
            scrollBar2.Style.Track.ResourceUrl     = CommonResource.GetTVResourcePath() + "component/c_progressbar/c_progressbar_white_buffering.png";
            flexibleView2.AttachScrollBar(scrollBar2);


            FocusManager.Instance.SetCurrentFocusView(flexibleView1);
        }
예제 #7
0
        public void Activate()
        {
            Window window = Window.Instance;

            root = new View()
            {
                Size2D = new Size2D(1920, 1080),
            };
            window.Add(root);

            ///////////////////////////////////////////////Create by Property//////////////////////////////////////////////////////////
            createText[0]            = new TextLabel();
            createText[0].Text       = "Create Tab just by properties";
            createText[0].Size2D     = new Size2D(450, 100);
            createText[0].Position2D = new Position2D(200, 100);
            createText[0].MultiLine  = true;
            root.Add(createText[0]);

            tab                 = new Tab();
            tab.Size2D          = new Size2D(700, 108);
            tab.Position2D      = new Position2D(100, 300);
            tab.BackgroundColor = new Color(1.0f, 1.0f, 1.0f, 0.5f);
            //tab.IsNatureTextWidth = true;
            //tab.ItemGap = 40;
            //tab.LeftSpace = 56;
            //tab.RightSpace = 56;
            //tab.TopSpace = 1;
            //tab.BottomSpace = 0;
            tab.Style.UnderLine.Size            = new Size(1, 3);
            tab.Style.UnderLine.BackgroundColor = color[0];
            tab.Style.Text.PointSize            = 25;
            tab.Style.Text.TextColor            = new Selector <Color>
            {
                Normal   = Color.Black,
                Selected = color[0],
            };
            tab.ItemChangedEvent += TabItemChangedEvent;
            root.Add(tab);

            for (int i = 0; i < 3; i++)
            {
                Tab.TabItemData item = new Tab.TabItemData();
                item.Text = "Tab " + i;
                if (i == 1)
                {
                    item.Text = "Long Tab " + i;
                }
                tab.AddItem(item);
            }
            tab.SelectedItemIndex = 0;

            ///////////////////////////////////////////////Create by Attributes//////////////////////////////////////////////////////////
            createText[1]            = new TextLabel();
            createText[1].Text       = "Create Tab just by Attributes";
            createText[1].Size2D     = new Size2D(450, 100);
            createText[1].Position2D = new Position2D(1000, 100);
            createText[1].MultiLine  = true;
            root.Add(createText[1]);

            TabStyle attrs = new TabStyle
            {
                //IsNatureTextWidth = false,
                ItemPadding = new Extents(56, 56, 1, 0),
                UnderLine   = new ViewStyle
                {
                    Size = new Size(1, 3),
                    PositionUsesPivotPoint = true,
                    ParentOrigin           = Tizen.NUI.ParentOrigin.BottomLeft,
                    PivotPoint             = Tizen.NUI.PivotPoint.BottomLeft,
                    BackgroundColor        = new Selector <Color> {
                        All = color[0]
                    },
                },
                Text = new TextLabelStyle
                {
                    PointSize = new Selector <float?> {
                        All = 25
                    },
                    TextColor = new Selector <Color>
                    {
                        Normal   = Color.Black,
                        Selected = color[0],
                    },
                },
            };

            tab2                   = new Tab(attrs);
            tab2.Size2D            = new Size2D(500, 108);
            tab2.Position2D        = new Position2D(900, 300);
            tab2.BackgroundColor   = new Color(1.0f, 1.0f, 1.0f, 0.5f);
            tab2.ItemChangedEvent += Tab2ItemChangedEvent;
            root.Add(tab2);

            for (int i = 0; i < 3; i++)
            {
                Tab.TabItemData item = new Tab.TabItemData();
                item.Text = "Tab " + i;
                tab2.AddItem(item);
            }
            tab2.SelectedItemIndex = 0;

            button = new Button();
            button.Style.BackgroundImage       = CommonResource.GetTVResourcePath() + "component/c_buttonbasic/c_basic_button_white_bg_normal_9patch.png";
            button.Style.BackgroundImageBorder = new Rectangle(4, 4, 5, 5);
            button.Size2D          = new Size2D(280, 80);
            button.Position2D      = new Position2D(400, 700);
            button.Style.Text.Text = mode[index];
            button.ClickEvent     += ButtonClickEvent;
            root.Add(button);

            button2 = new Button();
            button2.Style.BackgroundImage       = CommonResource.GetTVResourcePath() + "component/c_buttonbasic/c_basic_button_white_bg_normal_9patch.png";
            button2.Style.BackgroundImageBorder = new Rectangle(4, 4, 5, 5);
            button2.Size2D          = new Size2D(580, 80);
            button2.Position2D      = new Position2D(250, 500);
            button2.Style.Text.Text = "LayoutDirection is left to right";
            button2.ClickEvent     += ButtonClickEvent2;
            root.Add(button2);
        }
예제 #8
0
        public void Activate()
        {
            Window window = NUIApplication.GetDefaultWindow();

            root = new View()
            {
                Size            = new Size(1920, 1080),
                BackgroundColor = new Color(0.7f, 0.9f, 0.8f, 1.0f),
                Layout          = new LinearLayout()
                {
                    LinearAlignment   = LinearLayout.Alignment.Center,
                    LinearOrientation = LinearLayout.Orientation.Horizontal,
                    CellPadding       = new Size(50, 50),
                }
            };
            window.Add(root);
            window.KeyEvent += Window_KeyEvent;

            parent1 = new View()
            {
                Size   = new Size(300, 900),
                Layout = new LinearLayout()
                {
                    LinearAlignment   = LinearLayout.Alignment.Top,
                    LinearOrientation = LinearLayout.Orientation.Vertical,
                    CellPadding       = new Size(50, 50),
                }
            };

            parent2 = new View()
            {
                Size   = new Size(300, 900),
                Layout = new LinearLayout()
                {
                    LinearAlignment   = LinearLayout.Alignment.Top,
                    LinearOrientation = LinearLayout.Orientation.Vertical,
                    CellPadding       = new Size(50, 50),
                }
            };

            // Only show a text button.
            textButton = new Button();
            textButton.BackgroundImage       = CommonResource.GetTVResourcePath() + "component/c_buttonbasic/c_basic_button_white_bg_normal_9patch.png";
            textButton.BackgroundImageBorder = new Rectangle(4, 4, 5, 5);
            textButton.Size           = new Size(300, 80);
            textButton.TextLabel.Text = "Button";
            parent1.Add(textButton);

            //Only show an icon button.
            iconButton                       = new Button();
            iconButton.Text                  = "";
            iconButton.Name                  = "IconButton";
            iconButton.BackgroundImage       = CommonResource.GetTVResourcePath() + "component/c_buttonbasic/c_basic_button_white_bg_normal_9patch.png";
            iconButton.BackgroundImageBorder = new Rectangle(4, 4, 5, 5);
            iconButton.Size                  = new Size(80, 80);
            iconButton.Icon.ResourceUrl      = CommonResource.GetTVResourcePath() + "component/c_radiobutton/c_radiobutton_white_check.png";
            parent2.Add(iconButton);
            iconButton.Clicked += (ojb, e) => {
                var    btn  = iconButton.Icon.GetParent() as Button;
                string name = btn.Name;
            };

            parent3 = new View()
            {
                Size   = new Size(600, 400),
                Layout = new LinearLayout()
                {
                    LinearAlignment   = LinearLayout.Alignment.Top,
                    LinearOrientation = LinearLayout.Orientation.Vertical,
                    CellPadding       = new Size(50, 50),
                }
            };

            //Show a button with icon and text.
            iconTextButton                         = new Button();
            iconTextButton.Text                    = "IconTextButton";
            iconTextButton.BackgroundImage         = CommonResource.GetTVResourcePath() + "component/c_buttonbasic/c_basic_button_white_bg_normal_9patch.png";
            iconTextButton.BackgroundImageBorder   = new Rectangle(4, 4, 5, 5);
            iconTextButton.IconRelativeOrientation = Button.IconOrientation.Left;
            iconTextButton.Icon.ResourceUrl        = CommonResource.GetTVResourcePath() + "component/c_radiobutton/c_radiobutton_white_check.png";
            iconTextButton.IconPadding             = new Extents(20, 20, 20, 20);
            iconTextButton.TextPadding             = new Extents(20, 50, 20, 20);
            iconTextButton.Size                    = new Size(500, 300);
            parent3.Add(iconTextButton);

            ///////////////////////////////////////////////Create by Property//////////////////////////////////////////////////////////
            //Create utility basic style of button.
            var utilityBasicButtonStyle = new ButtonStyle()
            {
                Overlay = new ImageViewStyle()
                {
                    ResourceUrl = new Selector <string>
                    {
                        Pressed = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_press_overlay.png",
                        Other   = ""
                    },
                    Border = new Rectangle(5, 5, 5, 5)
                },
                Text = new TextLabelStyle()
                {
                    TextColor = new Selector <Color>
                    {
                        Normal   = new Color(0, 0, 0, 1),
                        Pressed  = new Color(0, 0, 0, 0.7f),
                        Selected = new Color(0.058f, 0.631f, 0.92f, 1),
                        Disabled = new Color(0, 0, 0, 0.4f)
                    },
                    Text      = "UtilityBasicButton",
                    PointSize = 20,
                },
                BackgroundImage       = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_normal.png",
                BackgroundImageBorder = new Rectangle(5, 5, 5, 5),
            };

            utilityBasicButton = new Button();
            utilityBasicButton.ApplyStyle(utilityBasicButtonStyle);
            utilityBasicButton.IsSelectable = true;
            utilityBasicButton.ImageShadow  = new ImageShadow
            {
                Url    = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_shadow.png",
                Border = new Rectangle(5, 5, 5, 5)
            };
            utilityBasicButton.Size      = new Size(300, 80);
            utilityBasicButton.IsEnabled = false;
            parent1.Add(utilityBasicButton);

            //Create utility service style of button.
            var utilityServiceButtonStyle = new ButtonStyle()
            {
                Overlay = new ImageViewStyle()
                {
                    ResourceUrl = new Selector <string>
                    {
                        Pressed = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_press_overlay.png",
                        Other   = ""
                    },
                    Border = new Rectangle(5, 5, 5, 5)
                },
                Text = new TextLabelStyle()
                {
                    TextColor = new Selector <Color>
                    {
                        Normal   = new Color(1, 1, 1, 1),
                        Pressed  = new Color(1, 1, 1, 0.7f),
                        Disabled = new Color(1, 1, 1, 0.4f)
                    },
                    Text      = "ServiceBasicButton",
                    PointSize = 20,
                },
                BackgroundImage       = CommonResource.GetFHResourcePath() + "3. Button/rectangle_point_btn_normal.png",
                BackgroundImageBorder = new Rectangle(5, 5, 5, 5)
            };

            utilityServiceButton = new Button();
            utilityServiceButton.ApplyStyle(utilityServiceButtonStyle);
            utilityServiceButton.ImageShadow = new ImageShadow
            {
                Url    = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_shadow.png",
                Border = new Rectangle(5, 5, 5, 5)
            };

            utilityServiceButton.Size = new Size(300, 80);
            parent1.Add(utilityServiceButton);

            //Create utility toggle style of button.
            var utilityToggleButtonStyle = new ButtonStyle()
            {
                BackgroundImage = new Selector <string>
                {
                    Normal   = CommonResource.GetFHResourcePath() + "3. Button/rectangle_toggle_btn_normal.png",
                    Selected = CommonResource.GetFHResourcePath() + "3. Button/rectangle_point_btn_normal.png",
                },
                Overlay = new ImageViewStyle()
                {
                    ResourceUrl = new Selector <string>
                    {
                        Pressed = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_press_overlay.png",
                        Other   = ""
                    }
                },
                Text = new TextLabelStyle()
                {
                    TextColor = new Selector <Color>
                    {
                        Normal   = new Color(0.058f, 0.631f, 0.92f, 1),
                        Selected = new Color(1, 1, 1, 1),
                    },
                    Text = new Selector <string>
                    {
                        Normal   = "Toggle Off",
                        Selected = "Toggle On"
                    },
                    PointSize = 20
                },
                BackgroundColor = new Selector <Color>()
            };

            utilityToggleButton = new Button();
            utilityToggleButton.ApplyStyle(utilityToggleButtonStyle);
            utilityToggleButton.IsSelectable          = true;
            utilityToggleButton.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
            utilityToggleButton.ImageShadow           = new ImageShadow
            {
                Url    = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_shadow.png",
                Border = new Rectangle(5, 5, 5, 5)
            };
            utilityToggleButton.OverlayImage.Border = new Rectangle(5, 5, 5, 5);

            utilityToggleButton.Size = new Size(300, 80);
            parent1.Add(utilityToggleButton);

            //Create utility oval style of button.
            var utilityOvalButtonStyle = new ButtonStyle()
            {
                BackgroundImage = new Selector <string>
                {
                    Normal   = CommonResource.GetFHResourcePath() + "3. Button/oval_toggle_btn_normal.png",
                    Selected = CommonResource.GetFHResourcePath() + "3. Button/oval_toggle_btn_select.png",
                },
                Overlay = new ImageViewStyle()
                {
                    ResourceUrl = new Selector <string>
                    {
                        Pressed = CommonResource.GetFHResourcePath() + "3. Button/oval_toggle_btn_press_overlay.png",
                        Other   = ""
                    }
                },
                Text = new TextLabelStyle()
                {
                    Text = "",
                },
                BackgroundColor = new Selector <Color>(),
            };

            utilityOvalButton = new Button();
            utilityOvalButton.ApplyStyle(utilityOvalButtonStyle);
            utilityOvalButton.IsSelectable          = true;
            utilityOvalButton.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
            utilityOvalButton.ImageShadow           = new ImageShadow
            {
                Url    = CommonResource.GetFHResourcePath() + "3. Button/oval_toggle_btn_shadow.png",
                Border = new Rectangle(5, 5, 5, 5)
            };
            utilityOvalButton.OverlayImage.Border = new Rectangle(5, 5, 5, 5);

            utilityOvalButton.Size = new Size(104, 104);
            utilityOvalButton.TextLabel.PointSize = 20;
            parent1.Add(utilityOvalButton);

            ///////////////////////////////////////////////Create by Attributes//////////////////////////////////////////////////////////
            //Create family basic style of Button.
            ButtonStyle familyBasicButtonStyle = new ButtonStyle
            {
                IsSelectable    = true,
                BackgroundImage = new Selector <string> {
                    All = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_normal.png"
                },
                BackgroundImageBorder = new Selector <Rectangle> {
                    All = new Rectangle(5, 5, 5, 5)
                },
                ImageShadow = new ImageShadow
                {
                    Url    = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_shadow.png",
                    Border = new Rectangle(5, 5, 5, 5)
                },

                Overlay = new ImageViewStyle
                {
                    ResourceUrl = new Selector <string> {
                        Pressed = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_press_overlay.png", Other = ""
                    },
                    Border = new Selector <Rectangle> {
                        All = new Rectangle(5, 5, 5, 5)
                    },
                },

                Text = new TextLabelStyle
                {
                    PointSize = new Selector <float?> {
                        All = 20
                    },
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                    WidthResizePolicy   = ResizePolicyType.FillToParent,
                    HeightResizePolicy  = ResizePolicyType.FillToParent,

                    TextColor = new Selector <Color>
                    {
                        Normal   = new Color(0, 0, 0, 1),
                        Pressed  = new Color(0, 0, 0, 0.7f),
                        Selected = new Color(0.141f, 0.769f, 0.278f, 1),
                        Disabled = new Color(0, 0, 0, 0.4f),
                    },
                    Text = "FamilyBasicButton",
                }
            };

            familyBasicButton      = new Button(familyBasicButtonStyle);
            familyBasicButton.Size = new Size(300, 80);
            parent2.Add(familyBasicButton);

            //Create family service style of button.
            ButtonStyle familyServiceButtonStyle = new ButtonStyle
            {
                IsSelectable    = false,
                BackgroundImage = new Selector <string> {
                    All = CommonResource.GetFHResourcePath() + "3. Button/[Button] App Primary Color/rectangle_point_btn_normal_24c447.png"
                },
                BackgroundImageBorder = new Selector <Rectangle> {
                    All = new Rectangle(5, 5, 5, 5)
                },

                ImageShadow = new ImageShadow
                {
                    Url    = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_shadow.png",
                    Border = new Rectangle(5, 5, 5, 5)
                },

                Overlay = new ImageViewStyle
                {
                    ResourceUrl = new Selector <string> {
                        Pressed = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_press_overlay.png", Other = ""
                    },
                    Border = new Selector <Rectangle> {
                        All = new Rectangle(5, 5, 5, 5)
                    },
                },

                Text = new TextLabelStyle
                {
                    PointSize = new Selector <float?> {
                        All = 20
                    },
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                    WidthResizePolicy   = ResizePolicyType.FillToParent,
                    HeightResizePolicy  = ResizePolicyType.FillToParent,

                    TextColor = new Selector <Color>
                    {
                        Normal   = new Color(1, 1, 1, 1),
                        Pressed  = new Color(1, 1, 1, 0.7f),
                        Disabled = new Color(1, 1, 1, 0.4f),
                    },
                    Text = "FamilySeviceButton"
                }
            };

            familyServiceButton      = new Button(familyServiceButtonStyle);
            familyServiceButton.Size = new Size(300, 80);
            parent2.Add(familyServiceButton);

            //Create family toggle style of button.
            ButtonStyle familyToggleButtonStyle = new ButtonStyle
            {
                IsSelectable    = true,
                BackgroundImage = new Selector <string>
                {
                    Normal   = CommonResource.GetFHResourcePath() + "3. Button/[Button] App Primary Color/rectangle_toggle_btn_normal_24c447.png",
                    Selected = CommonResource.GetFHResourcePath() + "3. Button/[Button] App Primary Color/rectangle_point_btn_normal_24c447.png",
                },
                BackgroundImageBorder = new Selector <Rectangle> {
                    All = new Rectangle(5, 5, 5, 5)
                },

                ImageShadow = new ImageShadow
                {
                    Url    = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_shadow.png",
                    Border = new Rectangle(5, 5, 5, 5)
                },

                Overlay = new ImageViewStyle
                {
                    ResourceUrl = new Selector <string> {
                        Pressed = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_press_overlay.png", Other = ""
                    },
                    Border = new Selector <Rectangle> {
                        All = new Rectangle(5, 5, 5, 5)
                    },
                },

                Text = new TextLabelStyle
                {
                    PointSize = new Selector <float?> {
                        All = 20
                    },
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                    WidthResizePolicy   = ResizePolicyType.FillToParent,
                    HeightResizePolicy  = ResizePolicyType.FillToParent,

                    TextColor = new Selector <Color>
                    {
                        Normal   = new Color(0.141f, 0.769f, 0.278f, 1),
                        Selected = new Color(1, 1, 1, 1),
                    },
                    Text = new Selector <string>
                    {
                        Normal   = "Toggle Off",
                        Selected = "Toggle On"
                    }
                }
            };

            familyToggleButton      = new Button(familyToggleButtonStyle);
            familyToggleButton.Size = new Size(300, 80);
            parent2.Add(familyToggleButton);

            //Create family oval style of button.
            ButtonStyle familyOvalButtonStyle = new ButtonStyle
            {
                IsSelectable    = true,
                BackgroundImage = new Selector <string>
                {
                    Normal   = CommonResource.GetFHResourcePath() + "3. Button/oval_toggle_btn_normal.png",
                    Selected = CommonResource.GetFHResourcePath() + "3. Button/[Button] App Primary Color/oval_toggle_btn_select_24c447.png",
                },
                BackgroundImageBorder = new Selector <Rectangle> {
                    All = new Rectangle(5, 5, 5, 5)
                },

                ImageShadow = new ImageShadow
                {
                    Url    = CommonResource.GetFHResourcePath() + "3. Button/oval_toggle_btn_shadow.png",
                    Border = new Rectangle(5, 5, 5, 5)
                },

                Overlay = new ImageViewStyle
                {
                    ResourceUrl = new Selector <string> {
                        Pressed = CommonResource.GetFHResourcePath() + "3. Button/oval_toggle_btn_press_overlay.png", Other = ""
                    },
                    Border = new Selector <Rectangle> {
                        All = new Rectangle(5, 5, 5, 5)
                    },
                },
            };

            familyOvalButton      = new Button(familyOvalButtonStyle);
            familyOvalButton.Size = new Size(104, 104);
            parent2.Add(familyOvalButton);

            // Add three layout into root
            root.Add(parent1);
            root.Add(parent2);
            root.Add(parent3);
        }
예제 #9
0
        public void Activate()
        {
            Window window = NUIApplication.GetDefaultWindow();

            root = new View()
            {
                Size            = new Size(1920, 1080),
                BackgroundColor = new Color(0.7f, 0.9f, 0.8f, 1.0f),
            };
            window.Add(root);

            parent1 = new View()
            {
                Size = new Size(1920, 1080),
            };
            parent1.Layout = new LinearLayout()
            {
                LinearOrientation = LinearLayout.Orientation.Horizontal,
                LinearAlignment   = LinearLayout.Alignment.Center,
                CellPadding       = new Size(50, 50)
            };

            parent2 = new View()
            {
                Size = new Size(1032, 980),
            };
            parent2.Layout = new LinearLayout()
            {
                LinearOrientation = LinearLayout.Orientation.Vertical,
                LinearAlignment   = LinearLayout.Alignment.CenterHorizontal,
                CellPadding       = new Size(400, 400)
            };

            ///////////////////////////////////////////////Create by Property//////////////////////////////////////////////////////////
            createText[0]      = new TextLabel();
            createText[0].Text = "Create Popup just by properties";
            createText[0].WidthSpecification  = 500;
            createText[0].HeightSpecification = 100;
            parent2.Add(createText[0]);

            popup             = new Popup();
            popup.MinimumSize = new Size(1032, 184);
            popup.Size        = new Size(1032, 400);
            popup.Position    = new Position(150, 100);

            // Title
            popup.Title.PointSize = 25;
            popup.Title.Size      = new Size(0, 68);
            popup.Title.PositionUsesPivotPoint = true;
            popup.Title.ParentOrigin           = Tizen.NUI.ParentOrigin.TopLeft;
            popup.Title.PivotPoint             = Tizen.NUI.PivotPoint.TopLeft;
            popup.Title.HorizontalAlignment    = HorizontalAlignment.Begin;
            popup.Title.VerticalAlignment      = VerticalAlignment.Bottom;
            popup.Title.Position = new Position(64, 52);
            popup.Title.Text     = "Popup Title";
            popup.Title.Padding  = 0;

            // Shadow
            popup.ImageShadow = new ImageShadow(CommonResource.GetFHResourcePath() + "11. Popup/popup_background_shadow.png", new Rectangle(24, 24, 24, 24), extents: new Vector2(48, 48));

            // Background
            popup.BackgroundImage       = CommonResource.GetFHResourcePath() + "11. Popup/popup_background.png";
            popup.BackgroundImageBorder = new Rectangle(0, 0, 81, 81);

            // Buttons
            popup.AddButton("Yes");
            popup.AddButton("Exit");
            popup.ButtonBackground       = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_normal.png";
            popup.ButtonBackgroundBorder = new Rectangle(5, 5, 5, 5);
            popup.ButtonOverLayBackgroundColorSelector = new Selector <Color>
            {
                Normal  = new Color(1.0f, 1.0f, 1.0f, 0.5f),
                Pressed = new Color(0.0f, 0.0f, 0.0f, 0.5f)
            };
            popup.ButtonImageShadow       = new ImageShadow(CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_shadow.png", new Rectangle(5, 5, 5, 5));
            popup.ButtonTextColor         = color[0];
            popup.ButtonHeight            = 132;
            popup.PopupButtonClickEvent  += PopupButtonClickedEvent;
            popup.LayoutDirectionChanged += PopupLayoutDirectionChanged;
            popup.Post(window);

            contentText                     = new TextLabel();
            contentText.Size                = new Size(1032, 100);
            contentText.PointSize           = 20;
            contentText.HorizontalAlignment = HorizontalAlignment.Begin;
            contentText.VerticalAlignment   = VerticalAlignment.Center;
            contentText.Text                = "Popup ButtonStyle is " + buttonStyles[index];
            contentText.TextColor           = new Color(0, 0, 222, 1);
            popup.AddContentText(contentText);

            ///////////////////////////////////////////////Create by Attributes//////////////////////////////////////////////////////////
            createText[1]      = new TextLabel();
            createText[1].Text = "Create Popup just by Attributes";
            createText[1].WidthSpecification  = 500;
            createText[1].HeightSpecification = 100;
            parent2.Add(createText[1]);

            PopupStyle attrs = new PopupStyle
            {
                MinimumSize     = new Size(1032, 184),
                BackgroundImage = new Selector <string> {
                    All = CommonResource.GetFHResourcePath() + "11. Popup/popup_background.png"
                },
                BackgroundImageBorder = new Selector <Rectangle> {
                    All = new Rectangle(0, 0, 81, 81)
                },
                ImageShadow = new ImageShadow(CommonResource.GetFHResourcePath() + "11. Popup/popup_background_shadow.png", new Rectangle(24, 24, 24, 24), extents: new Vector2(48, 48)),
                Title       = new TextLabelStyle
                {
                    PointSize = new Selector <float?> {
                        All = 25
                    },
                    TextColor = new Selector <Color> {
                        All = Color.Black
                    },
                    Size = new Size(0, 68),
                    PositionUsesPivotPoint = true,
                    ParentOrigin           = Tizen.NUI.ParentOrigin.TopLeft,
                    PivotPoint             = Tizen.NUI.PivotPoint.TopLeft,
                    HorizontalAlignment    = HorizontalAlignment.Begin,
                    VerticalAlignment      = VerticalAlignment.Bottom,
                    Position = new Position(64, 52),
                    Text     = new Selector <string> {
                        All = "Popup Title"
                    },
                },
                Buttons = new ButtonStyle
                {
                    PositionUsesPivotPoint = true,
                    ParentOrigin           = Tizen.NUI.ParentOrigin.BottomLeft,
                    PivotPoint             = Tizen.NUI.PivotPoint.BottomLeft,
                    BackgroundImage        = new Selector <string> {
                        All = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_normal.png"
                    },
                    BackgroundImageBorder = new Selector <Rectangle> {
                        All = new Rectangle(5, 5, 5, 5)
                    },
                    ImageShadow = new ImageShadow(CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_shadow.png", new Rectangle(5, 5, 5, 5)),
                    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, 0.5f),
                            Pressed = new Color(0.0f, 0.0f, 0.0f, 0.5f),
                        }
                    },
                    Text = new TextLabelStyle
                    {
                        PositionUsesPivotPoint = true,
                        ParentOrigin           = Tizen.NUI.ParentOrigin.Center,
                        PivotPoint             = Tizen.NUI.PivotPoint.Center,
                        HorizontalAlignment    = HorizontalAlignment.Center,
                        VerticalAlignment      = VerticalAlignment.Center,
                        TextColor = new Selector <Color> {
                            All = color[index2]
                        }
                    },
                },
            };

            popup2          = new Popup(attrs);
            popup2.Size     = new Size(1032, 400);
            popup2.Position = new Position(150, 600);
            popup2.AddButton("Yes");
            popup2.AddButton("Exit");
            popup2.ButtonHeight            = 132;
            popup2.PopupButtonClickEvent  += PopupButtonClickedEvent;
            popup2.LayoutDirectionChanged += Popup2LayoutDirectionChanged;
            popup2.Post(window);

            contentText2                     = new TextLabel();
            contentText2.Size                = new Size(1032, 100);
            contentText2.PointSize           = 20;
            contentText2.HorizontalAlignment = HorizontalAlignment.Begin;
            contentText2.VerticalAlignment   = VerticalAlignment.Center;
            contentText2.Text                = "Popup2 ButtonStyle is " + buttonStyles[index];
            popup2.ContentView.Add(contentText2);

            button = new Button();
            button.BackgroundImage       = CommonResource.GetTVResourcePath() + "component/c_buttonbasic/c_basic_button_white_bg_normal_9patch.png";
            button.BackgroundImageBorder = new Rectangle(4, 4, 5, 5);
            button.WidthSpecification    = 580;
            button.HeightSpecification   = 80;
            button.TextLabel.Text        = "LayoutDirection is left to right";
            button.Clicked += ButtonClicked;

            parent1.Add(parent2);
            parent1.Add(button);
            root.Add(parent1);
        }
예제 #10
0
        public void Activate()
        {
            Window window = NUIApplication.GetDefaultWindow();

            root = new View()
            {
                Size2D          = new Size2D(1920, 1080),
                BackgroundColor = Color.White,
            };
            window.Add(root);

            ///////////////////////////////////////////////Create by Property//////////////////////////////////////////////////////////
            createText[0]            = new TextLabel();
            createText[0].Text       = "Create DropDown just by properties";
            createText[0].Size2D     = new Size2D(450, 100);
            createText[0].Position2D = new Position2D(200, 100);
            createText[0].MultiLine  = true;
            root.Add(createText[0]);

            #region CreateByProperty
            dropDown                                       = new DropDown();
            dropDown.Size2D                                = new Size2D(900, 108);
            dropDown.Position2D                            = new Position2D(50, 300);
            dropDown.Style.HeaderText.Text                 = "TitleArea";
            dropDown.Style.HeaderText.TextColor            = new Color(0, 0, 0, 1);
            dropDown.Style.HeaderText.PointSize            = 28;
            dropDown.Style.HeaderText.FontFamily           = "SamsungOneUI 500C";
            dropDown.Style.Button.Text.Text                = "DropDown Text";
            dropDown.Style.Button.Text.TextColor           = new Color(0, 0, 0, 1);
            dropDown.Style.Button.Text.PointSize           = 20;
            dropDown.Style.Button.Text.FontFamily          = "SamsungOneUI 500";
            dropDown.Style.Button.Icon.ResourceUrl         = CommonResource.GetFHResourcePath() + "6. List/list_ic_dropdown.png";
            dropDown.Style.Button.Icon.Size                = new Size(48, 48);
            dropDown.Style.Button.IconRelativeOrientation  = Button.IconOrientation.Right;
            dropDown.Style.Button.PositionX                = 56;
            dropDown.SpaceBetweenButtonTextAndIcon         = 8;
            dropDown.Style.ListBackgroundImage.ResourceUrl = CommonResource.GetFHResourcePath() + "10. Drop Down/dropdown_bg.png";
            dropDown.Style.ListBackgroundImage.Border      = new Rectangle(51, 51, 51, 51);
            dropDown.Style.ListBackgroundImage.Size        = new Size(360, 500);
            dropDown.ListMargin.Start                      = 20;
            dropDown.ListMargin.Top                        = 20;
            dropDown.ListPadding                           = new Extents(4, 4, 4, 4);
            root.Add(dropDown);

            for (int i = 0; i < 8; i++)
            {
                DropDown.DropDownDataItem item = new DropDown.DropDownDataItem();
                item.Size            = new Size(360, 96);
                item.BackgroundColor = new Selector <Color>
                {
                    Pressed = new Color(0, 0, 0, 0.4f),
                    Other   = new Color(1, 1, 1, 0),
                };
                item.Text                    = "Normal list " + i;
                item.PointSize               = 18;
                item.FontFamily              = "SamsungOne 500";
                item.TextPosition            = new Position(28, 0);
                item.CheckImageSize          = new Size(40, 40);
                item.CheckImageResourceUrl   = CommonResource.GetFHResourcePath() + "10. Drop Down/dropdown_checkbox_on.png";
                item.CheckImageGapToBoundary = 16;
                dropDown.AddItem(item);
            }

            dropDown.SelectedItemIndex = 3;
            //dropDown.DeleteItem(1);

            //DropDown.DropDownItemData insertItem = new DropDown.DropDownItemData();
            //insertItem.Size2D = new Size2D(360, 96);
            //insertItem.BackgroundColorSelector = new Selector<Color>
            //{
            //    Pressed = new Color(0, 0, 0, 0.4f),
            //    Other = new Color(1, 1, 1, 0),
            //};
            //insertItem.Text = "Insert Normal list ";
            //insertItem.PointSize = 18;
            //insertItem.FontFamily = "SamsungOne 500";
            //insertItem.TextPosition2D = new Position2D(28, 0);
            //insertItem.CheckImageSize = new Size2D(40, 40);
            //insertItem.CheckImageResourceUrl = CommonReosurce.GetFHResourcePath() + "10. Drop Down/dropdown_checkbox_on.png";
            //insertItem.CheckImageRightSpace = 16;
            //dropDown.InsertItem(insertItem, 1);
            ////////Attach scrollbar///////////
            scrollBar            = new ScrollBar();
            scrollBar.Direction  = ScrollBar.DirectionType.Vertical;
            scrollBar.Position2D = new Position2D(394, 2);
            scrollBar.Size2D     = new Size2D(4, 446);
            scrollBar.Style.Track.BackgroundColor = Color.Green;
            scrollBar.Style.Thumb.Size            = new Size(4, 30);
            scrollBar.Style.Thumb.BackgroundColor = Color.Yellow;
            scrollBar.Style.Track.ResourceUrl     = CommonResource.GetTVResourcePath() + "component/c_progressbar/c_progressbar_white_buffering.png";
            dropDown.AttachScrollBar(scrollBar);

            #endregion
            ///////////////////////////////////////////////Create by Attributes//////////////////////////////////////////////////////////
            createText[1]            = new TextLabel();
            createText[1].Text       = "Create DropDown just by Attributes";
            createText[1].Size2D     = new Size2D(450, 100);
            createText[1].Position2D = new Position2D(1000, 100);
            createText[1].MultiLine  = true;
            root.Add(createText[1]);

            #region CreateByAttributes

            DropDownStyle attrs = new DropDownStyle
            {
                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",
                },

                Button = new ButtonStyle
                {
                    Text = new TextLabelStyle
                    {
                        Text = new Selector <string> {
                            All = "DropDown Text"
                        },
                        PointSize = new Selector <float?> {
                            All = 20
                        },
                        TextColor = new Selector <Color> {
                            All = new Color(0, 0, 0, 1)
                        },
                        FontFamily = "SamsungOneUI 500",
                    },
                    Icon = new ImageViewStyle
                    {
                        Size        = new Size(48, 48),
                        ResourceUrl = new Selector <string> {
                            All = CommonResource.GetFHResourcePath() + "6. List/list_ic_dropdown.png"
                        },
                    },
                    IconRelativeOrientation = Button.IconOrientation.Right,
                    PositionX = 56,
                },
                ListBackgroundImage = new ImageViewStyle
                {
                    ResourceUrl = new Selector <string> {
                        All = CommonResource.GetFHResourcePath() + "10. Drop Down/dropdown_bg.png"
                    },
                    Border = new Selector <Rectangle> {
                        All = new Rectangle(51, 51, 51, 51)
                    },
                    Size = new Size(360, 500),
                },
                SpaceBetweenButtonTextAndIcon = 8,
                ListMargin      = new Extents(20, 0, 20, 0),
                BackgroundColor = new Selector <Color> {
                    All = new Color(1, 1, 1, 1)
                },
                ListPadding = new Extents(4, 4, 4, 4),
            };

            dropDown2            = new DropDown(attrs);
            dropDown2.Size2D     = new Size2D(900, 108);
            dropDown2.Position2D = new Position2D(1000, 300);
            root.Add(dropDown2);

            DropDownItemStyle itemAttrs = new DropDownItemStyle
            {
                BackgroundColor = new Selector <Color>
                {
                    Pressed = new Color(0, 0, 0, 0.4f),
                    Other   = new Color(1, 1, 1, 0),
                },
                Text = new TextLabelStyle
                {
                    PointSize = new Selector <float?> {
                        All = 18
                    },
                    FontFamily = "SamsungOne 500",
                    Position   = new Position(28, 0),
                },
                CheckImage = new ImageViewStyle
                {
                    Size        = new Size(40, 40),
                    ResourceUrl = new Selector <string> {
                        All = CommonResource.GetFHResourcePath() + "10. Drop Down/dropdown_checkbox_on.png"
                    },
                },
                CheckImageGapToBoundary = 16,
            };

            for (int i = 0; i < 8; i++)
            {
                DropDown.DropDownDataItem item = new DropDown.DropDownDataItem(itemAttrs);
                item.Size = new Size(360, 96);
                item.Text = "Normal list " + i;
                dropDown2.AddItem(item);
            }
            dropDown2.SelectedItemIndex = 0;

            ////////Attach scrollbar///////////
            scrollBar2            = new ScrollBar();
            scrollBar2.Direction  = ScrollBar.DirectionType.Vertical;
            scrollBar2.Position2D = new Position2D(394, 2);
            scrollBar2.Size2D     = new Size2D(4, 446);
            scrollBar2.Style.Track.BackgroundColor = Color.Green;
            scrollBar2.Style.Thumb.Size            = new Size(4, 30);
            scrollBar2.Style.Thumb.BackgroundColor = Color.Yellow;
            scrollBar2.Style.Track.ResourceUrl     = CommonResource.GetTVResourcePath() + "component/c_progressbar/c_progressbar_white_buffering.png";
            dropDown2.AttachScrollBar(scrollBar2);

            #endregion
        }
예제 #11
0
        public void Activate()
        {
            Window window = NUIApplication.GetDefaultWindow();

            root = new View()
            {
                Size            = new Size(1920, 1080),
                BackgroundColor = new Color(0.7f, 0.9f, 0.8f, 1.0f),
            };
            window.Add(root);

            parent = new View()
            {
                Position = new Position(300, 300),
                Size     = new Size(1150, 450)
            };
            parent.Layout = new LinearLayout()
            {
                LinearOrientation = LinearLayout.Orientation.Horizontal,
                LinearAlignment   = LinearLayout.Alignment.Bottom,
                CellPadding       = new Size(50, 50)
            };
            root.Add(parent);

            // Create vertical flexibleView
            flexibleView1      = new FlexibleView();
            flexibleView1.Name = "RecyclerView1";
            flexibleView1.WidthSpecification  = 400;
            flexibleView1.HeightSpecification = 450;
            flexibleView1.Padding             = new Extents(10, 10, 10, 10);
            flexibleView1.BackgroundColor     = new Color(0.0f, 0.0f, 0.0f, 0.4f);

            List <ListItemData> dataList = new List <ListItemData>();

            for (int i = 0; i < 131; ++i)
            {
                dataList.Add(new ListItemData(i));
            }
            adapter = new ListBridge(dataList);
            flexibleView1.SetAdapter(adapter);

            LinearLayoutManager layoutManager1 = new LinearLayoutManager(LinearLayoutManager.VERTICAL);

            flexibleView1.SetLayoutManager(layoutManager1);

            flexibleView1.FocusedItemIndex = 0;

            parent.Add(flexibleView1);

            flexibleView1.Focusable = true;

            flexibleView1.KeyEvent    += RecyclerView_KeyEvent;
            flexibleView1.FocusGained += FlexibleView_FocusGained;
            flexibleView1.FocusLost   += FlexibleView_FocusLost;

            scrollBar1                     = new ScrollBar();
            scrollBar1.Direction           = ScrollBar.DirectionType.Vertical;
            scrollBar1.Position            = new Position(394, 2);
            scrollBar1.WidthSpecification  = 4;
            scrollBar1.HeightSpecification = 446;
            scrollBar1.TrackColor          = Color.Green;
            scrollBar1.ThumbSize           = new Size(4, 30);
            scrollBar1.ThumbColor          = Color.Yellow;
            scrollBar1.TrackImageURL       = CommonResource.GetTVResourcePath() + "component/c_progressbar/c_progressbar_white_buffering.png";
            flexibleView1.AttachScrollBar(scrollBar1);

            // Create horizontal flexibleView
            flexibleView2      = new FlexibleView();
            flexibleView2.Name = "RecyclerView2";
            flexibleView2.WidthSpecification  = 700;
            flexibleView2.HeightSpecification = 200;
            flexibleView2.Padding             = new Extents(10, 10, 10, 10);
            flexibleView2.BackgroundColor     = new Color(0.0f, 0.0f, 0.0f, 0.4f);

            flexibleView2.SetAdapter(adapter);

            GridLayoutManager layoutManager2 = new GridLayoutManager(3, LinearLayoutManager.HORIZONTAL);

            flexibleView2.SetLayoutManager(layoutManager2);

            flexibleView2.FocusedItemIndex = 0;

            parent.Add(flexibleView2);

            flexibleView2.Focusable = true;

            flexibleView2.KeyEvent    += RecyclerView_KeyEvent;
            flexibleView2.FocusGained += FlexibleView_FocusGained;
            flexibleView2.FocusLost   += FlexibleView_FocusLost;

            scrollBar2                     = new ScrollBar();
            scrollBar2.Direction           = ScrollBar.DirectionType.Horizontal;
            scrollBar2.Position            = new Position(2, 194);
            scrollBar2.WidthSpecification  = 696;
            scrollBar2.HeightSpecification = 4;
            scrollBar2.TrackColor          = Color.Green;
            scrollBar2.ThumbSize           = new Size(30, 4);
            scrollBar2.ThumbColor          = Color.Yellow;
            scrollBar2.TrackImageURL       = CommonResource.GetTVResourcePath() + "component/c_progressbar/c_progressbar_white_buffering.png";
            flexibleView2.AttachScrollBar(scrollBar2);

            FocusManager.Instance.SetCurrentFocusView(flexibleView1);
            FocusManager.Instance.PreFocusChange += onPreFocusChange;
        }
예제 #12
0
        public void Activate()
        {
            Window window = Window.Instance;

            root = new View()
            {
                Size2D          = new Size2D(1920, 1080),
                BackgroundColor = Color.White,
            };
            window.Add(root);

            ///////////////////////////////////////////////Create by Property//////////////////////////////////////////////////////////
            createText[0]            = new TextLabel();
            createText[0].Text       = "Create Popup just by properties";
            createText[0].Size2D     = new Size2D(500, 100);
            createText[0].Position2D = new Position2D(500, 50);
            root.Add(createText[0]);

            popup             = new Popup();
            popup.MinimumSize = new Size2D(1032, 184);
            popup.Size        = new Size(1032, 400);
            popup.Position    = new Position(200, 100);

            // Title
            popup.Style.Title.PointSize           = 25;
            popup.Style.Title.SizeHeight          = 68;
            popup.Style.Title.HorizontalAlignment = HorizontalAlignment.Begin;
            popup.Style.Title.Position            = new Position(64, 52);
            popup.Style.Title.Text = "Popup Title";

            // Shadow
            popup.Style.ImageShadow = new ImageShadow
            {
                Url    = CommonResource.GetFHResourcePath() + "11. Popup/popup_background_shadow.png",
                Border = new Rectangle(24, 24, 24, 24),
                Offset = new Vector2(-24, -24),
                // TODO We do not have shadow extents now, so replace it to scale value
                Scale = new Vector2(1080f / 1032f, 448f / 400f),
            };

            // Background
            popup.BackgroundImage       = CommonResource.GetFHResourcePath() + "11. Popup/popup_background.png";
            popup.BackgroundImageBorder = new Rectangle(0, 0, 81, 81);

            // Buttons
            popup.AddButton("Yes");
            popup.AddButton("Exit");
            popup.ButtonBackground       = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_normal.png";
            popup.ButtonBackgroundBorder = new Rectangle(5, 5, 5, 5);
            popup.ButtonOverLayBackgroundColorSelector = 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),
            };
            popup.ButtonImageShadow = new ImageShadow
            {
                Url    = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_shadow.png",
                Border = new Rectangle(5, 5, 5, 5)
            };
            popup.ButtonTextColor         = color[0];
            popup.ButtonHeight            = 132;
            popup.PopupButtonClickEvent  += PopupButtonClickedEvent;
            popup.LayoutDirectionChanged += PopupLayoutDirectionChanged;
            popup.Post(window);

            contentText                     = new TextLabel();
            contentText.Size2D              = new Size2D(904, 100);
            contentText.PointSize           = 20;
            contentText.HorizontalAlignment = HorizontalAlignment.Begin;
            contentText.VerticalAlignment   = VerticalAlignment.Center;
            contentText.Text                = "Popup ButtonStyle is " + buttonStyles[index];
            contentText.TextColor           = new Color(0, 0, 222, 1);
            popup.AddContentText(contentText);

            ///////////////////////////////////////////////Create by Attributes//////////////////////////////////////////////////////////
            createText[1]            = new TextLabel();
            createText[1].Text       = "Create Popup just by Attributes";
            createText[1].Size2D     = new Size2D(500, 100);
            createText[1].Position2D = new Position2D(500, 550);
            root.Add(createText[1]);

            PopupStyle attrs = new PopupStyle
            {
                MinimumSize     = new Size2D(1032, 184),
                BackgroundImage = new Selector <string> {
                    All = CommonResource.GetFHResourcePath() + "11. Popup/popup_background.png"
                },
                BackgroundImageBorder = new Selector <Rectangle> {
                    All = new Rectangle(0, 0, 81, 81)
                },
                ImageShadow = new ImageShadow
                {
                    Url    = CommonResource.GetFHResourcePath() + "11. Popup/popup_background_shadow.png",
                    Border = new Rectangle(24, 24, 24, 24),
                    Offset = new Vector2(-24, -24),
                    // TODO We do not have shadow extents now, so replace it to scale value
                    Scale = new Vector2(1080f / 1032f, 448f / 400f),
                },
                Title = new TextLabelStyle
                {
                    PointSize = new Selector <float?> {
                        All = 25
                    },
                    TextColor = new Selector <Color> {
                        All = Color.Black
                    },
                    Size = new Size(0, 68),
                    PositionUsesPivotPoint = true,
                    ParentOrigin           = Tizen.NUI.ParentOrigin.TopLeft,
                    PivotPoint             = Tizen.NUI.PivotPoint.TopLeft,
                    HorizontalAlignment    = HorizontalAlignment.Begin,
                    VerticalAlignment      = VerticalAlignment.Bottom,
                    Position = new Position(64, 52),
                    Text     = new Selector <string> {
                        All = "Popup Title"
                    },
                },
                Buttons = new ButtonStyle
                {
                    PositionUsesPivotPoint = true,
                    ParentOrigin           = Tizen.NUI.ParentOrigin.BottomLeft,
                    PivotPoint             = Tizen.NUI.PivotPoint.BottomLeft,
                    BackgroundImage        = new Selector <string> {
                        All = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_normal.png"
                    },
                    BackgroundImageBorder = new Selector <Rectangle> {
                        All = new Rectangle(5, 5, 5, 5)
                    },
                    ImageShadow = new ImageShadow
                    {
                        Url    = CommonResource.GetFHResourcePath() + "3. Button/rectangle_btn_shadow.png",
                        Border = new Rectangle(5, 5, 5, 5),
                    },
                    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 Selector <Color> {
                            All = color[index2]
                        },
                    },
                },
            };

            popup2          = new Popup(attrs);
            popup2.Size     = new Size(1032, 400);
            popup2.Position = new Position(200, 600);
            popup2.AddButton("Yes");
            popup2.AddButton("Exit");
            popup2.ButtonHeight            = 132;
            popup2.PopupButtonClickEvent  += PopupButtonClickedEvent;
            popup2.LayoutDirectionChanged += Popup2LayoutDirectionChanged;
            popup2.Post(window);

            contentText2                     = new TextLabel();
            contentText2.Size2D              = new Size2D(904, 100);
            contentText2.PointSize           = 20;
            contentText2.HorizontalAlignment = HorizontalAlignment.Begin;
            contentText2.VerticalAlignment   = VerticalAlignment.Center;
            contentText2.Text                = "Popup2 ButtonStyle is " + buttonStyles[index];
            popup2.ContentView.Add(contentText2);

            button = new Button();
            button.Style.BackgroundImage       = CommonResource.GetTVResourcePath() + "component/c_buttonbasic/c_basic_button_white_bg_normal_9patch.png";
            button.Style.BackgroundImageBorder = new Rectangle(4, 4, 5, 5);
            button.Size2D          = new Size2D(580, 80);
            button.Position2D      = new Position2D(1300, 500);
            button.Style.Text.Text = "LayoutDirection is left to right";
            button.ClickEvent     += ButtonClickEvent;
            root.Add(button);
        }
예제 #13
0
        public void Activate()
        {
            Window window = NUIApplication.GetDefaultWindow();

            //Create root view with linear layout.
            root = new View()
            {
                Size            = new Size(1920, 1080),
                BackgroundColor = new Color(0.7f, 0.9f, 0.8f, 1.0f),
                Layout          = new LinearLayout()
                {
                    LinearOrientation = LinearLayout.Orientation.Horizontal,
                    CellPadding       = new Size(50, 50),
                    LinearAlignment   = LinearLayout.Alignment.Center,
                }
            };
            window.Add(root);

            ///////////////////////////////////////////////Create by Property//////////////////////////////////////////////////////////
            parent1 = new View()
            {
                Size   = new Size(900, 800),
                Layout = new LinearLayout()
                {
                    LinearOrientation = LinearLayout.Orientation.Vertical,
                    CellPadding       = new Size(50, 50),
                    LinearAlignment   = LinearLayout.Alignment.Top,
                }
            };

            root.Add(parent1);
            // Create a description text.
            createText[0]           = new TextLabel();
            createText[0].Text      = "Create DropDown just by properties";
            createText[0].Size      = new Size(800, 100);
            createText[0].MultiLine = true;
            parent1.Add(createText[0]);

            //Create a dropdown by property.
            #region CreateByProperty
            dropDown = new DropDown();
            var style = dropDown.Style;
            style.Button.BackgroundImage  = "";
            style.Button.Icon.ResourceUrl = CommonResource.GetFHResourcePath() + "6. List/list_ic_dropdown.png";
            style.Button.Text.PointSize   = 20;
            style.Button.Text.FontFamily  = "SamsungOneUI 500";
            style.Button.Text.TextColor   = new Color(0, 0, 0, 1);
            dropDown.ApplyStyle(style);
            dropDown.Size                            = new Size(900, 108);
            dropDown.HeaderText.Text                 = "TitleArea";
            dropDown.HeaderText.TextColor            = new Color(0, 0, 0, 1);
            dropDown.HeaderText.PointSize            = 28;
            dropDown.HeaderText.FontFamily           = "SamsungOneUI 500C";
            dropDown.HeaderText.PositionX            = 50;
            dropDown.Button.TextLabel.Text           = "DropDown Text";
            dropDown.Button.Icon.Size                = new Size(48, 48);
            dropDown.Button.IconRelativeOrientation  = Button.IconOrientation.Right;
            dropDown.Button.ParentOrigin             = ParentOrigin.CenterLeft;
            dropDown.Button.PivotPoint               = PivotPoint.CenterLeft;
            dropDown.Button.PositionX                = 56;
            dropDown.SpaceBetweenButtonTextAndIcon   = 8;
            dropDown.ListBackgroundImage.ResourceUrl = CommonResource.GetFHResourcePath() + "10. Drop Down/dropdown_bg.png";
            dropDown.ListBackgroundImage.Border      = new Rectangle(51, 51, 51, 51);
            dropDown.ListBackgroundImage.Size        = new Size(360, 500);
            dropDown.ListMargin.Start                = 20;
            dropDown.ListMargin.Top                  = 20;
            dropDown.ListPadding                     = new Extents(4, 4, 4, 4);
            dropDown.BackgroundColor                 = new Color(1, 1, 1, 1);
            parent1.Add(dropDown);
            for (int i = 0; i < 8; i++)
            {
                DropDown.DropDownDataItem item = new DropDown.DropDownDataItem();
                item.Size            = new Size(360, 96);
                item.BackgroundColor = new Selector <Color>
                {
                    Pressed = new Color(0, 0, 0, 0.4f),
                    Other   = new Color(1, 1, 1, 0),
                };
                item.Text                    = "Normal list " + i;
                item.PointSize               = 18;
                item.FontFamily              = "SamsungOne 500";
                item.TextPosition            = new Position(28, 0);
                item.CheckImageSize          = new Size(40, 40);
                item.CheckImageResourceUrl   = CommonResource.GetFHResourcePath() + "10. Drop Down/dropdown_checkbox_on.png";
                item.CheckImageGapToBoundary = 16;
                dropDown.AddItem(item);
            }

            dropDown.SelectedItemIndex = 3;

            ////////Attach scrollbar///////////
            scrollBar               = new ScrollBar();
            scrollBar.Direction     = ScrollBar.DirectionType.Vertical;
            scrollBar.Size          = new Size(4, 446);
            scrollBar.TrackColor    = Color.Green;
            scrollBar.ThumbSize     = new Size(4, 30);
            scrollBar.ThumbColor    = Color.Yellow;
            scrollBar.TrackImageURL = CommonResource.GetTVResourcePath() + "component/c_progressbar/c_progressbar_white_buffering.png";
            dropDown.AttachScrollBar(scrollBar);

            #endregion
            ///////////////////////////////////////////////Create by Attributes//////////////////////////////////////////////////////////
            parent2 = new View()
            {
                Size   = new Size(900, 800),
                Layout = new LinearLayout()
                {
                    LinearOrientation = LinearLayout.Orientation.Vertical,
                    CellPadding       = new Size(50, 50),
                    LinearAlignment   = LinearLayout.Alignment.Top,
                }
            };
            root.Add(parent2);

            // Create a description text.
            createText[1]           = new TextLabel();
            createText[1].Text      = "Create DropDown just by Attributes";
            createText[1].Size      = new Size(800, 100);
            createText[1].MultiLine = true;
            parent2.Add(createText[1]);

            //Create a dropdown by style.
            #region CreateByStyle

            DropDownStyle dropDownStyle = new DropDownStyle
            {
                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",
                    PositionX  = 50,
                },

                Button = new ButtonStyle
                {
                    Text = new TextLabelStyle
                    {
                        Text = new Selector <string> {
                            All = "DropDown Text"
                        },
                        PointSize = new Selector <float?> {
                            All = 20
                        },
                        TextColor = new Selector <Color> {
                            All = new Color(0, 0, 0, 1)
                        },
                        FontFamily = "SamsungOneUI 500",
                    },
                    Icon = new ImageViewStyle
                    {
                        Size        = new Size(48, 48),
                        ResourceUrl = new Selector <string> {
                            All = CommonResource.GetFHResourcePath() + "6. List/list_ic_dropdown.png"
                        },
                    },
                    IconRelativeOrientation = Button.IconOrientation.Right,
                    PositionX       = 56,
                    BackgroundImage = "",
                },
                ListBackgroundImage = new ImageViewStyle
                {
                    ResourceUrl = new Selector <string> {
                        All = CommonResource.GetFHResourcePath() + "10. Drop Down/dropdown_bg.png"
                    },
                    Border = new Selector <Rectangle> {
                        All = new Rectangle(51, 51, 51, 51)
                    },
                    Size = new Size(360, 500),
                },
                SpaceBetweenButtonTextAndIcon = 8,
                ListMargin      = new Extents(20, 0, 20, 0),
                BackgroundColor = new Selector <Color> {
                    All = new Color(1, 1, 1, 1)
                },
                ListPadding = new Extents(4, 4, 4, 4),
            };

            dropDown2      = new DropDown(dropDownStyle);
            dropDown2.Size = new Size(900, 108);
            parent2.Add(dropDown2);

            DropDownItemStyle itemStyle = new DropDownItemStyle
            {
                BackgroundColor = new Selector <Color>
                {
                    Pressed = new Color(0, 0, 0, 0.4f),
                    Other   = new Color(1, 1, 1, 0),
                },
                Text = new TextLabelStyle
                {
                    PointSize = new Selector <float?> {
                        All = 18
                    },
                    FontFamily = "SamsungOne 500",
                    Position   = new Position(28, 0),
                },
                CheckImage = new ImageViewStyle
                {
                    Size        = new Size(40, 40),
                    ResourceUrl = new Selector <string> {
                        All = CommonResource.GetFHResourcePath() + "10. Drop Down/dropdown_checkbox_on.png"
                    },
                },
                CheckImageGapToBoundary = 16,
            };

            for (int i = 0; i < 8; i++)
            {
                DropDown.DropDownDataItem item = new DropDown.DropDownDataItem(itemStyle);
                item.Size = new Size(360, 96);
                item.Text = "Normal list " + i;
                dropDown2.AddItem(item);
            }
            dropDown2.SelectedItemIndex = 0;

            ////////Attach scrollbar///////////
            scrollBar2               = new ScrollBar();
            scrollBar2.Direction     = ScrollBar.DirectionType.Vertical;
            scrollBar2.Size          = new Size(4, 446);
            scrollBar2.TrackColor    = Color.Green;
            scrollBar2.ThumbSize     = new Size(4, 30);
            scrollBar2.ThumbColor    = Color.Yellow;
            scrollBar2.TrackImageURL = CommonResource.GetTVResourcePath() + "component/c_progressbar/c_progressbar_white_buffering.png";
            dropDown2.AttachScrollBar(scrollBar2);

            #endregion
            //Add all views into root view.
            root.Add(parent1);
            root.Add(parent2);
        }