capacitor-community / file-opener

Capacitor File Opener. The plugin is able to open a file given the mimeType and the file uri. This plugin is similar to cordova-plugin-file-opener2 without installation support.
MIT License
67 stars 13 forks source link

Add "sheet" mode #65

Closed fanckush closed 4 days ago

fanckush commented 1 week ago

It would be so good if it were possible to open the file as a sheet instead of the current full-screen mode

something like

    const fileOpenerOptions: FileOpenerOptions = {
      filePath: 'file://some/path',
      contentType: 'application/pdf',
      mode: 'sheet' // | 'fullscreen'
    }

    await FileOpener.open(fileOpenerOptions)

is this even possible?

ryaa commented 4 days ago

is this even possible?

Currently the plugin delegates opening a file to a native app which support this file format. To open the file as a sheet, as I see, the plugin will have to support displaying it itself. This should be doable for some formats (for, example images/video etc.) but might be tricky for others. I would say, that this is going to be a considerable effort to support this feature and not planning to implement it.