Commit graph

53 commits

Author SHA1 Message Date
Benoit Marty
aadc6d68d8 Merge branch 'develop' into feature/bma/removeOldResources 2023-06-27 16:09:30 +02:00
Benoit Marty
c33a08b602 Merge pull request #684 from vector-im/feature/bma/stringR
Quick PR to introduce `CommonStrings` type alias
2023-06-27 16:00:31 +02:00
Marco Romano
316d57d1b6 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
Benoit Marty
659b9d3d9c Now that the composer as been removed, we do not need element resource module anymore. 2023-06-27 13:34:55 +02:00
Benoit Marty
798da50454 Use CommonStrings everywhere 2023-06-27 09:45:00 +02:00
bmarty
874739ece9 Sync Strings from Localazy 2023-06-26 00:10:53 +00:00
github-actions[bot]
fe5524bae4 Sync Strings (#630)
* Sync Strings from Localazy

* Update strings, remove broken German translation

* Update screenshots

---------

Co-authored-by: bmarty <bmarty@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-06-19 11:18:01 +00:00
Benoit Marty
9b4b9e9140 Introduce simulateLongTask to ensure that the Presenter State Loading is visible.
Also do some cleanup on the tests.
2023-06-15 10:57:05 +02:00
bmarty
175b7deccb Sync Strings from Localazy 2023-05-29 00:09:47 +00:00
Florian Renaud
719dd20555 Remove useless OptIn in tests 2023-05-12 10:05:39 +02:00
bmarty
f54b4e9f7e Sync Strings from Localazy 2023-05-08 00:08:48 +00:00
Chris Smith
6165e60e53 Make danger check view changes (#391)
Make danger check view changes

Add a check that if a file with @Preview or @LargeHeightPreview
in it is changed, then the corresponding build file includes
the showkase processor.

Also change the check that prompts about screenshots to use
the same @Preview logic instead of checking for "/layout" in
the path which doesn't work with compose.

Also add missing showkase processors
2023-05-05 08:24:12 +00:00
Jorge Martin Espinosa
014c0f4186 [Media upload] Add media pickers to the Room screen and the composer (#380)
* Add media pickers to the Room screen and the composer.

* Fix exclude rules for translations
2023-05-04 11:51:03 +02:00
bmarty
860777d20c Sync Strings from Localazy 2023-04-24 00:09:54 +00:00
Jorge Martin Espinosa
de010545fb Update Gradle to 8.1 and AGP to v8.0 (#329)
* Update AGP to 8.0.0.

* Set JAVA_HOME to JDK17

* Update lint version.

* Use right JDK for dependency analysis, replace deprecated env var.

* Upgrade to Gradle 8.1.

* Remove `@Supress(DSL_SCOPE_VIOLATION)` as it's no longer needed.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-17 08:49:52 +00:00
Benoit Marty
85b825e669 Ensure ellipsis char is used (fix lint issue). 2023-04-05 11:44:55 +02:00
Benoit Marty
cca31af3f4 Invoke ./tools/localazy/downloadStrings.sh --all 2023-04-05 11:11:47 +02:00
Benoit Marty
998178b70f [Strings] Use strings from localazy. 2023-03-27 14:44:24 +02:00
Benoit Marty
0af5ee0741 [Strings] Sync the strings. 2023-03-27 14:36:46 +02:00
Jorge Martin Espinosa
dcb98f06aa Add Session Verification flow (#197) 2023-03-17 10:07:19 +01:00
ganfra
bc9f3b69cc [Architecture] split all feature modules to api/impl 2023-03-08 16:13:45 +01:00
ganfra
7f3679a15e Merge branch 'develop' into feature/fga/improve_node_architecture 2023-03-07 12:10:20 +01:00
ganfra
91863e2529 [Architecture] introduce BackstackNode 2023-03-02 17:55:26 +01:00
Benoit Marty
466579c4d3 Move class of matrix.api module to api sub package. 2023-03-02 17:32:47 +01:00
Benoit Marty
c2dff7888c Move module matrixtest to matrix.test 2023-03-02 17:19:58 +01:00
Benoit Marty
b8467e547c Split module matrix to matrix.api with interfaces and data classes and matrix.impl with Rust implementation. 2023-03-02 17:12:13 +01:00
Jorge Martin Espinosa
6677f80abe Store session data in a secure way (#98)
* Replace SessionData DataStore with an encrypted SQLite DB.

---------

Co-authored-by: Benoit Marty <benoit@matrix.org>
2023-03-02 16:48:54 +01:00
Benoit Marty
6bb01d640f Make @Preview internal.
And exclude class generated by Showkase
2023-02-14 17:03:02 +01:00
Benoit Marty
e120ca7163 Extract Provider (and rename them) to their own file and move fixture(s) there. 2023-02-14 17:03:02 +01:00
Benoit Marty
0f0c001c3c Enforce no default value in state. 2023-02-14 17:03:02 +01:00
Benoit Marty
3142b884c5 Move test data to TestData.kt 2023-02-09 18:41:58 +01:00
Benoit Marty
606cd3efc3 Cleanup and centralize test data. 2023-02-09 17:44:20 +01:00
Benoit Marty
58c59efebf Add test for LogoutPreferencePresenter 2023-02-07 17:47:38 +01:00
Benoit Marty
9d32b05fbb Rework Preview for a better rendering in the IDE. 2023-02-03 12:56:53 +01:00
ganfra
87d0191324 Change/move some gradle modules to be better separated. Let core module be a kotlin lib. 2023-01-24 17:38:57 +01:00
ganfra
dd00f99f0c enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") 2023-01-20 19:13:44 +01:00
ganfra
5748bc53a6 Finish removing x. from packages (keep it in app module for now) 2023-01-20 18:52:59 +01:00
ganfra
e616d75d9d Rename all features modules 2023-01-20 18:35:03 +01:00
ganfra
caa04aa485 Rename uistrings module 2023-01-20 17:42:09 +01:00
ganfra
907d7eba75 Rename matrix modules 2023-01-20 17:27:47 +01:00
ganfra
a2f0c64921 Rename designsystem module 2023-01-20 17:09:12 +01:00
ganfra
bc9b8e6b90 Rename architecture module 2023-01-20 16:26:43 +01:00
Benoit Marty
948d4f64f7 Do not use theme in the Preview, it breaks the screenshots building. 2023-01-18 15:29:07 +01:00
Benoit Marty
862900ed9a Rename folders java to kotlin 2023-01-18 13:51:30 +01:00
Benoit Marty
468d3f6192 Create dedicated modules for Strings and apply the plugin com.likethesalad.stem
Remove translations
2023-01-18 11:54:02 +01:00
ganfra
55d6ca566f Apply ktlint format 2023-01-13 18:37:28 +01:00
ganfra
f95b3b5d79 Add copyright on new files 2023-01-13 18:36:16 +01:00
ganfra
ad7bf21f6d Use EventSink lambda in state instead of Flow in Presenter 2023-01-11 15:53:52 +01:00
ganfra
ae273bd4ea Migrate Preferences to new architecture 2023-01-09 19:27:28 +01:00
ganfra
9e211b5e04 Merge branch 'develop' into feature/fga/navigation First step: makes it compile by disabling the new screens (need to migrate to nodes) 2023-01-06 19:22:52 +01:00