Exemple #1
0
        private void CriarPagina()
        {
            var alturaTela     = Height;
            var alturaHeader   = alturaTela * .20f;
            var alturaFooter   = alturaTela * .08f;
            var alturaEstampa  = _maxHeightImage = alturaTela * .65f;
            var spacingContent = alturaTela * .0f;

            logoHeader = new Image
            {
                //Source = ImageSource.FromResource("VotacaoEstampas.Images.logo_white_512.png"),
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.Center,
                Aspect            = Aspect.AspectFill
            };
            header = new Frame
            {
                OutlineColor      = COR_PAGE_HEADER_FOOTER,
                BackgroundColor   = COR_PAGE_HEADER_FOOTER,
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                HeightRequest     = alturaHeader,
                WidthRequest      = alturaHeader,
#if __ANDROID__
                Padding = new Thickness(-5),
#else
                Padding = new Thickness(0),
#endif
            };
            header.Content = logoHeader;

            BackgroundColor = COR_BACKGROUND_TELA;

            // instancia de objetos da pagina que nao precisam de size request relativo ao tamanho da pagina
            var txtFooter = new Label
            {
                Text                    = TXT_PAGE_FOOTER,
                FontSize                = FONTE_TEXTO_LABELS,
                TextColor               = COR_TEXTO_LABELS,
                FontFamily              = FAMILIA_TEXTO_LABELS,
                FontAttributes          = ATRIBUTOS_TEXTO_LABELS,
                HorizontalTextAlignment = TextAlignment.Center
            };

            var btnNAO = new CustomControls.CustomButton
            {
                Text              = "NÃO",
                FontSize          = FONTE_TEXTO_BUTTONS,
                FontFamily        = FAMILIA_TEXTO_LABELS,
                FontAttributes    = ATRIBUTOS_TEXTO_LABELS,
                TextColor         = COR_TEXTO_LABELS,
                WidthRequest      = 90,
                BorderRadius      = 45,
                HorizontalOptions = LayoutOptions.Center,

                CorBackgroundCustomRed   = 200,
                CorBackgroundCustomGreen = 00,
                CorBackgroundCustomBlue  = 00
            };
            btnNAO.Clicked += BtnNAO_Clicked;
            var btnSIM = new CustomControls.CustomButton
            {
                Text              = "SIM",
                FontSize          = FONTE_TEXTO_BUTTONS,
                FontFamily        = FAMILIA_TEXTO_LABELS,
                FontAttributes    = ATRIBUTOS_TEXTO_LABELS,
                TextColor         = COR_TEXTO_LABELS,
                WidthRequest      = 90,
                BorderRadius      = 45,
                HorizontalOptions = LayoutOptions.Center,

                CorBackgroundCustomRed   = 00,
                CorBackgroundCustomGreen = 140,
                CorBackgroundCustomBlue  = 00
            };
            btnSIM.Clicked += BtnSIM_Clicked;

            imageEstampa = new Image
            {
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Aspect            = Aspect.AspectFill
            };

            containerEstampa = new StackLayout
            {
                Padding           = new Thickness(0),
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Children          = { imageEstampa }
            };

            btnAnterior = new Image
            {
                Source = ImageSource.FromResource("VotacaoEstampas.Images.ArrowLeft.png"),
#if __ANDROID__
                HorizontalOptions = LayoutOptions.Start,
#endif
            };
            btnAnterior.GestureRecognizers.Add(new TapGestureRecognizer(sender => {
                ExibirEstampaAnterior();
            }));

#if !__ANDROID__
            var btnAnteriorContainer = new Frame {
                Padding           = 0,
                Content           = btnAnterior,
                HorizontalOptions = LayoutOptions.Start,
            };
#endif
            btnProximo = new Image
            {
                Source = ImageSource.FromResource("VotacaoEstampas.Images.ArrowRight.png"),
#if __ANDROID__
                HorizontalOptions = LayoutOptions.End,
#endif
            };
            btnProximo.GestureRecognizers.Add(new TapGestureRecognizer(sender => {
                ExibirProximaEstampa();
            }));
#if !__ANDROID__
            var btnProximoContainer = new Frame
            {
                Padding           = 0,
                Content           = btnProximo,
                HorizontalOptions = LayoutOptions.End,
            };
#endif
            var buttonsContainer = new StackLayout
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Orientation       = StackOrientation.Horizontal,
                Spacing           = 20f,
                Children          =
                {
#if __ANDROID__
                    btnAnterior,
#else
                    btnAnteriorContainer,
#endif
                    new StackLayout
                    {
                        HorizontalOptions = LayoutOptions.CenterAndExpand,
                        Orientation       = StackOrientation.Horizontal,
                        Spacing           = 50,
                        Children          =
                        {
                            btnNAO, btnSIM
                        }
                    },
#if __ANDROID__
                    btnProximo
#else
                    btnProximoContainer
#endif
                }
            };

            var txtContainerFooter = new Frame
            {
                OutlineColor    = COR_PAGE_HEADER_FOOTER,
                BackgroundColor = COR_PAGE_HEADER_FOOTER,

                VerticalOptions = LayoutOptions.EndAndExpand,
                Content         = txtFooter
            };

            var footer = new StackLayout
            {
                Orientation = StackOrientation.Vertical,
                Children    =
                {
                    buttonsContainer,     //txtContainerFooter
                },
                VerticalOptions   = LayoutOptions.End,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Padding           = new Thickness(0, 10, 0, 0),
                HeightRequest     = alturaFooter
            };



            // set conteudo da página
            Content = new StackLayout
            {
                //Padding = -5, isso resolve o bug de padding no android
#if __ANDROID__
                Padding = new Thickness(-4),
#else
                Padding = new Thickness(0),
#endif
                Orientation = StackOrientation.Vertical,
                Spacing     = spacingContent,
                Children    =
                {
                    header, containerEstampa, footer
                }
            };
        }
 private void InitializeComponent()
 {
     this.videoSlider = new CustomControls.CustomSlider();
     this.closeButton = new CustomControls.CustomButton();
     this.playButton  = new CustomControls.CustomButton();
     this.stopButton  = new CustomControls.CustomButton();
     this.pauseButton = new CustomControls.CustomButton();
     this.SuspendLayout();
     //
     // videoSlider
     //
     this.videoSlider.Anchor          = System.Windows.Forms.AnchorStyles.None;
     this.videoSlider.BackColor       = System.Drawing.Color.Transparent;
     this.videoSlider.BorderColor     = System.Drawing.Color.Transparent;
     this.videoSlider.Font            = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.videoSlider.ForeColor       = System.Drawing.Color.FromArgb(((int)(((byte)(123)))), ((int)(((byte)(125)))), ((int)(((byte)(123)))));
     this.videoSlider.IndentHeight    = 10;
     this.videoSlider.Location        = new System.Drawing.Point(167, -1);
     this.videoSlider.Maximum         = 20;
     this.videoSlider.Minimum         = 0;
     this.videoSlider.Name            = "videoSlider";
     this.videoSlider.Size            = new System.Drawing.Size(303, 30);
     this.videoSlider.TabIndex        = 17;
     this.videoSlider.Text            = "customSlider1";
     this.videoSlider.TextTickStyle   = System.Windows.Forms.TickStyle.None;
     this.videoSlider.TickColor       = System.Drawing.Color.FromArgb(((int)(((byte)(148)))), ((int)(((byte)(146)))), ((int)(((byte)(148)))));
     this.videoSlider.TickHeight      = 4;
     this.videoSlider.TickStyle       = System.Windows.Forms.TickStyle.None;
     this.videoSlider.TrackerColor    = System.Drawing.Color.FromArgb(((int)(((byte)(24)))), ((int)(((byte)(130)))), ((int)(((byte)(198)))));
     this.videoSlider.TrackerSize     = new System.Drawing.Size(10, 10);
     this.videoSlider.TrackLineColor  = System.Drawing.Color.DimGray;
     this.videoSlider.TrackLineHeight = 10;
     this.videoSlider.Value           = 0;
     this.videoSlider.Click          += new System.EventHandler(this.VideoSlider_Click);
     //
     // closeButton
     //
     this.closeButton.Image    = global::MainScreen.Properties.Resources.buttonExit21;
     this.closeButton.Location = new System.Drawing.Point(548, 0);
     this.closeButton.Name     = "closeButton";
     this.closeButton.Size     = new System.Drawing.Size(29, 23);
     this.closeButton.TabIndex = 22;
     this.closeButton.UseVisualStyleBackColor = true;
     this.closeButton.Click += new System.EventHandler(this.CloseButton_Click_1);
     //
     // playButton
     //
     this.playButton.Image    = global::MainScreen.Properties.Resources.PlayButtonLast;
     this.playButton.Location = new System.Drawing.Point(23, -1);
     this.playButton.Name     = "playButton";
     this.playButton.Size     = new System.Drawing.Size(27, 23);
     this.playButton.TabIndex = 21;
     this.playButton.UseVisualStyleBackColor = true;
     this.playButton.Click += new System.EventHandler(this.PlayButton_Click_1);
     //
     // stopButton
     //
     this.stopButton.Image    = global::MainScreen.Properties.Resources.buttonStop21;
     this.stopButton.Location = new System.Drawing.Point(125, -1);
     this.stopButton.Name     = "stopButton";
     this.stopButton.Size     = new System.Drawing.Size(27, 23);
     this.stopButton.TabIndex = 20;
     this.stopButton.UseVisualStyleBackColor = true;
     this.stopButton.Click += new System.EventHandler(this.StopButton_Click_1);
     //
     // pauseButton
     //
     this.pauseButton.BackColor = System.Drawing.Color.Transparent;
     this.pauseButton.Image     = global::MainScreen.Properties.Resources.buttonPause21;
     this.pauseButton.Location  = new System.Drawing.Point(74, 0);
     this.pauseButton.Name      = "pauseButton";
     this.pauseButton.Size      = new System.Drawing.Size(28, 23);
     this.pauseButton.TabIndex  = 19;
     this.pauseButton.UseVisualStyleBackColor = false;
     this.pauseButton.Click += new System.EventHandler(this.PauseButton_Click);
     //
     // MenuBarFullScreenForm
     //
     this.ClientSize = new System.Drawing.Size(589, 23);
     this.ControlBox = false;
     this.Controls.Add(this.closeButton);
     this.Controls.Add(this.playButton);
     this.Controls.Add(this.stopButton);
     this.Controls.Add(this.pauseButton);
     this.Controls.Add(this.videoSlider);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     this.Name            = "MenuBarFullScreenForm";
     this.ResumeLayout(false);
     this.PerformLayout();
 }
        private void InitializeComponent()
        {
            this.videoSlider = new CustomControls.CustomSlider();
            this.closeButton = new CustomControls.CustomButton();
            this.playButton = new CustomControls.CustomButton();
            this.stopButton = new CustomControls.CustomButton();
            this.pauseButton = new CustomControls.CustomButton();
            this.SuspendLayout();
            // 
            // videoSlider
            // 
            this.videoSlider.Anchor = System.Windows.Forms.AnchorStyles.None;
            this.videoSlider.BackColor = System.Drawing.Color.Transparent;
            this.videoSlider.BorderColor = System.Drawing.Color.Transparent;
            this.videoSlider.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.videoSlider.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(123)))), ((int)(((byte)(125)))), ((int)(((byte)(123)))));
            this.videoSlider.IndentHeight = 10;
            this.videoSlider.Location = new System.Drawing.Point(167, -1);
            this.videoSlider.Maximum = 20;
            this.videoSlider.Minimum = 0;
            this.videoSlider.Name = "videoSlider";
            this.videoSlider.Size = new System.Drawing.Size(303, 30);
            this.videoSlider.TabIndex = 17;
            this.videoSlider.Text = "customSlider1";
            this.videoSlider.TextTickStyle = System.Windows.Forms.TickStyle.None;
            this.videoSlider.TickColor = System.Drawing.Color.FromArgb(((int)(((byte)(148)))), ((int)(((byte)(146)))), ((int)(((byte)(148)))));
            this.videoSlider.TickHeight = 4;
            this.videoSlider.TickStyle = System.Windows.Forms.TickStyle.None;
            this.videoSlider.TrackerColor = System.Drawing.Color.FromArgb(((int)(((byte)(24)))), ((int)(((byte)(130)))), ((int)(((byte)(198)))));
            this.videoSlider.TrackerSize = new System.Drawing.Size(10, 10);
            this.videoSlider.TrackLineColor = System.Drawing.Color.DimGray;
            this.videoSlider.TrackLineHeight = 10;
            this.videoSlider.Value = 0;
            this.videoSlider.Click += new System.EventHandler(this.VideoSlider_Click);
            // 
            // closeButton
            // 
            this.closeButton.Image = global::MainScreen.Properties.Resources.buttonExit21;
            this.closeButton.Location = new System.Drawing.Point(548, 0);
            this.closeButton.Name = "closeButton";
            this.closeButton.Size = new System.Drawing.Size(29, 23);
            this.closeButton.TabIndex = 22;
            this.closeButton.UseVisualStyleBackColor = true;
            this.closeButton.Click += new System.EventHandler(this.CloseButton_Click_1);
            // 
            // playButton
            // 
            this.playButton.Image = global::MainScreen.Properties.Resources.PlayButtonLast;
            this.playButton.Location = new System.Drawing.Point(23, -1);
            this.playButton.Name = "playButton";
            this.playButton.Size = new System.Drawing.Size(27, 23);
            this.playButton.TabIndex = 21;
            this.playButton.UseVisualStyleBackColor = true;
            this.playButton.Click += new System.EventHandler(this.PlayButton_Click_1);
            // 
            // stopButton
            // 
            this.stopButton.Image = global::MainScreen.Properties.Resources.buttonStop21;
            this.stopButton.Location = new System.Drawing.Point(125, -1);
            this.stopButton.Name = "stopButton";
            this.stopButton.Size = new System.Drawing.Size(27, 23);
            this.stopButton.TabIndex = 20;
            this.stopButton.UseVisualStyleBackColor = true;
            this.stopButton.Click += new System.EventHandler(this.StopButton_Click_1);
            // 
            // pauseButton
            // 
            this.pauseButton.BackColor = System.Drawing.Color.Transparent;
            this.pauseButton.Image = global::MainScreen.Properties.Resources.buttonPause21;
            this.pauseButton.Location = new System.Drawing.Point(74, 0);
            this.pauseButton.Name = "pauseButton";
            this.pauseButton.Size = new System.Drawing.Size(28, 23);
            this.pauseButton.TabIndex = 19;
            this.pauseButton.UseVisualStyleBackColor = false;
            this.pauseButton.Click += new System.EventHandler(this.PauseButton_Click);
            // 
            // MenuBarFullScreenForm
            // 
            this.ClientSize = new System.Drawing.Size(589, 23);
            this.ControlBox = false;
            this.Controls.Add(this.closeButton);
            this.Controls.Add(this.playButton);
            this.Controls.Add(this.stopButton);
            this.Controls.Add(this.pauseButton);
            this.Controls.Add(this.videoSlider);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Name = "MenuBarFullScreenForm";
            this.ResumeLayout(false);
            this.PerformLayout();

        }