AndroidFilePicker

Android FilePicker. Calf's rememberFilePickerLauncher/rememberFileSaverLauncher are @Composable (they wrap rememberLauncherForActivityResult), so — mirroring AndroidPermissionsProvider.requestBridge — the host activity's Compose layer registers pickBridge/saveBridge to the real launchers; with no bridge registered this degrades to reporting no file rather than crashing. File bytes are read via Calf's KmpFile I/O, which is plain suspend code, not Compose-bound.

Constructors

Link copied to clipboard
constructor(context: Context)

Properties

Link copied to clipboard
var pickBridge: suspend () -> KmpFile??

Wired/cleared by the host activity: launches the Calf file picker, resumes with the picked file.

Link copied to clipboard
var saveBridge: suspend (fileName: String, bytes: ByteArray) -> KmpFile??

Wired/cleared by the host activity: launches the Calf file saver, resumes with the saved file.

Functions

Link copied to clipboard
open suspend override fun pickFile(): ByteArray?

Prompts the user to pick a file; null if cancelled, unavailable, or no host UI has wired the picker.

Link copied to clipboard
open suspend override fun saveFile(fileName: String, bytes: ByteArray): Boolean

Prompts the user to choose a save location and writes bytes there; true on success.