Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions SlideOverKit/Gestures/VerticalGestures.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
using System;
using System;

namespace SlideOverKit
{
internal class VerticalGesture : GestureBase, IDragGesture, IDisposable
{
double _topMax, _topMin, _bottomMax, _bottomMin = 0;
bool _isToptoBottom = true;

SlideMenuView _view;

public VerticalGesture (SlideMenuView view, double density) : base (view, density)
{
CheckViewBound (view);
UpdateLayoutSize (view);
view.HideEvent = LayoutHideStatus;
_view = view;
CheckViewBound (_view);
UpdateLayoutSize (_view);
_view.HideEvent = LayoutHideStatus;
}

void CheckViewBound (SlideMenuView view)


void CheckViewBound (SlideMenuView view)
{
if (ScreenSizeHelper.ScreenHeight == 0 || ScreenSizeHelper.ScreenWidth == 0)
throw new Exception ("Please set ScreenSizeHelper.ScreenHeight or ScreenSizeHelper.ScreenWidth");
Expand Down Expand Up @@ -106,6 +110,7 @@ public void DragFinished ()

public void LayoutShowStatus ()
{
_view.IsMenuShown = true;
if (RequestLayout != null) {
GetShowPosition ();
RequestLayout (_left, _top, _right, _bottom, _density);
Expand All @@ -116,6 +121,7 @@ public void LayoutShowStatus ()

public void LayoutHideStatus ()
{
_view.IsMenuShown = false;
if (RequestLayout != null) {
GetHidePosition ();
RequestLayout (_left, _top, _right, _bottom, _density);
Expand Down