Skip to content

Commit def58d2

Browse files
Merge pull request #126 from ArunachalamSyncfusion/NavigationDrawerScrolling
Improve the touch interaction in Maui toolkit Navigation drawer.
2 parents dc2049b + 01920f9 commit def58d2

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

maui/src/NavigationDrawer/SfNavigationDrawer.Android.cs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ internal override bool OnInterceptTouchEvent(MotionEvent? ev)
7777
switch (ev.Action)
7878
{
7979
case MotionEventActions.Down:
80-
return HandleActionDown(currentTouchPoint);
80+
return HandleActionDown(ev, currentTouchPoint);
8181

8282
case MotionEventActions.Up:
8383
_initialPoint = new Point(0, 0);
@@ -95,18 +95,23 @@ internal override bool OnInterceptTouchEvent(MotionEvent? ev)
9595

9696
#region Private Methods
9797

98-
private bool HandleActionDown(Point currentTouchPoint)
98+
private bool HandleActionDown(MotionEvent? ev, Point currentTouchPoint)
9999
{
100-
_downX = currentTouchPoint.X;
101-
_downY = currentTouchPoint.Y;
102-
_initialPoint = currentTouchPoint;
103-
104-
if (DrawerSettings.Position == Position.Left || DrawerSettings.Position == Position.Right)
100+
if (ev != null)
105101
{
106-
return HandleHorizontalActionDown(currentTouchPoint);
102+
_downX = ev.GetX();
103+
_downY = ev.GetY();
104+
_initialPoint = currentTouchPoint;
105+
106+
if (DrawerSettings.Position == Position.Left || DrawerSettings.Position == Position.Right)
107+
{
108+
return HandleHorizontalActionDown(currentTouchPoint);
109+
}
110+
111+
return HandleVerticalActionDown(currentTouchPoint);
107112
}
108113

109-
return HandleVerticalActionDown(currentTouchPoint);
114+
return false;
110115
}
111116

112117
private bool HandleHorizontalActionDown(Point currentTouchPoint)

0 commit comments

Comments
 (0)