Skip to content

Conversation

@vinceglb
Copy link
Owner

Summary

  • Defers FileKit.context access in Android settings classes until actually needed
  • Makes authority parameter nullable with default null in FileKitShareSettings, FileKitOpenCameraSettings, and FileKitOpenFileSettings
  • Adds getDefaultAuthority() helper to resolve the default authority when operations are executed

This prevents crashes in Android Studio Compose previews where the context is not initialized during composition.

Fixes #416

Test plan

  • Verify Compose previews work with rememberShareFileLauncher()
  • Verify Compose previews work with rememberCameraPickerLauncher()
  • Verify sharing files still works at runtime on Android
  • Verify camera picker still works at runtime on Android
  • Verify opening files with default application still works at runtime on Android

🤖 Generated with Claude Code

Defer FileKit.context access in Android settings classes until actually
needed, rather than at object instantiation. This prevents crashes in
Android Studio Compose previews where the context is not initialized.

Fixes #416

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@vinceglb vinceglb merged commit f8faf92 into main Jan 15, 2026
3 checks passed
@vinceglb vinceglb deleted the fix/compose-preview-share-launcher branch January 15, 2026 00:44
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.

rememberShareFileLauncher breaks compose previews in Android Studio

2 participants