public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

            box.Show();

            var textfield = new MTextField(parent)
            {
                Label        = "Label",
                Text         = "Input text",
                AlignmentX   = 0.5,
                AlignmentY   = 0.5,
                WeightX      = 1,
                WeightY      = 1,
                MinimumWidth = 200
            };

            textfield.Show();
            box.PackEnd(textfield);

            return(box);
        }
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new Box(window)
            {
                BackgroundColor = Color.White,
            };

            conformant.SetContent(box);
            box.SetPadding(0, 100);
            box.Show();

            var innerbox = new Box(window)
            {
                MinimumWidth = 500,
                AlignmentX   = 0.5,
                AlignmentY   = 0.5,
                WeightX      = 1,
                WeightY      = 1,
                IsHorizontal = false
            };

            innerbox.Show();
            box.PackEnd(innerbox);

            var textfield = new MTextField(window)
            {
                Label      = "Label",
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1
            };

            textfield.Show();
            innerbox.PackEnd(textfield);

            var emptyLabel = new Label(window)
            {
                MinimumWidth  = 500,
                MinimumHeight = 100,
                WeightX       = 1,
                AlignmentX    = -1,
            };

            emptyLabel.Show();
            innerbox.PackEnd(emptyLabel);

            var textfield2 = new MTextField(window)
            {
                Label      = "Label",
                Text       = "Input text",
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1,
            };

            textfield2.Show();
            innerbox.PackEnd(textfield2);
        }
Example #3
0
        public override EvasObject CreateContent(EvasObject parent)
        {
            Box box = new ColoredBox(parent);

            box.Show();

            var naviIconPath = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "menu.png");

            var appbar = new MBottomAppBar(parent)
            {
                NavigationItem = new MActionItem("naviItem", naviIconPath, () =>
                {
                    Console.WriteLine($"Navigation action item clicked");
                })
            };

            appbar.Show();

            var airplaneIconPath  = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "airplane.png");
            var alarmIconPath     = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "alarm.png");
            var bluetoothIconPath = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "bluetooth.png");

            appbar.ActionItems.Add(new MActionItem("airplane", airplaneIconPath, () => { Console.WriteLine($"ariplane"); }));
            appbar.ActionItems.Add(new MActionItem("alarm", alarmIconPath, () => { Console.WriteLine($"alarm"); }));
            appbar.ActionItems.Add(new MActionItem("bluetooth", bluetoothIconPath, () => { Console.WriteLine($"bluetooth"); }));

            var nButton = new MButton(parent)
            {
                Text         = "add/remove naviitem",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5,
            };

            var item = new MActionItem("new", naviIconPath, () =>
            {
                Console.WriteLine($"new Navigation action item");
            });

            nButton.Clicked += (s, e) =>
            {
                if (appbar.NavigationItem == null)
                {
                    appbar.NavigationItem = item;
                }
                else
                {
                    appbar.NavigationItem = null;
                }
            };
            nButton.Show();

            var addButton = new MButton(parent)
            {
                Text         = "add item",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5,
            };

            int itemNum = 1;

            addButton.Clicked += (s, e) =>
            {
                var iconPath = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "alarm.png");
                appbar.ActionItems.Add(new MActionItem("new item" + itemNum++, iconPath, () => { Console.WriteLine($"new item{itemNum} clicked!!"); }));;
            };
            addButton.Show();

            var removeButton = new MButton(parent)
            {
                Text         = "remove item",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5,
            };

            removeButton.Clicked += (s, e) =>
            {
                if (appbar.ActionItems.Count > 0)
                {
                    appbar.ActionItems.RemoveAt(appbar.ActionItems.Count - 1);
                }
            };
            removeButton.Show();

            var lbutton = new MButton(parent)
            {
                Text         = "layout",
                MinimumWidth = 400,
                WeightY      = 1,
                AlignmentY   = 0.5,
            };

            int layout = 0;

            lbutton.Clicked += (s, e) =>
            {
                layout++;

                if (layout % 3 == 2)
                {
                    appbar.LayoutOption = BottomAppBarLayoutOption.NoFAB;
                }
                else if (layout % 3 == 1)
                {
                    appbar.LayoutOption = BottomAppBarLayoutOption.EndFAB;
                }
                else
                {
                    appbar.LayoutOption = BottomAppBarLayoutOption.CenteredFAB;
                }
                lbutton.Text         = "layout: " + appbar.LayoutOption.ToString();
                lbutton.MinimumWidth = 400;
            };
            lbutton.Show();

            var entry = new MTextField(parent)
            {
                AlignmentX = -1,
                WeightY    = 1,
                Label      = "textfield",
                Text       = "click here to show virtual keypad"
            };

            entry.Show();

            _conformant.KeyPadOn += (s, e) =>
            {
                box.UnPack(appbar);
            };

            _conformant.KeyPadOff += (s, e) =>
            {
                box.PackEnd(appbar);
            };

            MFloatingActionButton fab = new MFloatingActionButton(_conformant);
            Image img2 = new Image(parent);

            img2.Load(Path.Combine(MaterialGallery.ResourceDir, "airplane.png"));
            fab.Icon = img2;

            appbar.FloatingActionButton = fab;

            box.PackEnd(nButton);
            box.PackEnd(lbutton);
            box.PackEnd(addButton);
            box.PackEnd(removeButton);
            box.PackEnd(entry);

            box.PackEnd(appbar);

            return(box);
        }
Example #4
0
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new ColoredBox(window);

            conformant.SetContent(box);
            box.SetPadding(0, 100);
            box.Show();

            var innerbox = new Box(window)
            {
                MinimumWidth = 500,
                AlignmentX   = 0.5,
                AlignmentY   = 0.5,
                WeightX      = 1,
                WeightY      = 1,
                IsHorizontal = false
            };

            innerbox.Show();
            box.PackEnd(innerbox);

            #region ThemeButton
            Box hbox = new Box(window)
            {
                IsHorizontal = true,
                WeightX      = 1,
                WeightY      = 1,
                AlignmentX   = -1,
                AlignmentY   = -1,
            };
            hbox.Show();
            box.PackEnd(hbox);

            var defaultColor = new MButton(window)
            {
                Text         = "default",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.9
            };
            var light = new MButton(window)
            {
                Text         = "light",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.9
            };
            var dark = new MButton(window)
            {
                Text         = "Dark",
                MinimumWidth = 200,
                WeightY      = 1,
                AlignmentY   = 0.9
            };
            defaultColor.Show();
            light.Show();
            dark.Show();
            hbox.PackEnd(defaultColor);
            hbox.PackEnd(light);
            hbox.PackEnd(dark);

            defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default;
            light.Clicked        += (s, e) => MColors.Current = MColors.Light;
            dark.Clicked         += (s, e) => MColors.Current = MColors.Dark;
            #endregion


            var textfield = new MTextField(window)
            {
                Label      = "Label",
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1
            };
            textfield.Show();
            innerbox.PackEnd(textfield);

            var emptyLabel = new Label(window)
            {
                MinimumWidth  = 500,
                MinimumHeight = 100,
                WeightX       = 1,
                AlignmentX    = -1,
            };
            emptyLabel.Show();
            innerbox.PackEnd(emptyLabel);

            var textfield2 = new MTextField(window)
            {
                Label      = "Label",
                Text       = "Input text",
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1,
            };
            textfield2.Show();
            innerbox.PackEnd(textfield2);
        }