protected override void OnOrientationChanged(OrientationValue newOrientation)
 {
     if (newOrientation == OrientationValue.Portrait)
     Content = GetPortraitView();
     else
     Content = GetLandscapeView();
 }
        protected override void OrientationChanged(OrientationValue newOrientation)
        {
            base.OrientationChanged(newOrientation);

            if (newOrientation == OrientationValue.Landscape)
            {
                RelativeLayout.SetHeightConstraint(ImageSection, Constraint.RelativeToParent((parent) => { return(parent.Height); }));
                RelativeLayout.SetWidthConstraint(ImageSection, Constraint.RelativeToParent((parent) => { return(parent.Width * 0.4); }));

                RelativeLayout.SetXConstraint(FormSection, Constraint.RelativeToView(ImageSection, (parent, sibling) => { return(sibling.Width); }));
                RelativeLayout.SetYConstraint(FormSection, Constraint.Constant(0));
                RelativeLayout.SetHeightConstraint(FormSection, Constraint.RelativeToParent((parent) => { return(parent.Height); }));
                RelativeLayout.SetWidthConstraint(FormSection, Constraint.RelativeToParent((parent) => { return(parent.Width * 0.6); }));

                FormSection.Padding = new Thickness(50);
            }
            else
            {
                RelativeLayout.SetHeightConstraint(ImageSection, Constraint.RelativeToParent((Parent) => { return(Parent.Height * 0.3); }));
                RelativeLayout.SetWidthConstraint(ImageSection, Constraint.RelativeToParent((Parent) => { return(Parent.Width); }));

                RelativeLayout.SetXConstraint(FormSection, Constraint.Constant(0));
                RelativeLayout.SetYConstraint(FormSection, Constraint.RelativeToView(ImageSection, (parent, sibling) => { return(sibling.Height); }));
                RelativeLayout.SetHeightConstraint(FormSection, Constraint.RelativeToParent((parent) => { return(parent.Height * 0.7); }));
                RelativeLayout.SetWidthConstraint(FormSection, Constraint.RelativeToParent((parent) => { return(parent.Width); }));
                FormSection.Padding = new Thickness(25, 50);
            }
        }
Beispiel #3
0
 protected override void OnOrientationChanged(OrientationValue newOrientation)
 {
     if (newOrientation == OrientationValue.Portrait)
     {
         Content = GetPortraitView();
     }
     else
     {
         Content = GetLandscapeView();
     }
 }
Beispiel #4
0
        private void MobileView(SKPaintSurfaceEventArgs args, OrientationValue deviceOrientation)
        {
            Username.Margin    = new Thickness(0, 15, 0, 0);
            Password.Margin    = new Thickness(0, 15, 0, 0);
            LoginButton.Margin = new Thickness(0, 15, 0, 0);

            FormTitle.FontSize = 25;

            if (deviceOrientation == OrientationValue.Landscape)
            {
                PaintLandScapeBackground(args);
                LandScapeViewCommon();

                FlexLayout.SetBasis(CompanyInfo, new FlexBasis(0.35f, true));
                FlexLayout.SetBasis(LoginForm, new FlexBasis(0.65f, true));
                FlexLayout.SetBasis(LogoSection, new FlexBasis(1, true));

                LoginFormFrame.HasShadow       = true;
                LoginFormFrame.Margin          = new Thickness(0, 30, 70, 30);
                LoginFormFrame.Padding         = new Thickness(20);
                LoginFormFrame.BackgroundColor = Color.White;

                AppInfo.IsVisible      = true;
                AppInfoImage.IsVisible = false;

                LogoSection.Padding = new Thickness(21, 0);

                LogoSectionInner.VerticalOptions = LayoutOptions.CenterAndExpand;
            }
            else
            {
                PaintPortraitBackground(args);
                PortraitViewCommon();

                LoginFormFrame.Padding   = new Thickness(20, 40);
                LoginFormFrame.Margin    = new Thickness(30, 0);
                LoginFormFrame.HasShadow = false;

                Logo.WidthRequest = 200;

                LogoSectionInner.VerticalOptions = LayoutOptions.EndAndExpand;
            }
        }
Beispiel #5
0
        private void TabletView(SKPaintSurfaceEventArgs args, OrientationValue deviceOrientation)
        {
            Username.Margin                  = new Thickness(0, 25, 0, 0);
            Password.Margin                  = new Thickness(0, 20, 0, 0);
            LoginButton.Margin               = new Thickness(0, 25, 0, 0);
            FormTitle.FontSize               = 30;
            LoginFormFrame.HasShadow         = false;
            LogoSectionInner.VerticalOptions = LayoutOptions.EndAndExpand;

            if (deviceOrientation == OrientationValue.Landscape)
            {
                PaintLandScapeBackground(args);
                LandScapeViewCommon();

                FlexLayout.SetBasis(CompanyInfo, new FlexBasis(0.55f, true));
                FlexLayout.SetBasis(LoginForm, new FlexBasis(0.45f, true));
                FlexLayout.SetBasis(LogoSection, new FlexBasis(0.35f, true));

                LoginFormFrame.Margin  = new Thickness(60, 0);
                LoginFormFrame.Padding = new Thickness(0);

                AppInfo.IsVisible      = true;
                AppInfoImage.IsVisible = true;

                Logo.HorizontalOptions = LayoutOptions.Start;

                FormTitle.HorizontalTextAlignment = TextAlignment.Start;

                LogoSection.Padding = new Thickness(60, 20, 120, 20);
            }
            else
            {
                PaintPortraitBackground(args);
                PortraitViewCommon();

                LoginFormFrame.Padding = new Thickness(30, 40);
                LoginFormFrame.Margin  = new Thickness(80);

                Logo.HorizontalOptions = LayoutOptions.CenterAndExpand;
                Logo.WidthRequest      = 300;
            }
        }
 protected override void OnOrientationChanged(OrientationValue newOrientation)
 {
     ExtendedContent.IsVisible = newOrientation != OrientationValue.Portrait;
 }
Beispiel #7
0
 protected virtual void OnOrientationChanged(OrientationValue newOrientation)
 {
 }
 protected override void OnOrientationChanged(OrientationValue newOrientation)
 {
     ExtendedContent.IsVisible = newOrientation != OrientationValue.Portrait;
 }
 protected virtual void OnOrientationChanged(OrientationValue newOrientation)
 {
 }
Beispiel #10
0
 protected override void OrientationChanged(OrientationValue newOrientation)
 {
     base.OrientationChanged(newOrientation);
     deviceOrientation = newOrientation;
 }