Skip to content

Preview attachments in the entry view: images, PDF, video, text; show sizes - #3317

Open
cheblin wants to merge 1 commit into
PhilippC:mainfrom
cheblin:feature/attachment-previews
Open

cheblin wants to merge 1 commit into
PhilippC:mainfrom
cheblin:feature/attachment-previews

Conversation

@cheblin

@cheblin cheblin commented Oct 2, 2026

Copy link
Copy Markdown

📝 Description

A row of tiles under the attachments of an entry, so one sees what is attached without opening it:

Attachment Tile Tap
Image (whatever BitmapFactory decodes) thumbnail the existing ImageViewActivity
PDF first page (PdfRenderer) the page at full width in a dialog, "1 / N" in the title
Video (MP4, MOV, 3GP, Matroska, WebM; API 23+) a frame read from memory through a MediaDataSource, with ▶ opened like "Open"
UTF-8 text (strict decoder, no binary codes) the first lines the whole text (up to 256 KB) in a scrollable, selectable dialog

Other attachments get no tile. The size is shown next to every attachment name (name · 52 KB).

PdfRenderer needs a seekable file, so the PDF is written to the private cache only while it is rendered and deleted at once ("Open" already keeps attachments in the cache). Video and text are never written anywhere.

All of it is in a new AttachmentPreview.cs; EntryActivity only calls it.

🔗 Related Issue

None found.

🛠️ Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

✅ Checklist

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have added/updated tests that prove my fix is effective or that my feature works. UI only.
  • All new and existing tests passed locally.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have built the app locally, verified that it builds and tested the changes thoroughly. Built with the .NET 10 Android workload (36.1), tested on a Xiaomi phone with HyperOS.

📸 Screenshots/Videos

A row of tiles under the attachments of an entry: images, the first page
of a PDF (PdfRenderer), a frame of a video (read from memory), the first
lines of UTF-8 text. A tap shows the image viewer, the page or the whole
text in a window; a video opens like "Open". The size is shown next to
every attachment.

This branch has not been deployed

No deployments
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