element-x-ada/features
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
..
analytics AnalyticsOptInView: replace PageTitle by IconTitleSubtitleMolecule 2025-07-11 14:15:12 +02:00
cachecleaner Fix coroutine scope (#4820) 2025-06-04 15:33:51 +00:00
call Sync Strings (#5146) 2025-08-11 12:49:29 +00:00
changeroommemberroles Sync Strings (#5146) 2025-08-11 12:49:29 +00:00
createroom Add media file limit size warning and media quality selection (#5131) 2025-08-11 17:22:46 +02:00
deactivation [a11y] Ensure that heading() is applied to all screen titles. 2025-07-04 12:15:42 +02:00
enterprise Move isElementCallAvailable fun to new SessionEnterpriseService, which implementations can get the current MatrixClient. 2025-06-24 11:28:25 +02:00
ftue Sync Strings (#5146) 2025-08-11 12:49:29 +00:00
home Sync Strings (#5146) 2025-08-11 12:49:29 +00:00
invite Sync Strings (#5146) 2025-08-11 12:49:29 +00:00
joinroom Sync Strings (#5146) 2025-08-11 12:49:29 +00:00
knockrequests [a11y] Ensure that heading() is applied to all screen titles. 2025-07-04 12:15:42 +02:00
leaveroom Sync Strings (#5146) 2025-08-11 12:49:29 +00:00
licenses [a11y] Ensure that heading() is applied to all screen titles. 2025-07-04 12:15:42 +02:00
location Update dependency org.matrix.rustcomponents:sdk-android to v25.7.23 (#5073) 2025-07-24 11:58:30 +02:00
lockscreen Sync string again 2025-08-04 14:50:08 +02:00
login Sync Strings (#5146) 2025-08-11 12:49:29 +00:00
logout Sync Strings from Localazy 2025-07-28 00:33:43 +00:00
messages Add media file limit size warning and media quality selection (#5131) 2025-08-11 17:22:46 +02:00
migration Add catchingExceptions method to replace runCatching (#4797) 2025-06-04 09:02:26 +02:00
networkmonitor Fix coroutine scope (#4820) 2025-06-04 15:33:51 +00:00
poll Sync Strings (#5146) 2025-08-11 12:49:29 +00:00
preferences Add media file limit size warning and media quality selection (#5131) 2025-08-11 17:22:46 +02:00
rageshake Sync Strings (#5146) 2025-08-11 12:49:29 +00:00
reportroom Sync Strings (#5146) 2025-08-11 12:49:29 +00:00
roomaliasresolver Sync Strings from Localazy (#4983) 2025-07-04 14:37:59 +00:00
roomcall Move isElementCallAvailable fun to new SessionEnterpriseService, which implementations can get the current MatrixClient. 2025-06-24 11:28:25 +02:00
roomdetails Add media file limit size warning and media quality selection (#5131) 2025-08-11 17:22:46 +02:00
roomdirectory Update dependency org.matrix.rustcomponents:sdk-android to v25.7.23 (#5073) 2025-07-24 11:58:30 +02:00
roommembermoderation Sync Strings from Localazy 2025-08-04 00:34:11 +00:00
securebackup Sync Strings from Localazy 2025-08-04 00:34:11 +00:00
share Add media file limit size warning and media quality selection (#5131) 2025-08-11 17:22:46 +02:00
signedout Sync Strings from Localazy 2025-08-04 00:34:11 +00:00
userprofile Sync Strings from Localazy (#4983) 2025-07-04 14:37:59 +00:00
verifysession Sync Strings from Localazy 2025-08-04 00:34:11 +00:00
viewfolder [a11y] Ensure that heading() is applied to all screen titles. 2025-07-04 12:15:42 +02:00