21 Commits

Author SHA1 Message Date
Benoit Marty
b3ec256dfa API modules do not need to setup dependency injection.
Move the implementation to the impl modules.
2025-11-12 19:05:39 +01:00
Benoit Marty
1292da2a72 Copyright: Add Element Creations Ltd. copyright 2025-11-10 11:05:05 +01:00
Benoit Marty
b748fcc631 Copyright: Add final period 2025-11-10 10:13:41 +01:00
Benoit Marty
0a0224b586 Copyright: run command uv run license-editor --repository ../element-x-android 2025-11-10 10:09:26 +01:00
Jorge Martin Espinosa
a170d80cb3 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
Jorge Martin Espinosa
b219c05d06 Make sure we clean up the pre-processed and uploaded media (#5039)
* Add `MediaSender.cleanUp()` and `MediaPreProcessor.cleanUp()` methods: this will remove the temporary files created when pre-processing media before sending them.

* Make sure we clean up also the previous temporary media.

* Fix the condition for the custom back handler in the attachments preview screen

* Tests: check the clean up is performed when needed
2025-07-23 08:55:20 +02:00
Benoit Marty
05fc76822a 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
7215786239 Pre-process media during the attachment preview 2024-11-25 17:11:31 +01:00
Benoit Marty
19c56cdbe3 Send caption with media 2024-11-04 14:24:39 +01:00
Benoit Marty
2b016227e9 Migrate license to AGPL.
Run script `uv run license-editor --repository ../element-x-android`
2024-09-06 17:19:19 +02:00
Benoit Marty
378692f743 Fix moar ktlint issues 2024-01-11 10:02:10 +01:00
Benoit Marty
4f32299280 Use MimeTypes object instead of hard-coded strings. 2023-11-27 21:58:58 +01:00
Benoit Marty
04be1f0385 Use kotlin.time.Duration instead of java.time.Duration. Also use Duration in TimelineItemVideoContent, like in TimelineItemAudioContent and TimelineItemVoiceContent 2023-11-27 21:58:58 +01:00
jonnyandrew
5c582bba1b Record and send voice messages (#1596)
---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-10-23 17:28:00 +00:00
Jorge Martin Espinosa
814c8edc4f Media upload cancellation (#1058)
* Initial implementation of media upload cancellation

* Add tests

* Add changelog

* Update screenshots

* Add documentation

* Fix lint issues

* Fix review comments

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-08-17 09:02:03 +00:00
Benoit Marty
9321a9f718 Introduce simulateLongTask to ensure that the Presenter State Loading is visible.
Also do some cleanup on the tests.
2023-06-15 10:57:05 +02:00
Benoit Marty
eff03a86fb Fix bad namespace.
There were a warning: Namespace 'io.element.android.libraries.matrix.test' used in: :libraries:matrix:test, :libraries:mediaupload:test.
2023-06-07 17:02:08 +02:00
ganfra
4c19bd3644 Media: keep the name of the file when possible 2023-05-22 20:24:42 +02:00
ganfra
cc7d71af80 Media : branch upload to preview screen (need improvement) 2023-05-17 08:44:35 +02:00
ganfra
ac1531390e Media: fix encrypted media 2023-05-16 11:51:11 +02:00
Jorge Martin Espinosa
cd298b9359 [Media upload] Media pre-processing (#403)
* Create `mediaupload` module for media pre-processing.

* Split `mediapicker` and `mediaupload` modules.
2023-05-10 10:06:56 +02:00