public PopUpNoGestures(SlideMenuView view, double density) : base(view, density) { CheckViewBound (view); UpdateLayoutSize (view); view.HideEvent = LayoutHideStatus; }
public void UpdateLayoutSize(SlideMenuView view) { _topMax = 0; _topMin = -(view.HeightRequest - view.DraggerButtonHeight) * _density; _bottomMax = view.HeightRequest * _density; _bottomMin = view.DraggerButtonHeight * _density; if (view.MenuOrientations == MenuOrientation.BottomToTop) { _isToptoBottom = false; _topMax = (ScreenSizeHelper.ScreenHeight - view.DraggerButtonHeight) * _density; _topMin = (ScreenSizeHelper.ScreenHeight - view.HeightRequest) * _density; _bottomMax = (ScreenSizeHelper.ScreenHeight + view.HeightRequest - view.DraggerButtonHeight) * _density; _bottomMin = ScreenSizeHelper.ScreenHeight * _density; } if (!view.IsFullScreen) { _left = view.LeftMargin * _density; _right = (view.LeftMargin + view.WidthRequest) * _density; } else { _left = 0; _right = ScreenSizeHelper.ScreenWidth * _density; } }
internal GestureBase(SlideMenuView view, double density) { _density = density; view.GetIsShown = () => { return(!_willShown); }; }
public void UpdateLayoutSize(SlideMenuView view) { _leftMax = 0; _leftMin = -(view.WidthRequest - view.DraggerButtonWidth) * _density; _rightMax = view.WidthRequest * _density; _rightMin = view.DraggerButtonWidth * _density; if (view.MenuOrientations == MenuOrientation.RightToLeft) { _isLeftToRight = false; _leftMax = (ScreenSizeHelper.ScreenWidth - view.DraggerButtonWidth) * _density; _leftMin = (ScreenSizeHelper.ScreenWidth - view.WidthRequest) * _density; _rightMax = (ScreenSizeHelper.ScreenWidth + view.WidthRequest - view.DraggerButtonWidth) * _density; _rightMin = (ScreenSizeHelper.ScreenWidth) * _density; } if (!view.IsFullScreen) { _top = view.TopMargin * _density; _bottom = (view.TopMargin + view.HeightRequest) * _density; } else { _top = 0; _bottom = ScreenSizeHelper.ScreenHeight * _density; } }
void CheckViewBound(SlideMenuView view) { if (ScreenSizeHelper.ScreenHeight == 0 || ScreenSizeHelper.ScreenWidth == 0) { throw new Exception("Please set ScreenSizeHelper.ScreenHeight or ScreenSizeHelper.ScreenWidth"); } if (view.WidthRequest <= 0) { throw new Exception("Please set SildeMenuView WidthRequest"); } }
internal static IDragGesture GetGestureByView(SlideMenuView view, double density = 1.0f) { switch (view.MenuOrientations) { case MenuOrientation.TopToBottom: return(new VerticalGesture(view, density)); case MenuOrientation.BottomToTop: return(new VerticalGesture(view, density)); case MenuOrientation.LeftToRight: return(new HorizontalGestures(view, density)); case MenuOrientation.RightToLeft: return(new HorizontalGestures(view, density)); default: return(new VerticalGesture(view, density)); } }
internal static IDragGesture GetGestureByView(SlideMenuView view, double density = 1.0f) { switch (view.MenuOrientations) { case MenuOrientation.TopToBottom: return new VerticalGesture (view, density); case MenuOrientation.BottomToTop: return new VerticalGesture (view, density); case MenuOrientation.LeftToRight: return new HorizontalGestures (view, density); case MenuOrientation.RightToLeft: return new HorizontalGestures (view, density); case MenuOrientation.PopUpViewFromBottom: case MenuOrientation.PopUpViewFromLeft: case MenuOrientation.PopUpViewFromRight: case MenuOrientation.PopUpViewFromTop: return new PopUpNoGestures (view, density); default: return new VerticalGesture (view, density); } }
public void UpdateLayoutSize(SlideMenuView view) { _left = view.LeftMargin * _density; _top = view.TopMargin * _density; _right = (ScreenSizeHelper.ScreenWidth - view.LeftMargin) * _density; if (view.IsFullScreen) _bottom = (ScreenSizeHelper.ScreenHeight - view.TopMargin) * _density; else _bottom = (ScreenSizeHelper.ScreenHeight - view.TopMargin - view.PageBottomOffset) * _density; switch (view.MenuOrientations) { case MenuOrientation.PopUpViewFromBottom: _hidePosition = new Rect () { left = _left, top = ScreenSizeHelper.ScreenHeight * _density, right = _right, bottom = ScreenSizeHelper.ScreenHeight * _density + _bottom - _top }; break; case MenuOrientation.PopUpViewFromLeft: _hidePosition = new Rect (){ left = -(_right - _left), top = _top, right = 0, bottom = _bottom }; break; case MenuOrientation.PopUpViewFromTop: _hidePosition = new Rect (){ left = _left, top = -(_bottom-_top), right = _right, bottom = 0 }; break; case MenuOrientation.PopUpViewFromRight: _hidePosition = new Rect () { left = ScreenSizeHelper.ScreenWidth * _density, top = _top, right = ScreenSizeHelper.ScreenWidth * _density + _right -_left, bottom = _bottom }; break; } }
void CheckViewBound(SlideMenuView view) { if (ScreenSizeHelper.ScreenHeight == 0 || ScreenSizeHelper.ScreenWidth == 0) throw new Exception ("Please set ScreenSizeHelper.ScreenHeight or ScreenSizeHelper.ScreenWidth"); if (view.TopMargin <= 0) throw new Exception ("Please set SildeMenuView TopMargin"); if (view.LeftMargin <= 0) throw new Exception ("Please set SildeMenuView LeftMargin"); }
public HorizontalGestures(SlideMenuView view, double density) : base(view, density) { CheckViewBound(view); UpdateLayoutSize(view); view.HideEvent = LayoutHideStatus; }
void CheckViewBound(SlideMenuView 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"); }
public void UpdateLayoutSize(SlideMenuView view) { _topMax = 0; _topMin = -(view.HeightRequest - view.DraggerButtonHeight) * _density; _bottomMax = view.HeightRequest * _density; _bottomMin = view.DraggerButtonHeight * _density; if (view.MenuOrientations == MenuOrientation.BottomToTop) { _isToptoBottom = false; _topMax = (ScreenSizeHelper.ScreenHeight - view.PageBottomOffset - view.DraggerButtonHeight) * _density; _topMin = (ScreenSizeHelper.ScreenHeight - view.PageBottomOffset - view.HeightRequest) * _density; _bottomMax = (ScreenSizeHelper.ScreenHeight - view.PageBottomOffset + view.HeightRequest - view.DraggerButtonHeight) * _density; _bottomMin = (ScreenSizeHelper.ScreenHeight - view.PageBottomOffset) * _density; } if (!view.IsFullScreen) { _left = view.LeftMargin * _density; _right = (view.LeftMargin + view.WidthRequest) * _density; } else { _left = 0; _right = ScreenSizeHelper.ScreenWidth * _density; } }
internal GestureBase(SlideMenuView view, double density) { _density = density; }