photo/video view: swipe left/right to show next/previous photo/video
Would like to work on this @AndyScherzinger @mahibi are there any specific ways to work on this ?
None that I am aware of @Smarshal21 Maybe @mahibi you have some opinion/requirements on it?
Thanks for your interest to work on this @Smarshal21 Some first thoughts on this:
A good first step will be to familiarize with the package "shareditems" (SharedItemsRepositoryImpl, ...) to learn where the file list come from. The endpoint to use is https://nextcloud-talk.readthedocs.io/en/latest/chat/#list-items-of-type-shared-in-a-chat As it will be about photos and videos only, the SharedItemType to use is "MEDIA".
Then FullScreenImageActivity/FullScreenMediaActivity have to be modified/replaced. Seems ViewPager2 is recommended to do the swiping. Not sure if it would make sense to combine rendering stuff from FullScreenImageActivity/FullScreenMediaActivity to have only one UI-view which can handle both photo/video.
Anyway it would make sense to create MVVM structure to have the data logic separated from rendering. Also, the viewModel could take care about downloading the next files in advance when the user swipes. See FileViewerUtils#openOrDownloadFile for download/cached handling.
Just let me know if you have any questions.
Thanks for your interest to work on this @Smarshal21 Some first thoughts on this:
A good first step will be to familiarize with the package "shareditems" (SharedItemsRepositoryImpl, ...) to learn where the file list come from. The endpoint to use is https://nextcloud-talk.readthedocs.io/en/latest/chat/#list-items-of-type-shared-in-a-chat As it will be about photos and videos only, the SharedItemType to use is "MEDIA".
Then FullScreenImageActivity/FullScreenMediaActivity have to be modified/replaced. Seems ViewPager2 is recommended to do the swiping. Not sure if it would make sense to combine rendering stuff from FullScreenImageActivity/FullScreenMediaActivity to have only one UI-view which can handle both photo/video.
Anyway it would make sense to create MVVM structure to have the data logic separated from rendering. Also, the viewModel could take care about downloading the next files in advance when the user swipes. See FileViewerUtils#openOrDownloadFile for download/cached handling.
Just let me know if you have any questions.
Sure will look into it. So the best thing to do would be to let the viewmodel return the shareditems list which can be used to display the next image while swiping right? and combining FullScreenImageActivity && FullScreenMediaActivity to have only one UI-view.
question from @Smarshal21 in chat:
how to access user and roomToken in FullScreenImageActivity in order to initialise repositoryParameters which helps in loading the media or images
question from @Smarshal21 in chat:
how to access user and roomToken in FullScreenImageActivity in order to initialise repositoryParameters which helps in loading the media or images
- user:
@Inject lateinit var currentUserProvider: CurrentUserProviderNew
val user = currentUserProvider!!.currentUser.blockingGet()
- roomToken:
for now, i would say pass the token where needed via methods in FileViewerUtils (in FileViewerUtils you can find the roomToken in the ChatMessage) and then pass to FullScreenImageActivity via intent.
For future (not in this PR), we might think about if it makes sense to store the currentRoom and also access it via injection.