Commit Graph

4349 Commits

Author SHA1 Message Date
Benoit Marty
cf17d93580 Stronger lambda error (#4771)
* Make sure lambdaError() make the test fail in all circumstances.

* Fix existing errors on tests.

* Uniformize the way we are creating class under test.

* Cleanup

* Fix typo

* Fix failing test after rebase.
2025-05-27 15:32:09 +00:00
Benoit Marty
c86154d120 Hide Element Call entry point if Element Call service is not available. (#4783)
* Hide Element Call entry point if Element Call service is not available.

* No need to preview the case RoomCallState.Unavailable

* Hide start call action from user profile if Element Call is not available.

* Add mising `use` and cover the problem by a test.

* Update screenshots

* Update enterprise submodule ref.

* Ensure `enterpriseService.isElementCallAvailable()` is not called several times.
And fix unit tests on CI

---------

Co-authored-by: ElementBot <android@element.io>
2025-05-27 16:31:05 +02:00
Jorge Martin Espinosa
c67089edf7 Add ActiveRoomsHolder to manage the active rooms for a session (#4758) 2025-05-26 11:03:55 +00:00
Benoit Marty
dbe75cd4ea On boarding flow: add a screen to select account provider among a fixed list (#4769)
* Hide login with QrCode when the app is opened by a link

* Fix UI on ChangeAccountProviderView.

* Add flow to choose between a fixed list of account provider

* Update screenshots

* Fix licence header

* Rename preview.

* Ensure that the default account provider cannot be "*"
This should not happen IRL, but better be robust against issue in application configuration.

* Create const of any account provider value

* Fix typo

---------

Co-authored-by: ElementBot <android@element.io>
2025-05-23 18:36:48 +02:00
Benoit Marty
f20caebdcb Add support for login link (#4752)
* Add support for login link

https://mobile.element.io/element?account_provider=example.org&login_hint=mxid:@alice:example.org

* Update screenshots

* Reduce code duplication

* Add test on OnBoardingPresenter

* Fix tool

* Ignore login parameter if user is not allowed to connect to the provided server.

* Improve tests.

* Cleanup

* Revert change on Project.xml.

* Add documentation

* Improve LoginHelper

* Rename LoginFlow to LoginMode

Move LoginFlow to package io.element.android.features.login.impl.login
Rename some implementation of LoginMode
Rename LoginFlowView to LoginModeView

* Change launchMode of MainActivity from `singleTop` to `singleTask`

Using launchMode singleTask to avoid multiple instances of the Activity when the app is already open. This is important for incoming share and for opening the application from a mobile.element.io link.

Closes #4074

---------

Co-authored-by: ElementBot <android@element.io>
2025-05-21 18:19:42 +02:00
Benoit Marty
1a6596a89a Fix compilation issues. (#4750)
* Fix compilation issues.

* Fix compilation issues.
2025-05-20 13:12:01 +02:00
Benoit Marty
caf25894d6 Reduce API of JoinedRoom, caller must use the Timeline API from liveTimeline instead. (#4731)
This removes lots of boilerplate code.
2025-05-20 09:07:43 +02:00
Benoit Marty
c6f6c2cd65 Allow configuration to provide multiple account providers. (#4742)
* Allow several account provider in configuration

* Target latest private modules.

* Fix tests

* Target latest private modules.

* Trigger CI

* Fix formatting issue
2025-05-20 08:57:01 +02:00
Benoit Marty
6995e62548 Merge on boarding module to login module (#4746)
* Move onboarding code to the login module.

* Remove OnBoardingEntryPoint, move the flow to LoginFlowNode

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-05-20 08:54:23 +02:00
ElementBot
90f89b9088 Sync Strings (#4739)
* Sync Strings from Localazy

* Sync strings again

---------

Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2025-05-19 08:17:02 +00:00
Benoit Marty
98cfddce3f Check homeserver when login using qr code (#4708)
* Login with Qr code: check homeserver validity

* QrCode login, unauthorized homeserver: update copy.

* Update screenshots

* Add unit test on SdkQrCodeLoginData

* Remove default param value.

* Remember imageAnalysis

---------

Co-authored-by: ElementBot <android@element.io>
2025-05-15 14:08:05 +02:00
Jorge Martin Espinosa
44d77a6048 Remove event cache feature flag (#4719) 2025-05-15 09:42:18 +02:00
ganfra
1599e038d4 Merge pull request #4718 from element-hq/feature/fga/report_room_enabled_flow
Change (report room) : check if server supports the report room api
2025-05-14 17:25:17 +02:00
ganfra
405cd8e82d change (report room) : use client.isReportRoomApiSupported instead of hardcoded value 2025-05-14 11:07:17 +02:00
Jorge Martin Espinosa
141099ffb2 Fix generic mime type being uploaded when several files are externally shared with the app. (#4715)
i.e. `image/*` when sharing a png and jpg file.
2025-05-13 15:26:47 +00:00
Benoit Marty
b322a4bae5 Disable mutliple click (parallel or serial) on a room (#4683)
* Disable mutliple click (parallel or serial) on a room (Fixes #4619)

* Rename method from FirstThrottler

* Move check to the Compose and add unit test on it.
2025-05-13 14:12:19 +02:00
Benoit Marty
93499910ba Improve audio focus management (#4707)
* Extract Audio focus management to its own modules.

* Request Audio focus when playing a voice message.

* Add missing dependency.
(and remove a duplicated one)

* Request Audio focus when playing a video/audio in the media viewer.

* Pause audio when audio focus is lost.

* Rename class

* Fix tests

* Fix detekt issue.

* Audio focus: let the system handle automatic ducking when playing media.

* Document and update API

* Remove useless space.
2025-05-13 09:54:58 +00:00
Benoit Marty
857adf27b6 Disable Continue button when the login field is cleared. (#4699)
* Disable Continue button when the login field is cleared.
Fixes #4691

* Add tests on LoginPasswordView
2025-05-12 14:45:07 +02:00
ElementBot
bcfbd5ace4 Sync Strings from Localazy (#4703)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-05-12 09:56:19 +02:00
Benoit Marty
e8e75af506 Update "Learn more" link (#4686)
* Update target link for "Learn more".

* Rename VerifySelfSession* to OutgoingVerification*

* Optimize import

* Refactor to avoid long line

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-05-09 11:10:30 +02:00
Benoit Marty
0e74fe7062 Ensure that the Rust room is not closed while the driver needs it. (#4694) 2025-05-08 09:33:35 +02:00
renovate[bot]
62a1d1bcb9 fix(deps): update android.gradle.plugin to v8.10.0 (#4687)
* fix(deps): update android.gradle.plugin to v8.10.0

* Update lint version to 8.11.0-alpha09

* Fix lint false positive.

Error: Modifier factory functions must use the receiver Modifier instance [ModifierFactoryUnreferencedReceiver from androidx.compose.ui]

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2025-05-07 11:07:20 +02:00
Benoit Marty
93eb70bd83 Let EnterpriseService prevent usage of homeserver (#4682)
* Add check on homeserver url.

* Update screenshots

* Add missing test

* Update submodule link.

---------

Co-authored-by: ElementBot <android@element.io>
2025-05-06 17:25:07 +00:00
Benoit Marty
32916444e5 Fix read receipt behavior when the timeline is opened. (#4679)
* Use Timber instead of println

* Fix ReadReceipt not sent when new event is received:
- filter Virtual item regarding typing to compute NewEventState
- always scroll, since the latest event is always the typing notification (but with 0 height). This triggers the sending of RR.

* Improve the fix to fix regression detected by unit tests.

* Remove unnecessary parenthesis

* Document parameter.
2025-05-06 12:41:34 +00:00
Jorge Martin Espinosa
024aa49e60 Make sure any JoinedRustRoom is destroyed after use (#4678) 2025-05-05 16:09:07 +02:00
ElementBot
aab5104010 Sync Strings from Localazy (#4677)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-05-05 12:11:22 +02:00
ganfra
c2568f84d2 Feature : Report room (#4654)
* feature (report room) : introduce all presentation classes.

* feature (report room) : branch entry point in the room list

* refactor (matrix ui) : move some code from appnav to matrix ui

* feature (report room) : add api on room

* feature (report room) : adjust ui

* feature (report room) : branch api

* feature (decline invite and block) : move things around and introduce presentation classes

* feature (decline invite and block) : continue to move things

* feature (report room) : remove reference to "conversation" for now

* feature (report room) : add report room action to room detail screen

* feature (report room) : enabled button state

* feature (report room) : improve code and reuse

* feature (report room) : add feature flag

* feature (report room) : change feature flag to static bool

* feature (report room) : add tests

* feature (report room) : fix ui with new api on ListItem

* feature (report room) : clean up and add more tests.

* Update screenshots

* feature (report room) : more test and fix issue

* feature (report room) : update strings

* feature (report room) : fix konsist preview

* feature (report room) : disable feature

* Update screenshots

* var -> val

* Improve preview of AcceptDeclineInviteView

* Improve preview consistency

* Add missing test on DismissErrorAndHideContent

* Update screenshots

* Add missing tests

---------

Co-authored-by: ElementBot <android@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2025-05-02 12:25:19 +02:00
Benoit Marty
dbb54a444d Fix wrong member count in join room screen for invitation (#4651)
* Fix typo

* Fix number of room member not correct for room invitation.

* Remove unneeded annotation

* Rename test classes.

* Add test about number of room members

Fix other tests.

* Avoid multiple request to get the room preview.
2025-04-29 17:40:11 +02:00
Benoit Marty
1b98792500 Take change of screen_change_server_error_no_sliding_sync_message into account (#4650)
* Sync strings.

* screen_change_server_error_no_sliding_sync_message is now taking a parameter.

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-04-28 22:25:41 +02:00
ElementBot
76c59e2eac Sync Strings from Localazy (#4648)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-04-28 10:59:35 +02:00
Benoit Marty
8c64b842a5 Cleanup element call and UI (#4641)
* Use ElementTheme.colors.bgCanvasDefault instead of MaterialTheme.colorScheme.background

Even if the value is the same, we should use color from ElementTheme.

* Remove background management of ElementCallActivity. It does not work as expected and also changing theme during a call would require to load the url again with the new theme.

* Do not use isSystemInDarkTheme() directly.

* Use bgSubtleSecondary for background color of Preview.

* Use default colors for Preview.

* Fix copy paste issue.

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-04-25 17:30:54 +02:00
Benoit Marty
19f2e0e8c9 Render caller avatar on Incoming call screen (#4635)
* Ensure that the image loader is set, else the IncomingCallActivity will not be able to render the avatar.

Fixes #4633

* Add background color to OnboardingBackground

Fixes #4629

* Trigger CI
2025-04-24 21:32:46 +00:00
Benoit Marty
fc59df878f Accessibility: improve behavior of list items (#4626)
* a11y: add Modifier to improve accessibility of ListItems.

Remove duplication of onChange. As per the documentation, it has to be used only if the behavior is different than the onClick listener of the list item.
It also has the effect to read twice the action when the screen reader is one. See https://github.com/element-hq/element-x-android/pull/4047#discussion_r1888136571 for more details

a11y: remove contentDescription on List item icon, else the text is read twice.

* Ensure that if the ListItem is not enabled, the trailing/leading content is also not enabled.

* Update screenshots

* Fix lint crash.

---------

Co-authored-by: ElementBot <android@element.io>
2025-04-24 21:53:21 +02:00
Jorge Martin Espinosa
c537e94146 Split MatrixRoom into BaseRoom and JoinedRoom (#4561)
`JoinedRoom` will now contain both a mandatory live timeline reference and all the functionality associated to it.

`BaseRoom` on the other hand will contain only functionality that's shared for both joined and not joined rooms.

`NotJoinedRoom` is a wrapper around `RoomPreviewInfo` data and a possible local `BaseRoom`, if it exists.

The `RustRoomFactory` cache is now gone since the persistent event cache should have the same effect.
2025-04-23 15:53:40 +02:00
Benoit Marty
4486d5205c OIDC configuration (#4623)
* Login: more logs.

* Login: map Oidc error to provide more information in the error dialog.

* Oidc: use the application name.

* Oidc: move configuration from OidcConfigurationProvider to OidcConfig and add some comments.

* Oidc: limit to only 1 contact in the configuration.

* Oidc: Move configuration to BuildConfig file.

* Remove unused const.

* Add missing test on Exception mapping

* Remove contacts from OidcConfiguration.

https://github.com/matrix-org/matrix-rust-sdk/pull/4958
2025-04-23 11:58:38 +02:00
Benoit Marty
85a1edec64 Ensure that pinning an event makes the pinned messages banner appear (#4606) 2025-04-22 17:27:02 +02:00
Jorge Martin Espinosa
9a24906e88 Fix ringing calls not stopping when the other user cancels the call (#4613)
* Fix ringing calls not being automatically canceled

This will keep the sync active while the user is screening an incoming call, allowing receiving a call cancellation event, which will terminate the incoming call ringing early.

* Add extra logs to help debugging ringing call issues.
2025-04-22 11:30:10 +00:00
ElementBot
491eda9ba5 Sync Strings from Localazy (#4612)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-04-22 08:57:00 +02:00
Benoit Marty
e2e58749f5 [a11y] Make more items focusable (#4605)
* Fix settings entry point not available when there is no avatar on the account. Fixes #4599.

* Use Ktx extension `String.toUri()`

* Allow screen reader to focus on the user avatar to allow editing it.

* Fix import order
2025-04-22 08:50:50 +02:00
Benoit Marty
4c21f48661 Merge commit from fork
* Check validity of Element Call url host.

* Prepare release 25.04.2
2025-04-17 11:39:38 +02:00
Benoit Marty
5d3de494d7 Fix audio output selection for Element Call (#4602)
* Fix audio output selection.

* Ensure that Element Call audio output uses a new connected device, even during a call.
Also add a few logs.

* Extract functions.

* Add more log and protect from crash.

* Revert formatting change

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-04-17 10:36:42 +02:00
Jorge Martin Espinosa
a346faba08 Improve accessibility of the timeline (#4579)
* Make whole messages selectable and readable as a single unit when possible.
* Make most UI components not clickable when talkback is enabled.
* Make voice messages work with talkback too.
* Read grouped state events even if the events are collapsed.
* Move image and video item actions to the timeline item.
* Improve accessibility in the message context menu too
* Fix a11y issue on add attachment button.
* Add `contentDescription` to file icon so it's read aloud

---------

Co-authored-by: Benoit Marty <benoit@matrix.org>
2025-04-15 15:28:29 +00:00
ganfra
5552c85b2a Merge pull request #4581 from element-hq/feature/fga/advanced_settings_theme_rework
change (preferences) : use PreferenceDropdown for appearance
2025-04-14 15:19:48 +02:00
ElementBot
270b420575 Sync Strings (#4590)
* Sync Strings from Localazy

* Fix strings usage after some were moved

* Fix Norwegian string that was causing lint to fail

* Update screenshots

---------

Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2025-04-14 11:24:28 +02:00
Jorge Martin Espinosa
73b4ac8c12 Upgrade Rust bindings to v25.04.11 (#4580)
* Upgrade Rust bindings to `v25.04.11`

* Rename `mapMessageKind` back to `mapMessageType`

* Fix tests and fixtures
2025-04-11 18:22:16 +02:00
ganfra
dffdb15cf0 change (preferences) : use PreferenceDropdown for appearance (and add some tests) 2025-04-11 17:09:31 +02:00
Jorge Martin Espinosa
4dda027ed4 Use in-call volume and mode for EC, allow external audio devices (#4481)
* Use in-call volume and mode for EC:
* Try routing audio to external device
* Place speaker before earpiece in list of audio devices
2025-04-11 16:46:51 +02:00
Benoit Marty
dbb96c5212 Ensure that we have only one single instance of SeenInviteStore per session (#4577)
* Ensure that we have only one single instance of SeenInviteStore per session. Fixes #4558

Fix crash:
java.lang.IllegalStateException: There are multiple DataStores active for the same file: /data/user/0/io.element.android.x/files/datastore/session_0ebb139587b6d940_seen-invites.preferences_pb. You should either maintain your DataStore as a singleton or confirm that there is no two DataStore's active on the same file (by confirming that the scope is cancelled).

* Inject the SeenInvitesStore to reduce boilerplate code.
2025-04-11 13:37:44 +00:00
ganfra
ce0bac55c5 Merge pull request #4574 from element-hq/feature/fga/advanced_settings_moderation_and_safety
change (preferences) : new moderation and safety settings
2025-04-11 14:38:46 +02:00
ganfra
4982d933d8 change (preferences) : some more final tweaks after review. 2025-04-11 13:00:44 +02:00