示例#1
0
        protected override void Dispose(DisposeTypes type)
        {
            if (disposed)
            {
                return;
            }

            if (type == DisposeTypes.Explicit)
            {
                if (LayoutContent != null)
                {
                    LayoutContent.Remove(Content);
                    Content.Dispose();
                    Content = null;

                    if (isThemeButtonVisible)
                    {
                        LayoutContent.Remove(UtilityButton);
                        UtilityButton.Dispose();
                        LayoutContent.Remove(FoodButton);
                        FoodButton.Dispose();
                        LayoutContent.Remove(FamilyButton);
                        FamilyButton.Dispose();
                        LayoutContent.Remove(KitchenButton);
                        KitchenButton.Dispose();
                    }

                    LayoutContent.GetParent().Remove(LayoutContent);
                    LayoutContent.Dispose();
                    LayoutContent = null;
                }

                if (LayoutHeader != null)
                {
                    LayoutHeader.GetParent().Remove(LayoutHeader);
                    LayoutHeader.Dispose();
                    LayoutHeader = null;
                }
            }

            base.Dispose(type);
        }
示例#2
0
        public void Activate()
        {
            Window.Instance.BackgroundColor = Color.White;
            root            = new SampleLayout(false);
            root.HeaderText = "Header";

            root1 = new View()
            {
                SizeWidth       = 1080,
                Position2D      = new Position2D(0, 0),
                BackgroundColor = new Color(1.0f, 1.0f, 0, 0.7f),
                SizeHeight      = 200,
            };

            Controls.Header header1 = new Tizen.FH.NUI.Controls.Header();
            header1.Position2D          = new Position2D(0, 0);
            header1.BackgroundColor     = new Color(255, 255, 255, 1);
            header1.Size2D              = new Size2D(1080, 128);
            header1.HeaderText          = "Title Area Default";
            header1.HeaderTextColor     = new Color(0, 0, 0, 1);    //black
            header1.LinebackgroundColor = new Color(0, 0, 0, 0.2f); //white

            root1.Add(header1);
            root.Add(root1);

            root2 = new View()
            {
                SizeWidth       = 1080,
                Position2D      = new Position2D(0, 210),
                BackgroundColor = new Color(1.0f, 1.0f, 0, 0.7f),
                SizeHeight      = 200,
            };

            Controls.Header header2 = new Tizen.FH.NUI.Controls.Header();
            header2.Position2D          = new Position2D(0, 0);
            header2.Size2D              = new Size2D(1080, 128);
            header1.BackgroundColor     = new Color(255, 255, 255, 0.7f);
            header2.HeaderText          = "Title Area Opqaue";
            header2.HeaderTextColor     = new Color(0, 0, 0, 1);    //black
            header2.LinebackgroundColor = new Color(0, 0, 0, 0.2f); //black


            root2.Add(header2);
            root.Add(root2);

            root3 = new View()
            {
                SizeWidth       = 1080,
                Position2D      = new Position2D(0, 420),
                BackgroundColor = new Color(0, 0, 0, 1),
                SizeHeight      = 200,
            };

            Controls.Header header3 = new Controls.Header();
            header3.Position2D          = new Position2D(0, 0);
            header3.Size2D              = new Size2D(1080, 128);
            header3.HeaderText          = "Title Area Transparency";
            header3.HeaderTextColor     = new Color(255, 255, 255, 1);    //white
            header3.LinebackgroundColor = new Color(255, 255, 255, 0.2f); //white


            root3.Add(header3);
            root.Add(root3);
        }
示例#3
0
        public SampleLayout(bool isThemeButtonVisiable = true)
        {
            Size2D = new Size2D(Window.Instance.Size.Width, Window.Instance.Size.Height);
            //Window.Instance.Add(this);
            LayoutHeader = new Tizen.FH.NUI.Controls.Header("DefaultHeader");
            LayoutHeader.PositionY = 0;

            LayoutContent = new View
            {
                Size2D = new Size2D(Window.Instance.Size.Width, Window.Instance.Size.Height - 128),
                Position2D = new Position2D(0, 128),
            };

            Content = new View
            {
                Size2D = new Size2D(Window.Instance.Size.Width, Window.Instance.Size.Height - 128 - 150),
                Position2D = new Position2D(0, 150),
            };
            LayoutContent.Add(Content);

            if (isThemeButtonVisiable)
            {
                ButtonAttributes buttonAttributes = new ButtonAttributes
                {
                    IsSelectable = true,
                    BackgroundImageAttributes = new ImageAttributes
                    {
                        ResourceURL = new StringSelector { All = CommonResource.GetResourcePath() + "3. Button/rectangle_point_btn_normal.png" },
                        Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) }
                    },

                    ShadowImageAttributes = new ImageAttributes
                    {
                        ResourceURL = new StringSelector { All = CommonResource.GetResourcePath() + "3. Button/rectangle_btn_shadow.png" },
                        Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) }
                    },

                    OverlayImageAttributes = new ImageAttributes
                    {
                        ResourceURL = new StringSelector { Pressed = CommonResource.GetResourcePath() + "3. Button/rectangle_btn_press_overlay.png", Other = "" },
                        Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) },
                    },

                    TextAttributes = new TextAttributes
                    {
                        PointSize = new FloatSelector { All = 30 },
                        HorizontalAlignment = HorizontalAlignment.Center,
                        VerticalAlignment = VerticalAlignment.Center,
                        WidthResizePolicy = ResizePolicyType.FillToParent,
                        HeightResizePolicy = ResizePolicyType.FillToParent,

                        TextColor = new ColorSelector
                        {
                            All = new Color(0, 0, 0, 1),
                        },
                    }
                };

                UtilityButton = new Tizen.NUI.CommonUI.Button(buttonAttributes);
                UtilityButton.Size2D = new Size2D(200, 80);
                UtilityButton.Position2D = new Position2D(56, 32);
                UtilityButton.Text = "Utility";
                UtilityButton.ClickEvent += UtilityButton_ClickEvent;
                LayoutContent.Add(UtilityButton);

                buttonAttributes.BackgroundImageAttributes.ResourceURL.All = CommonResource.GetResourcePath() + "3. Button/[Button] App Primary Color/rectangle_point_btn_normal_ec7510.png";
                FoodButton = new Tizen.NUI.CommonUI.Button(buttonAttributes);
                FoodButton.Size2D = new Size2D(200, 80);
                FoodButton.Position2D = new Position2D(312, 32);
                FoodButton.Text = "Food";
                FoodButton.ClickEvent += FoodButton_ClickEvent;
                LayoutContent.Add(FoodButton);

                buttonAttributes.BackgroundImageAttributes.ResourceURL.All = CommonResource.GetResourcePath() + "3. Button/[Button] App Primary Color/rectangle_point_btn_normal_24c447.png";
                FamilyButton = new Tizen.NUI.CommonUI.Button(buttonAttributes);
                FamilyButton.Size2D = new Size2D(200, 80);
                FamilyButton.Position2D = new Position2D(578, 32);
                FamilyButton.Text = "Family";
                FamilyButton.ClickEvent += FamilyButton_ClickEvent;
                LayoutContent.Add(FamilyButton);

                buttonAttributes.BackgroundImageAttributes.ResourceURL.All = CommonResource.GetResourcePath() + "3. Button/[Button] App Primary Color/rectangle_point_btn_normal_9762d9.png";
                KitchenButton = new Tizen.NUI.CommonUI.Button(buttonAttributes);
                KitchenButton.Size2D = new Size2D(200, 80);
                KitchenButton.Position2D = new Position2D(834, 32);
                KitchenButton.Text = "Kitchen";
                KitchenButton.ClickEvent += KitchenButton_ClickEvent;
                LayoutContent.Add(KitchenButton);
            }

            this.isThemeButtonVisible = isThemeButtonVisiable;
            Window.Instance.Add(LayoutHeader);
            Window.Instance.Add(LayoutContent);

            //SampleMain.SampleNaviFrame.NaviFrameItemPush(LayoutHeader, LayoutContent);

            //this.ResourceUrl = CommonResource.GetResourcePath() + "0. BG/background_default_overlay.png";
        }
示例#4
0
        protected override void OnCreate()
        {
            base.OnCreate();

            var examples = from type in Assembly.GetEntryAssembly().GetTypes()
                           where typeof(IExample).GetTypeInfo().IsAssignableFrom(type) && type.Namespace == this.GetType().Namespace &&
                           type != this.GetType() && type.GetTypeInfo().IsClass
                           orderby type.Name ascending
                           select type.Name;

            //RunSample("NuiCommonUiSamples", "ContactCardsSample");

            naviFrame = new Tizen.FH.NUI.Controls.NaviFrame("DefaultNaviFrame");
            Tizen.FH.NUI.Controls.Header head = new Tizen.FH.NUI.Controls.Header("DefaultHeader");
            head.BackgroundColor = Color.Yellow;
            head.HeaderText      = "CommonUI Samples";

            contentList            = new Tizen.NUI.CommonUI.FlexibleView();
            contentList.Name       = "Sample List";
            contentList.Position2D = new Position2D(0, 1);
            contentList.Size2D     = new Size2D(1080, 1790);
            //contentList.Size2D = new Size2D(1080, 896);
            contentList.Padding         = new Extents(0, 8, 0, 0);
            contentList.BackgroundColor = new Color(0, 0, 0, 0.2f);
            contentList.ItemClickEvent += OnListItemClickEvent;

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

            for (int i = 0; i < examples.Count(); ++i)
            {
                dataList.Add(new NaviListItemData2(examples.ElementAt(i)));
            }
            adapter = new NaviListBridge2(dataList);
            contentList.SetAdapter(adapter);

            LinearLayoutManager layoutManager = new LinearLayoutManager(LinearLayoutManager.VERTICAL);

            contentList.SetLayoutManager(layoutManager);

            scrollBar            = new ScrollBar("DAScrollbar");
            scrollBar.Direction  = ScrollBar.DirectionType.Vertical;
            scrollBar.Position2D = new Position2D(1074, 2);
            scrollBar.Size2D     = new Size2D(4, 1786);
            //scrollBar.Size2D = new Size2D(4, 894);
            scrollBar.ThumbSize = new Size2D(4, 30);
            contentList.AttachScrollBar(scrollBar);

            naviFrame.NaviFrameItemPush(head, contentList);

            backNavigation                 = new Tizen.FH.NUI.Controls.Navigation("Back");
            backNavigation.Position2D      = new Position2D(0, 950);
            backNavigation.ItemTouchEvent += OnBackNaviTouchEvent;

            Tizen.FH.NUI.Controls.Navigation.NavigationItemData backItem = new Tizen.FH.NUI.Controls.Navigation.NavigationItemData("WhiteBackItem");
            backNavigation.AddItem(backItem);

            Window.Instance.KeyEvent += Instance_Key;

            Activate();
            sampleStack.Push(this);
        }