diff --git a/Sharpnado.CollectionView.Droid/Renderers/CollectionViewRenderer.cs b/Sharpnado.CollectionView.Droid/Renderers/CollectionViewRenderer.cs index 42ba3e1..05c42f1 100644 --- a/Sharpnado.CollectionView.Droid/Renderers/CollectionViewRenderer.cs +++ b/Sharpnado.CollectionView.Droid/Renderers/CollectionViewRenderer.cs @@ -53,6 +53,12 @@ public static void Initialize() { } + public override bool OnInterceptTouchEvent(MotionEvent ev) + { + RequestDisallowInterceptTouchEvent(Element.HaveToDisallowInterceptTouchEvent); + return base.OnInterceptTouchEvent(ev); + } + protected override void OnElementChanged(ElementChangedEventArgs e) { base.OnElementChanged(e); diff --git a/Sharpnado.CollectionView/RenderedViews/CollectionView.cs b/Sharpnado.CollectionView/RenderedViews/CollectionView.cs index 6e28cd6..697d682 100644 --- a/Sharpnado.CollectionView/RenderedViews/CollectionView.cs +++ b/Sharpnado.CollectionView/RenderedViews/CollectionView.cs @@ -217,6 +217,12 @@ public class CollectionView : View typeof(CollectionView), 1); + public static readonly BindableProperty HaveToDisallowInterceptTouchEventProperty = BindableProperty.Create( + nameof(HaveToDisallowInterceptTouchEvent), + typeof(bool), + typeof(CollectionView), + false); + public CollectionView() { // default layout is VerticalList @@ -365,6 +371,12 @@ public int ColumnCount set => SetValue(ColumnCountProperty, value); } + public bool HaveToDisallowInterceptTouchEvent + { + get => (bool)GetValue(HaveToDisallowInterceptTouchEventProperty); + set => SetValue(HaveToDisallowInterceptTouchEventProperty, value); + } + public Func PreRevealAnimationAsync { get; set; } public Func RevealAnimationAsync { get; set; }