* Make PIP react to camera orientation changes in the other participant's device
Adds a `controls.onPipMediaOrientationUpdate` callback for the WebView that will trigger a new `pipParamsBuilder.setAspectRatioFromOrientation(orientation)` method
* Fix warning about `PictureInPictureParams.Builder.setAspectRatio` only being available on API 26+
Review feedback: the previous pattern hardcoded http, https and ftp and
guessed at the address grammar. Candidates are now found by scheme and
handed to java.net.URI, which accepts any scheme and rejects an authority
that is not a real IPv6 literal, an unclosed bracket, or array syntax
such as values[0]:1. Also drops the explanatory comments.
A fediverse handle such as `@name@server.tld` contains a substring that
`Linkify.EMAIL_ADDRESSES` recognises as a valid address, so the timeline
renders `name@server.tld` as a tappable `mailto:` link. Tapping it opens a
mail composer addressed to an account that does not accept mail.
Drop a newly added `mailto:` span when the character immediately before it
is `@`. This mirrors what Android already does for web URLs, where
`Linkify.sUrlMatchFilter` rejects a match preceded by `@` — which is why
the handle currently produces exactly one stray mailto span and no partial
link is left behind once it is removed.
Author-supplied links are unaffected: spans that were already present
before linkification are excluded from the check and restored as before. A
genuine address written directly after an `@` — "mail me @support@element.io"
— is no longer linkified, which is the same trade-off Android already makes
for web URLs.
Patterns.WEB_URL, which LinkifyCompat uses to find links, has no
production for a bracketed IPv6 authority, so a URL such as
http://[2001:db8::1]:8008/path was never turned into a link. Worse, the
phone number matcher claimed the digit runs inside the address, leaving a
tel: link over part of it.
LinkifyHelper now runs its own pass for those URLs. It requires both a
scheme and the brackets, so array syntax like values[0]:1 is not matched,
and it runs after LinkifyCompat.addLinks, which strips any span set before
it, but before the pre-existing spans are restored, so real anchors and
pill spans keep their precedence. Any span Linkify left inside the address
is evicted, and the same trailing punctuation trimming as the other links
is applied.
Relates to https://github.com/element-hq/element-x-android/issues/2614
* Make Vulkan a *not required* feature
* Add `DeviceHasVulkanSupport` helper to check this on runtime
* When trying to open a screen with a map in it, check if vulkan is supported and display a new error dialog in that case
* Fix random lint issue
* Update screenshots
---------
Co-authored-by: ElementBot <android@element.io>
We were creating the same message twice by mistake.
Also, check the retrieved message for passwords before formatting the log line instead of after: this way we don't create a new formatted log line to just discard it
* Avoid SQLCipher key derivation by manually providing the generated as a raw key: this needs a series of DB re-key operations, performed as part of a 'dummy' DB migration
* Set key generation length to 32 bytes in `RandomSecretPassphraseProvider`.
* Use `ClientSecret` for handling the keys for SQLCipher. Move `ClientSecret` to `:libraries:androidutils` so it's shared.
* Fix crash when using `View.hideKeyboardAndAwaitAnimation`
Remove the `View.OnApplyWindowInsetsListener` used in modern Android versions to detect if the insets changed after they do the first time: this is a single use operation and the listener will be called every time the insets change
Also, replace `Mutex` with `CompletableDeferred` so it doesn't matter if it's called several times, we only care about the first one.
* Don't try to hide the keyboard if it's already hidden. Also, add a 1s timeout in case everything goes wrong and we somehow never complete the future.
`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.