`AnchoredDraggable.requireOffset` was called before it was populated when displaying `CreateDmConfirmationBottomSheet`, because the keyboard and the bottom sheet were causing conflicting animations related to the insets.
Hiding the keyboard before displaying the bottom sheet seems to fix the issue, and `skipPartiallyExpanded` results in a better UX (and also worked around the issue by itself).
When parenthesis were mismatched by having more opening parenthesis than closing ones, we could end up incorrectly making the URLSpan `end` value greater than the actual text length, causing an `IndexOutOfBoundsException`
* fix(deps): update kotlin to 2.3.0
* Cleanup - remove `datetime` compat version
* Fix several lint issues caused by the Kotlin compiler inference working better (checks in nullables, vars, etc.)
* Fix tests by removing mock in `File.readBytes`, it seems like it's no longer allowed. Using a tmp file works well enough.
---------
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>
* Update dependency org.robolectric:robolectric to v4.16
* Fix file size formatter output on API 26+
* Use more realistic value for maxUploadSize
* Update screenshots
* Fix test issue: "java.security.KeyStoreException: AndroidKeyStore not found"
* Add exceptions.
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: ElementBot <android@element.io>
* Use `LogLevel` to decide whether to log the HTTP requests and responses
Added `DynamicHttpLoggingInterceptor` for this.
* Code cleanup.
* Use Timber.d
* OutOfMemoryError should not be caught. They are considered unrecoverable.
* Improve code in DefaultBugReporter.
---------
Co-authored-by: Benoit Marty <benoit@matrix.org>
This is also called 'remove animations' in some Android versions. It seems like the associated coroutine dispatcher never allows the `delay` calls to complete, or maybe they take too long and the coroutine is cancelled before they finish.
* Use variable bitrate mode when transcoding
This should be compatible with more devices that may lack the needed codecs to properly encode using constant bitrate mode (CBR).
* Fix video output size (again)
* Handle preference stores corruption by clearing them:
- Use the centralised `PreferenceDataStoreFactory` instead of `preferences by`.
- Add `DefaultPreferencesCorruptionHandlerFactory.replaceWithEmpty` to its `create(name)` method so all preference stores are cleared if they're corrupted.
* Add detekt rule to make sure we use `PreferenceDataStoreFactory` instead of `by preferencesDataStore`
* Remove `@SingleIn` annotations as the annotated class no longer have to be singletons
* Fix bitrate value used for video transcoding:
It should be 1000 times what it is now. The video size estimation was wrong since the retrieved duration value was in milliseconds, not seconds.
* Use `Duration` as the result type for `getDuration`
* 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>
- Add onUrlLoaded callback to WebViewWidgetMessageInterceptor
- Add WebViewAudioManager component and use it instead of the AudioManager extension functions
- Enable controlling the audio devices in Element Call from the OS instead of automatically detecting them
- Simplify the window flags in ElementCallActivity
- Work around the issue where the default audio device wasn't using the right audio stream
- Add onAudioPlaybackStarted, use it to start the audio-device related logic