mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
0801a415b5
Introduce io.element.android.libraries.mediaviewer.api.FileViewerEntryPoint, a reusable screen which renders content that is not a Matrix media the same way the media viewer renders a file, with Share and Download actions. The caller provides a filename, a mime type and the whole content as a String. The node writes it to a temporary file in the cache directory, then reuses LocalMediaView (so text content goes through TextFileViewer) and LocalMediaActions for sharing and saving on disk. The node is contributed to AppScope so that the screen can be used from any graph, since MediaViewerNode itself is bound to RoomScope and depends on the timeline data sources. Also route MimeTypes.Json to TextFileView in LocalMediaView, so that a json file is rendered as text instead of falling back to the generic file card. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>