Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Toucheffect raised when scrolling #1261

Closed
AlleSchonWeg opened this issue May 5, 2021 · 11 comments
Closed

[Bug] Toucheffect raised when scrolling #1261

AlleSchonWeg opened this issue May 5, 2021 · 11 comments
Labels
a/TouchEffect bug Something isn't working. Breaky break. up-for-grabs Implementation from community can be started.

Comments

@AlleSchonWeg
Copy link

Description

The touch effect is raised, when the user only want to scroll the control with the attached effect.
All infos about the issue are in the comments of the Pull Request. Starting at comment: #566 (comment)

Expected Behavior

Touch effect should only raised it not scrolling, like ListView or CollectionView items.

Actual Behavior

Touch effect is raised on scrolling

Basic Information

  • Version with issue:
  • Last known good version: 1.1.0
  • IDE:
  • Platform Target Frameworks:
    • iOS:
    • Android:
    • UWP:
  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:

Workaround

Reproduction imagery

Reproduction Link

@AlleSchonWeg AlleSchonWeg added bug Something isn't working. Breaky break. s/unverified This issue needs verification/reproduction by a team member. PRs cannot be accepted/merged. labels May 5, 2021
@AndreiMisiukevich
Copy link
Contributor

@AlleSchonWeg hi
Is it on Android, right?

@AlleSchonWeg
Copy link
Author

Hi @AndreiMisiukevich ,

i have only a Simulator for iOS, but it looks like the same problem with scrolling.

And some other thing happens. The item stays in "touched" mode. I created a video. The labels are greyed out sometimes:

XCT.mp4

@IeuanWalker
Copy link
Contributor

@AndreiMisiukevich Might want to take a look at the platform implementation of this - https://github.com/IeuanWalker/Xamarin.Forms.StateButton

I'm not sure how the effects are implemented, but with this control 'Pressed' and 'Released' events are always raised (even when scrolling), but 'Clicked' event is only raised when the user clicks, but doest get raised when scrolling a list.

@AndreiMisiukevich
Copy link
Contributor

If you know how to fix that, then feel free to submit PR

@themronion
Copy link

Yeap, +1 here, also noticed this recently

@AlleSchonWeg
Copy link
Author

AlleSchonWeg commented May 26, 2021

Hi @AndreiMisiukevich,
on android i created a touch effect (ripple) which is only raised when the user selects an item. Not when scrolling. Perhaps you can use this and extend your touch effect:

         var label = new TextView(Context)
                    {
                        Text = $"Row ----- {i} in {noOfRows}",
                    };

                    label.Clickable = true;
                    label.Focusable = true;
                    int[] attrs = new int[] { Android.Resource.Attribute.SelectableItemBackground };
                    var typedArray = Context.ObtainStyledAttributes(attrs);
                    var drawableFromTheme = typedArray.GetDrawable(0);
                    typedArray.Recycle();
                    label.Foreground = drawableFromTheme;

In this example i used a label, which looks like this:

Android.Emulator.-.pixel_2_pie_9_0_-_api_28_5556.2021-05-26.21-22-54.mp4

@RenegadeVile
Copy link

This occurs with ScrollViews as well. Any View I add TouchEffect.NativeAnimation to will have that animation triggered when scrolling and I happen to start the scroll with a tap over said View.

@Seuleuzeuh
Copy link
Contributor

Settings the xct:TouchEffect.DisallowTouchThreshold to 1 did the trick for me, using the NormalBackgroundColor and PressedBackgroundColor. And also with the LongPressCommand. All of that in elements of a CollectionView.

@AndreiMisiukevich AndreiMisiukevich added up-for-grabs Implementation from community can be started. and removed s/unverified This issue needs verification/reproduction by a team member. PRs cannot be accepted/merged. labels Jul 13, 2021
@mphill
Copy link
Contributor

mphill commented Jul 14, 2021

This may be related, but I want to make sure @AndreiMisiukevich is aware. With the IsToggle property, on iOS Scrolling (In a ScrollView) will randomly stop working with IsToggle is triggers. It like the control gets stuck into thinking it's pressed so scrolling stops.

I can reproduce this pretty reliably.

I switched to using a real Button that appears to have resolved my issue.

@isness
Copy link

isness commented Aug 17, 2021

I tried playing with this, but nothing works. Latest CF, Collection view. I'd really like to apply any kind of touch effect on a single line without having it triggered while scrolling :(

@jfversluis
Copy link
Member

We believe this might be fixed in https://github.com/xamarin/XamarinCommunityToolkit/releases/tag/2.0.6

If not, please let uw know, open a new issue and link this one. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/TouchEffect bug Something isn't working. Breaky break. up-for-grabs Implementation from community can be started.
Projects
None yet
Development

No branches or pull requests

9 participants