-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fix Image becoming unclickable after using double tap zoom #20
Fix Image becoming unclickable after using double tap zoom #20
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @K1rakishou! Let's move the test to its correct location and this should be good to go.
private val composableTag = "ZoomableAsyncImage" | ||
|
||
@Test | ||
fun must_still_be_clickable_after_double_tap_zooming() = runTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this test and move the assertions ZoomableImageTest
which already has a test for click listeners?
Line 542 in 3438704
@Test fun click_listeners_work() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That'll also remove the need for having a base test class. Base classes aren't great 🙂.
state.handleDoubleTapZoomTo(centroid = centroid) | ||
} finally { | ||
isQuickZooming = false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @K1rakishou!
Can you rebase on |
d64cfe7
to
8acff3d
Compare
Fix Zoomable not resetting isQuickZooming to false after calling handleDoubleTapZoomTo() because it may throw CancellationException which wasn't handled. Unzoom back and check that the image is still clickable. Post review fixes. - Move click tests to click_listeners_work(). - Revert CoilImageSourceTest. - Remove BaseTest and ClicksTest. Revert this too.
8acff3d
to
8b7815f
Compare
:zoomable-image:sub-sampling-image - Tests were flaky! ✅ 22 passed / First failure encountered:
|
Fixes #18