Currently, panning is working even if there is popup over component.
As workaround, add PanGestureDetector to Popup to prevent panning.
Additionally, add View to ScrollableBase which is to interrupt touching during scrolling.
private ButtonGroup btGroup = null;
private Window window = null;
private Layer container = new Layer();
private ButtonGroup btGroup = null;
private Window window = null;
private Layer container = new Layer();
+ private PanGestureDetector detector = new PanGestureDetector();
static Popup() { }
/// <summary>
static Popup() { }
/// <summary>
private void Initialize()
{
private void Initialize()
{
container.Add(this);
LeaveRequired = true;
PropertyChanged += PopupStylePropertyChanged;
container.Add(this);
LeaveRequired = true;
PropertyChanged += PopupStylePropertyChanged;
private PanGestureDetector mPanGestureDetector;
private TapGestureDetector mTapGestureDetector;
private View mScrollingChild;
private PanGestureDetector mPanGestureDetector;
private TapGestureDetector mTapGestureDetector;
private View mScrollingChild;
+ private View mInterruptTouchingChild;
private float multiplier =1.0f;
private bool scrolling = false;
private float ratioOfScreenWidthToCompleteScroll = 0.5f;
private float multiplier =1.0f;
private bool scrolling = false;
private float ratioOfScreenWidthToCompleteScroll = 0.5f;
mScrollingChild = new View();
mScrollingChild.Name = "DefaultScrollingChild";
mScrollingChild = new View();
mScrollingChild.Name = "DefaultScrollingChild";
+ //Interrupt touching when panning is started;
+ mInterruptTouchingChild = new View()
+ {
+ Name = "InterruptTouchingChild",
+ Size = new Size(Window.Instance.WindowSize),
+ BackgroundColor = Color.Transparent,
+ };
+
+ mInterruptTouchingChild.TouchEvent += (object source, View.TouchEventArgs args) => {
+ return true;
+ };
+
Layout = new ScrollableBaseCustomLayout();
}
Layout = new ScrollableBaseCustomLayout();
}
[EditorBrowsable(EditorBrowsableState.Never)]
public override void OnChildAdd(View view)
{
[EditorBrowsable(EditorBrowsableState.Never)]
public override void OnChildAdd(View view)
{
- if(mScrollingChild.Name != "DefaultScrollingChild")
+ if(view.Name != "InterruptTouchingChild")
- propertyNotification.Notified -= OnPropertyChanged;
- mScrollingChild.RemovePropertyNotification(propertyNotification);
- }
-
- mScrollingChild = view;
- propertyNotification = mScrollingChild?.AddPropertyNotification("position", PropertyCondition.Step(1.0f));
- propertyNotification.Notified += OnPropertyChanged;
+ if(mScrollingChild.Name != "DefaultScrollingChild")
+ {
+ propertyNotification.Notified -= OnPropertyChanged;
+ mScrollingChild.RemovePropertyNotification(propertyNotification);
+ }
- {
- if (Children.Count > 1)
- Log.Error("ScrollableBase", $"Only 1 child should be added to ScrollableBase.");
+ mScrollingChild = view;
+ propertyNotification = mScrollingChild?.AddPropertyNotification("position", PropertyCondition.Step(1.0f));
+ propertyNotification.Notified += OnPropertyChanged;
[EditorBrowsable(EditorBrowsableState.Never)]
public override void OnChildRemove(View view)
{
[EditorBrowsable(EditorBrowsableState.Never)]
public override void OnChildRemove(View view)
{
- propertyNotification.Notified -= OnPropertyChanged;
- mScrollingChild.RemovePropertyNotification(propertyNotification);
+ if(view.Name != "InterruptTouchingChild")
+ {
+ propertyNotification.Notified -= OnPropertyChanged;
+ mScrollingChild.RemovePropertyNotification(propertyNotification);
- mScrollingChild = new View();
+ mScrollingChild = new View();
+ }
{
if (e.PanGesture.State == Gesture.StateType.Started)
{
{
if (e.PanGesture.State == Gesture.StateType.Started)
{
+ Add(mInterruptTouchingChild);
Debug.WriteLineIf(LayoutDebugScrollableBase, "Gesture Start");
if (scrolling && !SnapToPage)
{
Debug.WriteLineIf(LayoutDebugScrollableBase, "Gesture Start");
if (scrolling && !SnapToPage)
{
}
}
totalDisplacementForPan = 0;
}
}
totalDisplacementForPan = 0;
+
+ Remove(mInterruptTouchingChild);
Interop.Actor.Actor_Remove(View.getCPtr(childLayout.Owner.Parent), View.getCPtr(childLayout.Owner));
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
Interop.Actor.Actor_Remove(View.getCPtr(childLayout.Owner.Parent), View.getCPtr(childLayout.Owner));
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ childLayout.Owner.InternalParent = null;