-
Notifications
You must be signed in to change notification settings - Fork 4
Feat: custom projections support #26
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
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.
Pull request overview
Adds support for supplying custom ContentResolver projections when listing documents, enabling callers to fetch only the columns they need (and updates the sample app to exercise/benchmark this).
Changes:
- Add projection support to directory listing by accepting a custom projection and resolving column indices dynamically (ensuring
COLUMN_DOCUMENT_IDis included). - Update the
DocumentFileCompat/controller APIs to thread projection parameters through internal implementations while keeping a default full-projection path. - Extend the sample app with UI + utilities to generate many test files and benchmark custom-projection listing.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| dfc/src/main/java/com/lazygeniouz/dfc/resolver/ResolverCompat.kt | Adds projection parameter to listFiles, ensures document-id inclusion, and reads cursor columns by index lookup. |
| dfc/src/main/java/com/lazygeniouz/dfc/file/internals/TreeDocumentFileCompat.kt | Updates directory implementation to accept a projection when listing children. |
| dfc/src/main/java/com/lazygeniouz/dfc/file/internals/SingleDocumentFileCompat.kt | Updates signature for listFiles(projection) (still unsupported). |
| dfc/src/main/java/com/lazygeniouz/dfc/file/internals/RawDocumentFileCompat.kt | Updates signature for listFiles(projection) and documents that projection is ignored for File API. |
| dfc/src/main/java/com/lazygeniouz/dfc/file/DocumentFileCompat.kt | Introduces listFiles(projection) as the abstract API and keeps a no-arg listFiles() convenience; renames isDocument helper to isDocumentUri. |
| dfc/src/main/java/com/lazygeniouz/dfc/controller/DocumentController.kt | Threads projections into resolver calls; adds “unknown flags” guards for isVirtual/canWrite. |
| app/src/main/res/values/strings.xml | Adds strings for projection testing and test-file generation UX. |
| app/src/main/res/menu/main_menu.xml | Adds menu item to generate test files. |
| app/src/main/res/layout/activity_main.xml | Adds a “Test Custom Projections” button. |
| app/src/main/java/com/lazygeniouz/filecompat/example/performance/ProjectionPerformance.kt | New benchmark helper to compare full vs minimal projections. |
| app/src/main/java/com/lazygeniouz/filecompat/example/performance/Performance.kt | Exposes projection benchmark entry point. |
| app/src/main/java/com/lazygeniouz/filecompat/example/TestFileGenerator.kt | New coroutine-based utility to generate many test files for benchmarking. |
| app/src/main/java/com/lazygeniouz/filecompat/example/MainActivity.kt | Adds projection benchmark flow + test-file generation UI. |
| app/build.gradle | Updates the commented sample dependency version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dfc/src/main/java/com/lazygeniouz/dfc/file/internals/TreeDocumentFileCompat.kt
Outdated
Show resolved
Hide resolved
…entFileCompat.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
app/src/main/java/com/lazygeniouz/filecompat/example/performance/ProjectionPerformance.kt
Show resolved
Hide resolved
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.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Note that if your custom projection doesn't have
COLUMN_DOCUMENT_ID, it'll be added by default.