Skip to content

Conversation

@ItzNotABug
Copy link
Owner

  1. Allows passing custom projections for minimal data fetch.
    Note that if your custom projection doesn't have COLUMN_DOCUMENT_ID, it'll be added by default.
  2. Update sample app.

@ItzNotABug ItzNotABug self-assigned this Feb 8, 2026
Copy link
Contributor

Copilot AI left a 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_ID is 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.

…entFileCompat.kt

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

Copilot AI left a 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.

@ItzNotABug ItzNotABug merged commit 6c8afb7 into master Feb 8, 2026
7 checks passed
@ItzNotABug ItzNotABug deleted the projections branch February 9, 2026 06:03
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.

1 participant