Commit Graph

64 Commits

Author SHA1 Message Date
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
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
97fb7bc2fa Let AsyncAction.Confirming be an interface, with a AsyncAction.ConfirmingNoParams data object.
This will allow inheritance of `AsyncAction.Confirming` with parameter(s).
2024-10-14 10:49:55 +02: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
Benoit Marty
059c0dfe59 Fix back navigation issue, when opening directly the notification troubleshoot screen. 2024-06-17 16:53:21 +02:00
Benoit Marty
f24036d688 Ensure that the Loading Dialog and the toggles update at the same time. 2024-06-12 12:50:55 +02:00
Benoit Marty
306b779ca5 Change type of NotificationSettingsState.currentPushDistributor from AsyncAction to AsyncData 2024-05-28 14:18:00 +02:00
Benoit Marty
e64051f7bd Improve code and display error. 2024-05-21 14:45:16 +02:00
Benoit Marty
08765691d2 Period 2024-05-01 19:35:16 +02:00
Benoit Marty
981c19ab33 Fix navigation issue #2778 2024-05-01 13:50:53 +02:00
Jorge Martin Espinosa
d8f9408cdb Room member moderation: kick, ban and unban (#2496)
* Room member moderation: kick, ban and unban

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2024-03-06 16:44:05 +01:00
Benoit Marty
a926b3d390 Merge branch 'develop' into feature/bma/sxcludePreviewFromCodeCoverage 2024-01-11 16:02:58 +01:00
Benoit Marty
d3830af78b Fix ktlint issues 2024-01-10 19:33:39 +01:00
Benoit Marty
3084d71c39 Ignore ktlint issue for this particular val. 2024-01-10 19:31:36 +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
7fbe848243 Exclude ContentToPreview from coverage, either by using annotation @ExcludeFromCoverage, or by inlining it. 2024-01-09 17:56:01 +01:00
Benoit Marty
bd91dd64e2 Rename Async to AsyncData 2024-01-04 16:30:56 +01:00
Benoit Marty
da23628c8a Introduce AsyncAction with a Confirmation state and use it for logout action. 2024-01-04 15:56:16 +01:00
ganfra
9f045fc7de Fix detekt 2023-12-19 12:59:13 +01:00
ganfra
280d55bd6e BackstackParentNode now become BaseFlowNode and adds Overlay navModel into it. 2023-12-19 12:55:14 +01:00
ganfra
b6ef4cdab2 Add Overlay navModel and related classes 2023-12-19 12:54:09 +01:00
Marco Romano
c69d610b6c Rename params in NodeFactories for clarity (#1916)
- `context` is now `buildContext` to reflect that it's of type `BuildContext` (and not an android `Context`).
- `NODE` generic type param is now `N` to stick with Java convention: https://docs.oracle.com/javase/tutorial/java/generics/types.html.
2023-11-29 10:01:07 +01:00
Marco Romano
e59a6b7ed6 Add missing screenshots in TimelineView (#1660)
Add audio, voice  and poll screenshots to TimelineView which were missing.
2023-10-27 12:18:28 +00:00
Jorge Martin Espinosa
5e547269e7 Integrate Element Call with widget API (#1581)
* Integrate Element Call with widget API.

- Add `appconfig` module and extract constants that can be overridden in forks there.
- Add an Element Call feature flag, disabled by default.
- Refactor the whole `ElementCallActivity`, move most logic out of it.
- Integrate with the Rust Widget Driver API (note the Rust SDK version used in this PR lacks some needed changes to make the calls actually work).
- Handle calls differently based on `CallType`.
- Add UI to create/join a call.

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-10-19 15:38:43 +00:00
ganfra
2c80eee840 Appyx : quick management of PermanentChild 2023-10-06 11:44:09 +02:00
Benoit Marty
52853101d9 migrate object to data object (#1135) 2023-08-24 09:32:44 +02:00
Benoit Marty
140271069c Enable detekt rule TooGenericExceptionThrown and fix existing issue. 2023-07-26 10:40:41 +02:00
Benoit Marty
7ea2f28d96 More log about Node lifecycle. Will help to track user navigation. 2023-07-12 12:01:54 +02:00
ganfra
b72313bc84 Nodes: rework RootFlowNode with cache service 2023-07-06 18:08:29 +02:00
Marco Romano
2a82e1b4e4 Async API improvements "v2" (#672)
* Async API improvements "v2"

**NB: This PR actually changes only 3 files in `libraries/architecture/`. All the other changes are automated refactors to fix the calling code.**

This is a proposal for improvements to our `Async` type as discussed in: https://github.com/vector-im/element-x-android/pull/598/files#r1230664392 and in other chats.

Please bear in mind it is just a proposal, I'd love to hear your feedback about it, especially when it comes to naming: I've tried to make parameter and function names use a terminology similar to what we find in the Kotlin stdlib and its `Result` type.

I'm inclined to like more the non-extension flavours of the new `run*` APIs, though I'd also like your feedback about what API shape you prefer.

### Summary of the changes:
#### Functional
- Adds `exceptionOrNull()` API to complement the existing `dataOrNull()` API.
- Adds `isFailure()`, `isLoading()`, `isSuccess()` and `isUninitialized()` courtesy APIs.
- Renames `executeResult()` to `runUpdatingState()`:
	- Becomes the base API to which all the other similarly named APIs call into.
	- Makes it inline.
	- Adds contract.
	- Passes over any `prevData` to newre Async states.
	- Passes through the `block`s return value.
	- Adds unit tests.
- Renames `execute` to `runCatchingUpdatingState()` and makes it just call into `runUpdatingState()`
- Adds extension function overloads to the `run*` functions to accept `MutableState` as receiver

#### Cosmetics
- Reorders classes and methods in alphabetic order.
- Reorder parameter names to mimic conventions in Kotlin stdlib.
- Adds docstrings where useful.

* Use `fold()`

* rename pop to popFirst

* Add docstrings

* Please Detekt

* Rename exception to error.

* Please detekt

* Update existing usages.
2023-06-27 13:37:23 +02:00
Marco Romano
924103521f Inline Async extension functions (#598)
Just a tiny perf improvement.
2023-06-15 12:53:11 +02:00
Benoit Marty
4d8aaecf67 Add comment. 2023-06-01 17:58:12 +02:00
ganfra
b0152059ff Room : continue improving members loading 2023-04-21 14:39:47 +02:00
ganfra
a166636060 Add some tests on RoomFlowNode 2023-04-14 15:34:41 +02:00
Jorge Martin Espinosa
d7a6779343 [Room member list] Display room member list (#276)
* Implement room member list

* Move timeline initialization back to `TimelinePresenter`.

* Fix crash when the `innerRoom` inside a `RustMatrixRoom` is destroyed but `syncUpdateFlow` is still running.

* Address review comments
2023-04-04 16:07:57 +00:00
Jorge Martin Espinosa
f94d2b6c60 Handle 'invalid server' error in server selection screen properly. (#214)
* Handle 'invalid server' error in server selection screen properly.

* Use `action_learn_more` for composing the server location footer action.
2023-03-21 09:34:14 +01:00
ganfra
399bfdc5e6 Add small comments 2023-03-09 17:54:35 +01:00
ganfra
b2c68d555a [Architecture] introduce nodeBuilder concept 2023-03-07 20:31:16 +01:00
ganfra
43b304e523 Try splitting messages into api and impl modules 2023-03-03 14:38:05 +01:00
ganfra
c581f0b383 [Architecture] introduce BackstackNode 2023-03-02 17:55:26 +01:00
ganfra
15ed58b756 [Architecture] use FeatureEntryPoint on Preferences 2023-03-02 15:59:25 +01:00
ganfra
da92113e43 [Architecture] Introduce EntryPoint and use createNode for ParentNode too 2023-03-02 12:33:18 +01:00
Benoit Marty
0b6d7b0bc5 Add test for ChangeServerPresenter 2023-02-07 16:57:33 +01:00
ganfra
bfb508ba1d Remove PresenterConnector and molecule runtime in feature modules, directly call Presenter.present method 2023-02-01 15:56:07 +01:00
Benoit Marty
15700062c7 Rename function (code review) 2023-01-25 11:14:50 +01:00
Benoit Marty
7e2fd638e4 Animation between screens 2023-01-24 17:24:40 +01:00
ganfra
c6cfe2b5e2 Rename di module 2023-01-20 17:12:40 +01:00
ganfra
528c01199d Rename architecture module 2023-01-20 16:26:43 +01:00
ganfra
bdcfe98aab Changes after review 2023-01-19 15:26:06 +01:00
ganfra
3a6be5f745 Merge branch 'develop' into feature/fga/presenter_tests 2023-01-18 20:47:15 +01:00