-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] tap action is hard to invoke by finger #293
Comments
I've got a similar issue where it is also sometimes hard to swipe to the next image. But I also can relate to the onTap issue. Zooming with 2 fingers works, but double tapping to zoom almost never. |
@Aoi-hosizora How to use PhotoViewGestureDetector? |
@woodstream You can see the source code in https://github.com/renancaraujo/photo_view/blob/master/lib/src/core/photo_view_core.dart and https://github.com/renancaraujo/photo_view/blob/master/lib/src/core/photo_view_gesture_detector.dart. PhotoViewGallery -> PhotoView -> PhotoViewCore -> PhotoViewGestureDetector return PhotoViewGestureDetector(
child: Container(
constraints: widget.tightMode ? BoxConstraints.tight(scaleBoundaries.childSize * scale) : null,
child: Center(
child: Transform(
child: customChildLayout,
transform: matrix,
alignment: basePosition,
),
),
decoration: widget.backgroundDecoration ?? _defaultDecoration,
),
onDoubleTap: nextScaleState,
onScaleStart: onScaleStart,
onScaleUpdate: onScaleUpdate,
onScaleEnd: onScaleEnd,
hitDetector: this,
onTapUp: widget.onTapUp == null ? null : onTapUp,
onTapDown: widget.onTapDown == null ? null : onTapDown,
); |
@renancaraujo Have you seen this issue? This is a major blocker for my app. It would be very kind of you if you could look at this. |
@Aoi-hosizora i have same issue here, could you give me simple sample code use PhotoViewGestureDetector ? |
This gallery issue is very very challenging. I can not reproduce it in any of my devices, but there is enough amount of people complaining about this. Since I'm alone maintaining this lib, I guess I will have to try to fix it even without knowing the reason why. |
I believe you can do it |
@febryardiansyah Oh I'm sorry to reply so late, you can see #293 (comment) and ignore some parameters directly. |
Just realized we have a small fix on gesture detector that was not yet released in any version. Would any of you (that can reproduce the bug) test if it works when pointing to photo_view's master? The fix: |
@renancaraujo I tried master yesterday behaves the same, I have problem with swiping + the double tap, sometimes the picture get "stuck" instead of moving to another picture bcs the custom gesture detector acepted the first event move even there is no way to pan the picture (meaning the picture is not zoomed just diplayed with 0.9 inital scale) |
I can sadly confirm that the latest version does not resolve the error |
I will probably change my career after fixing this. Become an astronaut or something. |
@renancaraujo As you see, Mars is waiting for you. |
@renancaraujo I think this is not really a good solution, but it basically solved my problem
|
#318 I tested it can work |
Has this problem been fixed? @renancaraujo give you a suggestion. You can try to ask Google's flutter development engineer to help you find out the problem. |
@TheLiyo With your code, it seems to solve the problem,I just did a test,But I also hope author can find out the reason and tell us why |
I'm not sure it's helping this specific issue, but just in case... A while ago I noticed some precision issue in the The issue was preventing user interaction for specific combinations of image size and scale (so, screen size). Maybe that's why the issue can be reproduced on some devices but not others... Hopefully you just have to play with |
I've just spent the whole weekend over this. Basically, we have two issues with our custom scale recog: it is taking precedence over all other recognizers even when it shouldn't be doing that, this causes double and taps not to work well. The second issue is that HitCornersDetector has some bugs. The last one is the one that concerns this issue. @DNetORM @vikeychen and @TheLiyo: I think we can solve that by fixing hit corners instead. This PR should fix this issue, can you test it? @deckerst That's new to me, but I think we have to add that to different places as well. I shall debug that in more depth. Thanks for the insight. This will help to solve #304 |
Anyway, @deckerst would open a PR with this fix? |
The problem still here. |
@progid Have you tested with the master branch? |
@renancaraujo yes, I have. It happens after loadingBuilder is shown. |
Was this issue fixed? Got kind of confused over here. |
#326 should fixed it. You can try to ref the lib in your pubspec.yaml as the following code:
|
It seems this worked for me. |
Yep, working fine, thanks a lot. |
double tap and swiping works again, you rock @renancaraujo ! |
Amazing. Installing just the version v0.10.2 didn't work but installing it from the master branch actually helped. Thanks. |
Thank you so much! Referencing the lib also worked for me. |
Next release should come ASAP, sorry for the delay. |
I still seem to be having issues with this. |
0.10.3 released, this should be fixed. |
I shall close this for now, if someone finds an issue in this matter after updating to 0.10.3, feel free to retake the discussion or message me on discord and I will attack this asap. I hate this bug. |
I had confused with the slide problem,but finally i try comment the backgroundDecoration attr and it reslove this problem.Here is my code.hope help you and everyone. @renancaraujo
|
Unfortunately I have same problem on 0.10.3 with Samsung Galaxy s20+ |
Versions
Flutter: 1.19.0-2.0.pre.83
Android 8
photo_view: ^0.9.2
Describe the bug
I used
PhotoViewGallery.builder
to show a set of images. But when I use finger to swipe or click, it is hard to invoke the action. Only by my little finger, will it be invoked sometimes.For example,
onTapDown
,onTapUp
ordouble click
to zoom.When I debug in emulator by mouse and use mouse in my Android mobile phone, it works normally. But it is too hard by finger.
But if I use
PhotoViewGestureDetector
directly, everything works normally.To Reproduce
Here is my code:
Screenshots
Emulator:
Android by mouse:
Android by finger: (I can't capture it)
The text was updated successfully, but these errors were encountered: