Jorge Martin Espinosa
58a3ea8b1f
Add catchingExceptions method to replace runCatching ( #4797 )
...
- Add `runCatchingExceptions` and `mapCatchingExceptions` to replace `runCatching` and `mapCatching`.
- Make `tryOrNull { ... }` catch only exceptions too.
- Apply the changes to the whole project.
- Add new Rust fakes for tests to handle the code that's now unblocked - previously it just threw an `UnsatisfiedLinkError` which we ignored.
- Add a new `detekt-rules` project with a `RunCatchingRule` to prevent `runCatching` and `mapCatching` usages.
2025-06-04 09:02:26 +02:00
Jorge Martin Espinosa
3d64afa937
When transcoding a video fails, send it as a file ( #4257 )
...
- If the video can't be transcoded it will be uploaded as a file instead.
- If the video already has the right format and dimensions, don't transcode it.
- Update the dimensions to 720p max when enabling media compression and 1080p otherwise, matching Element X iOS.
2025-05-13 11:04:51 +00:00
Jorge Martin Espinosa
fe5d9b4308
Send SVG images as files ( #4595 )
...
Since Android doesn't have support for SVG files we can't create a thumbnail or get the dimensions and other metadata needed for the `m.image` message type, so we need to send them as plain files
2025-04-15 17:05:09 +02:00
Jorge Martin Espinosa
f72fb9650b
Close the media preview screen ASAP with sending queue enabled ( #4089 )
...
* Close the attachment preview screen ASAP when sending media with the send queue is enabled
* When the send queue FF is not enabled make sure to dismiss the screen after the media has been sent
* Make sure we get a scaled thumbnail from videos too, not only for images
* Unify several state holders into `SendActionState`.
* Fix lint issues, add `Flow.firstInstanceOf` extension fun
* Update screenshots
---------
Co-authored-by: ElementBot <android@element.io >
2025-01-08 15:49:17 +00: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
22bb8796ef
Delete temporary created files.
2024-11-08 10:11:06 +01:00
Benoit Marty
be42821352
Add a log when deleting a file.
2024-11-08 10:11:06 +01:00
Jorge Martin Espinosa
e841faa737
Remove all GPS metadata from images uploaded as media ( #3781 )
...
Previously a minimal set of tags were removed, but we should make sure every single one of them is removed.
2024-11-04 10:31:55 +01:00
Benoit Marty
1b6a759847
Fix test.
2024-10-31 18:05:13 +01:00
Benoit Marty
7d54cb8f63
Rename file.
2024-10-31 18:01:56 +01:00
Benoit Marty
26d8b74255
Compress png file and generate png thumbnail for png files.
...
Fix tests
2024-10-31 15:51:45 +01:00
Benoit Marty
9f0461166e
Optimize media: Compress Png to Png.
2024-10-31 11:04:11 +01:00
Benoit Marty
ea73ee0481
Optimize media: always compress video to have maximum 1080 at the greatest size.
2024-10-31 10:53:44 +01:00
Benoit Marty
7c4f389d0b
Fix test.
2024-10-28 13:52:53 +01:00
Benoit Marty
2531ccf8e9
Add media upload setting.
...
Compress media regarding the settings.
Image compression change quality to 78%
Video compression change size to 720 x 48
2024-10-28 10:56:58 +01:00
Jorge Martin Espinosa
2efdb3ae45
Centralise the DI code generation logic ( #3562 )
...
* Create Anvil extension helper
* Use the helper everywhere
2024-09-30 12:20:28 +00: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
Jorge Martin Espinosa
950e502ca6
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
Jorge Martin Espinosa
801f0b955d
Notifications: simplify the flow by removing persistence ( #2924 )
...
* Notifications: simplify the flow by removing persistence.
* Bump of minSdk to `24` (Android 7).
* Add migration to remove `notification.bin` file
2024-05-29 08:03:23 +00:00
Benoit Marty
378692f743
Fix moar ktlint issues
2024-01-11 10:02:10 +01:00
renovate[bot]
7e9cda3aa9
Update plugin ktlint to v12.1.0 ( #2200 )
...
* Update plugin ktlint to v12.1.0
* Run `./gradlew ktlintFormat` and fix some issues manually.
* Fix other issues reproted by Ktlint
* Limit false positives, KtLint removes unnecessary curly brace in String templates.
* Remove useless Unit
* Minor improvements over ktlint changes
* Restore `AlertDialogContent` behaviour
* Update screenshots
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Benoit Marty <benoit@matrix.org >
Co-authored-by: Jorge Martín <jorgem@element.io >
Co-authored-by: ElementBot <benoitm+elementbot@element.io >
2024-01-10 16:22:24 +01:00
Benoit Marty
3d963df4fe
Move files to correct package.
2023-12-19 11:07:12 +01:00
Benoit Marty
e156cf0515
Restore test for image sending, now that computing Thumbnail can fail.
2023-12-19 11:05:40 +01:00
Benoit Marty
4cd3faf936
ThumbnailUtils.createImageThumbnail can throw IOException, and we can ignore it.
2023-12-19 10:47:31 +01:00
Benoit Marty
0f7af2b7fc
blurhash cannot be null here
2023-12-19 10:43:28 +01:00
Benoit Marty
55ce9068ef
Providing a thumbnail when sending a media is now optional.
2023-12-19 10:41:44 +01:00
Benoit Marty
955b315597
Cleanup
2023-11-29 17:27:16 +01:00
Benoit Marty
8bf5d5eee8
Disable failing tests for AndroidMediaPreProcessor
2023-11-29 17:03:27 +01:00
Benoit Marty
fcd8b86c64
Add tests for AndroidMediaPreProcessor
2023-11-29 17:03:27 +01:00
Benoit Marty
475bf376f9
Provide CoroutineDispatchers to ImageCompressor
2023-11-29 17:02:38 +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
0502b21ff8
Fix: WebP images can't be sent as media. ( #1501 )
...
* Fix: WebP images can't be sent as media.
* Place the `BitmapFactory.Options` mode change and comment where it belongs.
2023-10-06 09:18:11 +00:00
Jorge Martin Espinosa
b16dc45754
Fix the orientation of sent images ( #1190 )
...
* Fix the orientation of sent images
---------
Co-authored-by: Benoit Marty <benoit@matrix.org >
2023-08-30 17:02:37 +00:00
Benoit Marty
1a6376e723
Merge branch 'develop' into feature/bma/dataObject
2023-08-28 10:56:02 +02:00
Jorge Martin Espinosa
6457f3c4f5
Fix sent videos being cropped ( #1124 )
2023-08-24 09:41:58 +02:00
Benoit Marty
52853101d9
migrate object to data object ( #1135 )
2023-08-24 09:32:44 +02:00
Benoit Marty
c72f1a09a7
Enable detekt rules UnnecessaryParentheses and cleanup the code.
2023-07-20 18:08:08 +02:00
Benoit Marty
55538c2773
Enable detekt rules UnusedImports and cleanup the code.
2023-07-20 18:00:23 +02:00
Benoit Marty
5db2ebe179
Fix warning (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q here)
2023-07-20 15:34:55 +02:00
ganfra
31abc20fc2
Media: upload audio
2023-07-13 20:34:07 +02:00
ganfra
7e5d339922
Media: render audio content
2023-07-13 18:09:58 +02:00
Benoit Marty
02aee0fe15
Merge pull request #626 from vector-im/feature/bma/sonar
...
Sonar
2023-06-21 10:41:26 +02:00
Benoit Marty
9c5f05dba4
Fix the 6 issues reported by Sonar.
2023-06-16 18:08:20 +02:00
ganfra
e7ad8f6e07
Merge branch 'develop' into feature/fga/fix_media_pre_processing
2023-06-16 14:05:11 +02:00
ganfra
551a97ac2e
Media: fix detekt
2023-06-16 13:59:59 +02:00
ganfra
b6e7228ce0
Fix MediaPreProcessor for images/videos sent as file
2023-06-16 13:52:07 +02:00
ganfra
170c741130
Matrix rust sdk: update to 0.1.20 (and fix compilation issues)
2023-06-15 15:26:53 +02:00
ganfra
2c3fb8a549
Merge branch 'develop' into feature/fga/image_loading
2023-05-22 20:59:37 +02:00
ganfra
4c19bd3644
Media: keep the name of the file when possible
2023-05-22 20:24:42 +02:00