Skip to content

Conversation

@armouldr
Copy link
Collaborator

@armouldr armouldr commented Dec 15, 2024

The goal of this PR is to make the user pictures gallery more user-friendly and interactive by allowing user to click on a picture in order to view it in full screen. Additionnaly, the user can navigate between the full-screen pictures by scrolling horizontally or clicking on the right/left arrow buttons.

@armouldr armouldr linked an issue Dec 15, 2024 that may be closed by this pull request
@Aurelien9Code
Copy link
Contributor

From 7.14% to 87.1%, bravo ! 🚀

@armouldr
Copy link
Collaborator Author

Road to 1000% coverage 🚀 😎

@armouldr armouldr marked this pull request as ready for review December 16, 2024 00:15
@armouldr armouldr self-assigned this Dec 16, 2024
Copy link
Collaborator

@Romainhir Romainhir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job, a few small details to clarify and I'll approve it

EventUserPicture("34", "http:image.com", User.emptyFirestoreReferenceElement(), 3))
EventUserPicture(
"12",
"https://i1.sndcdn.com/artworks-000055240636-kowvdx-t500x500.jpg",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happend if the URL is not available (like a 404 error) ? If it does not make the tests crash, you can leave it as this, but otherwise consider downloading the image or use one already downloaded

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are right, it made the test fail. I found a way to get the local Uri of a drawable instead.

matcher =
hasTestTag(EventCreationTestTags.LOCATION_SUGGESTION_ITEM_LATITUDE + EVENT_LATITUDE),
timeoutMillis = 10000)
timeoutMillis = 15000)
Copy link
Collaborator

@Romainhir Romainhir Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting 15 seconds before timeout is a lot. Confirm me you really need to wait that long, otherwise, reduce the sleeping time

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice spot, I had a problem with the test and wanted to see if it was due to insufficient delay, but I forgot to reset the correct timeout

if (pagerState.currentPage > 0) {
scope.launch { pagerState.animateScrollToPage(pagerState.currentPage - 1) }
} else {}
} else {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty else statement. Consider handle these cases properly

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this because android studio was giving me the warning "'if' must have both main and 'else' branches if used as an expression" when I didn't put any else statement. But found that casting onClickArrow to (Boolean) -> Unit achieves the same and is cleaner than empty else statements :)

if (isRight && pagerState.currentPage < eventPictures.size - 1) {
scope.launch { pagerState.animateScrollToPage(pagerState.currentPage + 1) }
} else if (!isRight) {
if (pagerState.currentPage > 0) {
Copy link
Collaborator

@Romainhir Romainhir Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you make two if statements ? Why did you not put it in a single one like you did just before (with an AND operator) ?

Copy link
Collaborator Author

@armouldr armouldr Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't intentional, I corrected it

@sonarqubecloud
Copy link

@armouldr armouldr merged commit 2c248c9 into main Dec 16, 2024
3 checks passed
@armouldr armouldr deleted the feature/maximise_picture_onclick branch December 16, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open event picture in full screen when clicking on it

4 participants