Esempio n. 1
0
 public void UpdateLayoutSize(SlideCustomDialog view)
 {
     _topMax    = 0;
     _topMin    = 0;
     _bottomMax = view.HeightRequest * _density;
     _bottomMin = 0;
     if (view.MenuOrientations == MenuOrientation.BottomToTop)
     {
         _isToptoBottom = false;
         _topMax        = (ScreenSizeHelper.ScreenHeight) * _density;
         _topMin        = (ScreenSizeHelper.ScreenHeight - view.HeightRequest - view.BottomMargin) * _density;
         _bottomMax     = (ScreenSizeHelper.ScreenHeight + view.HeightRequest) * _density;
         _bottomMin     = (ScreenSizeHelper.ScreenHeight - view.BottomMargin) * _density;
     }
     if (!view.IsFullScreen)
     {
         _left  = view.LeftMargin * _density;
         _right = (view.LeftMargin + view.WidthRequest) * _density;
     }
     else
     {
         _left  = view.LeftMargin * _density;
         _right = (ScreenSizeHelper.ScreenWidth - view.RightMargin) * _density;
     }
 }
Esempio n. 2
0
 void CheckViewBound(SlideCustomDialog view)
 {
     if (ScreenSizeHelper.ScreenHeight == 0 || ScreenSizeHelper.ScreenWidth == 0)
     {
         throw new Exception("Please set ScreenSizeHelper.ScreenHeight or ScreenSizeHelper.ScreenWidth");
     }
     if (view.HeightRequest <= 0)
     {
         throw new Exception("Please set SildeMenuView HeightRequest");
     }
 }
Esempio n. 3
0
 public VerticalDrawer(SlideCustomDialog view, double density = 1.0)
 {
     _density        = density;
     view.GetIsShown = () =>
     {
         return(!_willShown);
     };
     CheckViewBound(view);
     UpdateLayoutSize(view);
     view.HideEvent = LayoutHideStatus;
 }