refactor: Move gallery grouping logic to GalleryViewModel - #2064
Draft
aymericmariaux wants to merge 2 commits into
Draft
refactor: Move gallery grouping logic to GalleryViewModel#2064aymericmariaux wants to merge 2 commits into
aymericmariaux wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Moves gallery grouping and file-list state from the adapter into GalleryViewModel.
Changes:
- Centralizes gallery grouping, duplication, removal, and clearing.
- Updates fragment synchronization and preview handling.
- Simplifies adapter responsibilities and fast-scroll title lookup.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
GalleryViewModel.kt |
Owns gallery state and grouping logic. |
GalleryFragment.kt |
Coordinates ViewModel and adapter state. |
GalleryAdapter.kt |
Retains display-only list operations. |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
app/src/main/java/com/infomaniak/drive/ui/menu/GalleryAdapter.kt:148
- When duplicated files belong to the existing top month,
prependDuplicatedImagesdeliberately omits a new title, but this method inserts those files at index 0. The gallery then starts with files before their section header; a later duplicate can also create a second header for that month. Preserve the previous behavior by inserting title-less prefixes immediately after the existing title.
fun insertDuplicatedImages(prefix: List<Any>) {
itemList.addAll(0, prefix)
aymericmariaux
force-pushed
the
refactor-gallery-viewmodel
branch
from
August 6, 2026 06:31
46a5fdc to
3708c90
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



No description provided.