Compress images and videos before upload + new upload/preview dialog + use system camera - #6429
Conversation
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/30387637532/artifacts/8699821637 |
cd7df8f to
c950080
Compare
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/30388822788/artifacts/8700239068 |
There was a problem hiding this comment.
It would be nice to formulate and design it a bit less technical. Signal e.g. specifically calls it "Sent media quality" with an easy to understand "Low" and "High" setting.
I'd say we could have a single-select segmented button in the send flow with:
- Original quality
- Reduced quality
And last selected setting remembered. What do you think @nimishavijay
c950080 to
fc85f80
Compare
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/30476294926/artifacts/8734032240 |
|
If we are able to have a fullscreen preview of the image before sending like in whatsapp,telegram, signal, etc, the |
fc85f80 to
b50fd6b
Compare
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/30641574479/artifacts/8797835298 |
19383a8 to
9267408
Compare
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/30656399981/artifacts/8803577048 |
|
@jancborchardt @nimishavijay which solution of the HQ selection do you prefer? Do you have more feedback for this current state?:
|
jancborchardt
left a comment
There was a problem hiding this comment.
@mahibi I’d say the last one with the toggle on the bottom that has actual text. Makes it very clear every time.
It’s best to do it clear & safe in the beginning, we can still make it more obscure later if we notice it’s too much. Important is also that the last preference is remembered.
(Another option to merge the approaches and save space could of course be to have the icon in the top right, but then make it open a menu with 2 entries which have clear wording "Original quality" and "Reduced quality".)
alright thanks for the quick feedback. |
9267408 to
7431a45
Compare
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/30807911255/artifacts/8854216608 |
There was a problem hiding this comment.
Can you remove HighQualityIcons.kt and replace it with the xml equivalent? Found here.
Which can be used in Compose with painterResource. That way all the resources are in one place. If we keep them in code in it might be a pain to track them all later.
63aeda9 to
ef3749f
Compare
Done 👍 . I was thinking "let's use the compose equivalent from now on" (but yeah, should have chosen a better place to save it of course) but it seems the official documentation from google still recommends to just download the XML:
https://developer.android.com/develop/ui/compose/graphics/images/material |
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/31164884771/artifacts/8988875188 |
ef3749f to
42b18dd
Compare
Adds an optional compression step to the chat attachment upload flow,
covering both gallery-picked and camera-captured photos/videos.
- Add ImageCompressor/VideoCompressor utilities: images are downscaled
and re-encoded as JPEG; videos are downscaled to 540p short side and
transcoded via Media3 Transformer on a dedicated HandlerThread so the
main thread is never blocked.
- Migrate the file attachment preview dialog to Jetpack Compose, adding
thumbnails, per-file dimensions/size preview, and a "Compress images
and videos" checkbox that updates the preview live.
- Persist the compression choice as a user preference (default on),
with a toggle in Settings.
- Extend the existing upload notification to also show live progress
("Compressing… X%") while a video is being transcoded, by polling
Transformer.getProgress(), before it turns into the upload progress
notification.
- Modernize BitmapShrinker to use ImageDecoder on API 28+ (single-pass
decode+scale, automatic EXIF rotation for JPEG/HEIC), falling back to
the previous BitmapFactory-based path on API 26/27.
- Fix MIME-type resolution for file:// URIs (e.g. camera-captured
photos/videos), which previously failed dialog/thumbnail detection
since ContentResolver.getType() only handles content:// URIs.
Assisted-by: Claude Code 2.1.199:claude-sonnet-5
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Assisted-by: Claude Code 2.1.199:claude-sonnet-5 Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Assisted-by: Claude Code 2.1.199:claude-sonnet-5 Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Assisted-by: Claude Code 2.1.199:claude-sonnet-5 Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Assisted-by: Claude Code 2.1.199:claude-sonnet-5 Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Assisted-by: Claude Code 2.1.199:claude-sonnet-5 Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Release the ExoPlayer's hardware decoder on ON_STOP (e.g. when the system camera launches on top to record), not just on dispose, to avoid contending with the camera's hardware encoder for codec resources. Assisted-by: Claude Code 2.1.199:claude-sonnet-5 Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
…see the chip Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
..so the chips are visible Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
For now the official recommendation from google is "we recommend downloading Vector Drawable XML files from the "Android" tab on Google Fonts to get the latest Material Symbols." https://developer.android.com/reference/kotlin/androidx/compose/material/icons/package-summary Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
42b18dd to
79901ba
Compare
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/31165927913/artifacts/8989198806 |
|
A great first step — thank you so much! This is a really important improvement for using Talk as an everyday messenger. A few things that would make the experience even better:
Overall, this is a fantastic and very important step. With a little more flexibility in media quality and a few improvements to the video experience, Talk could become much more suitable as a real replacement for mainstream family and friends messengers. |





resolve Use compression for images and files selected via gallery #5190
resolve replace photo camera code with intent to open system camera #2461
Adds automatic compression of images and videos before upload in chat, replaces the old attachment picker/preview dialog with a new Compose-based
one, and removes the app's built-in camera capture screen in favor of the system camera.
Compress images and videos before upload
transcoded via Media3 Transformer on a dedicated HandlerThread, keeping the main thread unblocked.
the previous BitmapFactory path on API 26/27.
--> this is just a temporary solution until in chat upload previews are implemented.
ContentResolver.getType() only handles content:// URIs.
New attachment preview/upload dialog
before sending.
Media quality setting
options (previously a simple switch), persisted via AppPreferences.
Removed built-in camera
PickImage, ConversationCreationActivity, ConversationInfoEditActivity, and ProfileActivity updated accordingly.
Assisted-by: Claude Code 2.1.199:claude-sonnet-5
🖼️ Screenshots/Videos
Demonstration video
Screen_recording_20260803_150537.mp4
Settings
TODO for followup PR's
As not to go even further off-topic with this PR it only focuses on the upload/preview dialog and not on the upload itself. So
is not part of this PR but should be a next step soon.
Although the order of the previews can be modified by drag and drop in this PR, the related code to upload and share does not yet respect this order. This must be part of a followup improvement.
🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)