SfEffectsView TouchDown event is fired on LongPress

Hello,

I run into issue with SfEffectsView, as I am using it for TouchDown and LongPress commands. In earlier versions, I was able to fire LongPress without TouchDown. In the current version (19.1.0.69), LongPress is fired alongside with TouchDown, which shouldn't be the case.

Is there a way to separate LongPress from touch events as TouchUp and TouchDown ?


Here is small sample with the issue.


Attachment: SfEffectsViewPressCommandsIssue_96bed967.zip


3 Replies

SS Sridevi Sivakumar Syncfusion Team June 24, 2021 12:10 PM UTC

Hi David Ziak,

Greetings from Syncfusion.

We have analy
zed the reported query and you have mentioned " In earlier versions, LongPress fired without TouchDown".

We have checked your sample from 18.1.0.42 version to our latest and ensured TouchDown command is fired when we longpress the control.

Can you please share the version that you have checked and 
share the issue reproducing platform and video? This would be helpful for us to better solution in this.

Regards,
Sridevi S.
 
 



DZ David Ziak June 24, 2021 02:37 PM UTC

Hello,

    sorry, I have checked it with previous versions also and I couldn't find version where TouchDown wasn't fired after LongPress. It's a feature then and you can't separate Touch from LongPress.

I found workaroud using XCT, where you can attach TouchEffects to any control including SfEffectsView, but I would like to stick with Syncfusion. Is there a way to achieve the same functionality with TouchEvents in SfEffectsView ?

xct:TouchEffect.Command="{Binding Source={x:Reference ***}, Path=BindingContext.TouchUpCommand}"

xct:TouchEffect.LongPressCommand="{Binding Source={x:Reference ***}, Path=BindingContext.LongPressCommand}"

 
If I longpress SfEffectView with these commands, Touch isn't fired.

Thank you.



SS Sridevi Sivakumar Syncfusion Team June 25, 2021 12:39 PM UTC

Hi David Ziak,

Thanks for your update.


SfEffectview control have a TouchUpCommand, we can use it to separate from long press action as per the below  code snippet,

[Xaml]:
 
 <StackLayout> 
            <Grid HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"> 
                <Grid.RowDefinitions> 
                    <RowDefinition Height="Auto" /> 
                </Grid.RowDefinitions> 
  
                <syncEffectsView:SfEffectsView IsClippedToBounds="True" BackgroundColor="Black" Padding="10,5,10,5" CornerRadius="10" TouchDownEffects="Ripple" 
  TouchUpCommand="{Binding Source={x:Reference MainPageSource}, Path=BindingContext.TouchUpCommand}" 
  LongPressedCommand="{Binding Source={x:Reference MainPageSource}, Path=BindingContext.LongPressCommand}"> 
  
                  <Label Grid.Row="0"  Text="TouchDown and LongPress label" FontAttributes="none" HorizontalOptions="Start" FontSize="19" TextColor="White"/> 
  
                </syncEffectsView:SfEffectsView> 
            </Grid> 
  
        </StackLayout> 

[ViewModel.cs]:
 
  
    public class MainPageViewModel
 
    { 
        #region COMMANDS 
  
        public ICommand TouchUpCommand { get; private set; } 
        public ICommand LongPressCommand { get; private set; } 
  
  
        #endregion 
        public MainPageViewModel(ContentPage u_Page) 
        { 
  
            _Page = u_Page; 
  
            TouchUpCommand = new Command(async () => await TouchUp()); 
  
  
            LongPressCommand = new Command(async () => await LongPress()); 
  
        } 
  
  
        private ContentPage _Page; 
  
        private async Task TouchUp() 
        { 
            System.Diagnostics.Debug.WriteLine("UP"); 
        } 
  
        private async Task LongPress() 
        { 
            System.Diagnostics.Debug.WriteLine("longPress"); 
        } 
  
    } 
Let us know if you need any further assistance.

Regards
Sridevi S.
 
 


Loader.
Up arrow icon