Skip to content
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

Add ProgressBar to MediaDetailPagerFragment for Image Loading Indicator #5736

Merged

Conversation

vtalos
Copy link
Contributor

@vtalos vtalos commented May 20, 2024

Description

This pull request introduces a ProgressBar to the MediaDetailPagerFragment to enhance the user experience by indicating when an image is loading. The ProgressBar is displayed while the image is being loaded and hidden once the loading is complete.

Fixes #5714

Changes Made:

  1. Updated Layout File (fragment_media_detail_pager.xml):
    -Added a ProgressBar element to the XML layout file.
    -Positioned the ProgressBar appropriately within the layout to ensure it appears prominently when an image is loading.

  2. Updated MediaDetailPagerFragment.java:
    -Integrated the ProgressBar into the fragment by finding the view and managing its visibility.
    -Implemented logic to display the ProgressBar while waiting for images to load and hide it once loading is complete.

Tests performed

Tested ProdDebug on Pixel 3 with API level 34

Screenshots
Screenshot_20240520_115938
Screenshot_20240520_115802

@nicolas-raoul
Copy link
Member

nicolas-raoul commented Jun 9, 2024

Looks great!

Would you just mind fixing these related unit tests?

fr.free.nrw.commons.bookmarks.BookmarkListRootFragmentUnitTest > testRefreshNominatedMedia FAILED
    java.lang.NullPointerException at BookmarkListRootFragmentUnitTest.kt:261

fr.free.nrw.commons.bookmarks.BookmarkListRootFragmentUnitTest > testOnItemClick FAILED
    java.lang.NullPointerException at BookmarkListRootFragmentUnitTest.kt:292

fr.free.nrw.commons.category.CategoryDetailsActivityUnitTests > testOnMediaClicked FAILED
    java.lang.NullPointerException at CategoryDetailsActivityUnitTests.kt:69

fr.free.nrw.commons.contributions.ContributionsFragmentUnitTests > testShowDetail FAILED
    java.lang.NullPointerException at ContributionsFragmentUnitTests.kt:350

fr.free.nrw.commons.explore.ExploreListRootFragmentUnitTest > testRefreshNominatedMedia FAILED
    java.lang.NullPointerException at ExploreListRootFragmentUnitTest.kt:217

fr.free.nrw.commons.explore.ExploreListRootFragmentUnitTest > testOnMediaClicked FAILED
    java.lang.NullPointerException at ExploreListRootFragmentUnitTest.kt:167

fr.free.nrw.commons.explore.depictions.WikidataItemDetailsActivityUnitTests > testOnMediaClicked FAILED
    java.lang.NullPointerException at WikidataItemDetailsActivityUnitTests.kt:170
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

fr.free.nrw.commons.media.MediaDetailPagerFragmentUnitTests > testShowImage FAILED
    java.lang.NullPointerException at MediaDetailPagerFragmentUnitTests.kt:191

fr.free.nrw.commons.media.MediaDetailPagerFragmentUnitTests > testShowImageSingle FAILED
    java.lang.NullPointerException at MediaDetailPagerFragmentUnitTests.kt:197

@nicolas-raoul nicolas-raoul merged commit 48bd3c0 into commons-app:main Jun 10, 2024
1 check passed
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.

App should provide some feedback (spinner) while waiting for data to load
3 participants