Commit Graph

62 Commits

Author SHA1 Message Date
Benoit Marty b62242cdd2 Fix sharing gallery from pinned event timeline. 2026-06-26 17:36:27 +02:00
Benoit Marty a7e6d8af6e Better fix to render all items in the gallery. Should be able to render mixed items. 2026-06-26 16:24:57 +02:00
bxdxnn 87aff40b26 Support gallery messages (#6519)
* Support gallery messages

* Address review

* Remove unused function

* Fix indent

* Add "Gallery" message prefix

* Support galleries for image editing

* Fix tapping on a tile opens the last item

* Fix overflow count

* Add caption editing to gallery messages

* Use the new gallery string for prefix

* Lock sending galleries behind a feature flag

* Fix detekts

* Fix

* Ensure image edition is saved when navigating

* Fix sending media broken on edited gallery.

* Fix tests

* Order imports

* Remove unused parameters.

* Fix copyright header of new files.

* Fix Konsist test

* Extract new previews to a dedicated file.

* Sync strings

* Remove unused import

* Update screenshots

* Trigger CI

* Remove parameters with default value.

* More cleanup

* Restore sendAsFile behavior.

* Improve Preview.

* Improve Preview.

* Improve Preview.

* Fix gallery sending cancel and retry issue

* Ensure any previous job is cancelled.

* Fix issue in summary message

* Gallery feature is disabled by default.

* Kotlin convention

* Remove useless parenthesis

* Update screenshots

* Fix test

* List -> ImmutableList

* Remove useless code.

* Render formatted caption for attachment list.

* Replace set of Booleans by an enum

* Remove unused model for individual caption in a gallery Event.

* Fix tests

* Fix tests

* Rework MediaViewer entry point.

And ensure that the clicked image from the gallery is displayed first.

* Ensure gallery item can be click in the pinned message list
Improve the gallery item click handling code.

* Improve code and fix separator color
Closes #7101

* React on attachment item click
Improve code

* Improve code and support 0 items in gallery.

* Fix click on attachment item not rendering anything.

---------

Co-authored-by: Benoit Marty <benoitm@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
Co-authored-by: ElementBot <android@element.io>
2026-06-26 16:00:56 +02:00
Benoit Marty 1c058037be Update the way we display file format and size. 2026-06-02 12:50:51 +02:00
Benoit Marty 97135272ec [Media viewer] Improve rendering of files
Closes #6899
Closes #6908
2026-06-02 10:22:34 +02:00
bxdxnn 071d98c66b Render media captions formatting in the media viewer (#6729)
* Render media captions formatting in the media viewer

* Update screenshots

* Trigger actions

* Remove unused imports and reformat code

---------

Co-authored-by: ElementBot <android@element.io>
Co-authored-by: Jorge Martín <jorgem@element.io>
2026-05-08 16:30:32 +02:00
Benoit Marty eb31505dc7 Copyright: Add Element Creations Ltd. copyright 2025-11-10 11:05:05 +01:00
Benoit Marty f86431e663 Copyright: Add final period 2025-11-10 10:13:41 +01:00
Benoit Marty c4e0370f41 Copyright: run command uv run license-editor --repository ../element-x-android 2025-11-10 10:09:26 +01:00
Jorge Martín 753322d50e Pass around fromPinnedEvents so we can use it to decide whether to forward the event from the main timeline or the pinned events one 2025-11-03 14:43:57 +01:00
Benoit Marty 07b6148035 Remove context(parentNode: Node) and provide the parent Node as a parameter. 2025-10-31 12:04:57 +01:00
Benoit Marty f174084942 Use context parameter for the parentNode 2025-10-30 16:32:53 +01:00
Benoit Marty 02dc71c4c3 Remove NodeBuilder to ensure that Params and Callback are always provided. 2025-10-30 16:32:52 +01:00
Benoit Marty 43972dba68 Rename fun in Callback for clarity. 2025-10-30 16:32:48 +01:00
Benoit Marty 95c735a90e Add Forward action to MediaDetailsBottomSheet. Closes #5454
Improve API of Callback when forwarding Event.
2025-10-28 18:13:53 +01:00
Benoit Marty 1682fd4c2c Remove dependency to Anvil from modules that do not use it. 2025-08-25 11:36:42 +02:00
Jorge Martin Espinosa adc61b3826 Add media file limit size warning and media quality selection (#5131)
* Add `VideoCompressorPreset` enum

This represents the different compression presets used for processing videos before uploading them

* Add `VideoCompressorHelper` util class to calculate the scaled output size of the video given an input size and its optimal bitrate

Also add `MediaOptimizationConfig` which will be used to decide how to apply compression in `MediaPreProcessor`

* Add `RustMatrixClient.getMaxFileUploadSize()` function and `MaxUploadSizeProvider` so we can import only this functionality into other components

* Try preloading the max file upload size the first time we get network connectivity - it's a best effort

This should help ensure we'll have this value available later, even if we still need to load it asynchronously.

* Split the `compressMedia` preference into `compressImages` and `compressMediaPreset`

* Modify the media processing parts to use the new classes and utils

* Add `MediaOptimizationSelectorPresenter`, which will retrieve the compression values and the max file upload size, also estimating the compressed video file sizes if needed.

* Add a feature flag to allow selecting the media upload quality per upload

* Integrate the previous changes with the attachments preview screen

Add strings from localazy too.

* Adapt the rest of the app calls to upload media to using the media optimization configs

* Allow modifying the default compression values in advanced settings, based on the feature flag value

* Pass the `fileSize` in `MediaUploadInfo` too, to be able to check it against the `maxUploadSize`

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-08-11 17:22:46 +02:00
Benoit Marty cfdc595c84 Add preview for Text media. 2025-03-18 11:24:13 +01:00
Benoit Marty 2e9a158fb0 Update Matrix Room API and allow media swipe on pinned event only. 2025-02-17 16:45:25 +01:00
Benoit Marty d26414f1d3 Provide duration 2025-01-22 16:22:18 +01:00
Benoit Marty 7df65b0350 Add support for files navigation (when coming from the gallery) 2025-01-22 16:22:15 +01:00
Benoit Marty 97f3be3dc5 Apply dual licenses: AGPL + Element Commercial to file headers.
2 replace all actions have been performed:
- "SPDX-License-Identifier: AGPL-3.0-only" to "SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial"
- "Please see LICENSE in the repository root for full details." to "Please see LICENSE files in the repository root for full details."
2025-01-07 10:05:04 +01:00
Benoit Marty 5c41de60fa Move share and download actions to the bottom sheet 2024-12-19 16:20:50 +01:00
Benoit Marty 49b413b92f Distinguish Audio and Voice media items. 2024-12-16 10:54:47 +01:00
Benoit Marty ce09aac59d Add audio file support in the gallery and in the media viewer.
Make MediaPlayerControllerView compatible to control audio playback
2024-12-13 09:45:45 +01:00
Benoit Marty da272ddb07 Implement month separator for the Gallery.
Improve day separator rendering in the timeline.
Use Today, Yesterday, and the name of the day if less than 7 days and do not render the year for the current year.
Improve date format for the media viewer.
Rework how date and time are computed.
ActionListView: Time can take more space, so update the layout.
2024-12-11 23:57:57 +01:00
Benoit Marty 197fda5d0e Rename onDone to onBackClick. 2024-12-10 08:51:43 +01:00
Benoit Marty 3e1b1c29d1 Media Gallery 2024-12-09 16:48:48 +01:00
Benoit Marty 3b5b443cbb MediaViewer: iterate on design 2024-12-02 17:05:44 +01:00
Benoit Marty 96d7fbfadc Move code to the impl module 2024-11-29 09:24:50 +01:00
Benoit Marty 9a6b39852b Improve preview 2024-11-28 16:15:45 +01:00
Benoit Marty 62134022bb PlayableState.Playable should only contain data useful for other components. 2024-11-28 14:38:58 +01:00
Benoit Marty 28ed0920a4 Cleanup 2024-11-27 16:12:28 +01:00
Benoit Marty 9c1ccdfe62 Add custom video player controller 2024-11-27 16:05:51 +01:00
Benoit Marty c1c9f53015 Fix other API change: body renamed to filename 2024-10-16 16:09:32 +02:00
Benoit Marty 920dc2b0d7 Improve mapping regarding filename, caption and formattedCaption 2024-10-08 17:12:48 +02:00
Jorge Martin Espinosa eeec7cc785 Centralise the DI code generation logic (#3562)
* Create Anvil extension helper

* Use the helper everywhere
2024-09-30 12:20:28 +00:00
ganfra 71c0eb19b2 Merge pull request #3537 from element-hq/feature/fga/fix_image_viewer_glitch
Fix image viewer glitch
2024-09-26 11:28:34 +02:00
Benoit Marty acae30b1f9 Stop ignoring 2 tests and fix them. 2024-09-25 18:32:43 +02:00
Benoit Marty 3c3781d5d3 Fix visibility issue. 2024-09-24 18:23:19 +02:00
Benoit Marty 55704f0227 Less ugly code. 2024-09-24 18:21:30 +02:00
Benoit Marty 92834e8985 Fix crash when pdf cannot be opened.
https://sentry.tools.element.io/organizations/element/issues/1570011/events/efcaaf7382194fd4b7991ca6b05e7532/
2024-09-24 17:25:51 +02:00
ganfra 8102aa4744 media viewer: fix glitch when transition from thumbnail to fullview 2024-09-24 16:31:47 +02:00
Benoit Marty f61df38e55 Migrate license to AGPL.
Run script `uv run license-editor --repository ../element-x-android`
2024-09-06 17:19:19 +02:00
Benoit Marty f2b38e50e3 Add test on function name which may start or end with spaces and fix existing issues. 2024-08-20 17:11:30 +02:00
Jorge Martin Espinosa b0cebf5ca0 Improve screenshot testing with ComposablePreviewScanner (#3125)
* Use ComposablePreviewScanner to rework how screenshot testing works
* Add test sharding
* Update screenshots
* Fixes for Element Gallery

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2024-07-03 13:05:06 +02:00
Benoit Marty 37d9a9f5a9 Lambda parameters in a composable function should be in present tense, not past tense.
https://mrmans0n.github.io/compose-rules/rules/#naming-parameters-properly
2024-05-29 12:18:23 +02:00
Benoit Marty 6f44ef7a8f Rename class (code quality) 2024-05-23 14:38:52 +02:00
Benoit Marty c6c00a60d4 Need a default value for Modifier. 2024-03-01 18:44:08 +01:00
Benoit Marty 7b1e57c9f4 Fix preview error of MediaVideoView. 2024-03-01 18:25:26 +01:00