Commit Graph

52 Commits

Author SHA1 Message Date
renovate[bot]
6d3b816bf5 Update dependency app.cash.molecule:molecule-runtime to v1 (#925)
* Update dependency app.cash.molecule:molecule-runtime to v1

* Replace `RecompositionClock` with `RecompositionMode`

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2023-07-20 07:36:19 +02:00
Benoit Marty
d6980025ca When clearing cache, also reset some data store in prefs/datastore. 2023-07-18 01:35:12 +02:00
ganfra
9846db6338 Rework a bit MatrixClientHolder and reintroduce cacheIndex... 2023-07-17 18:34:50 +02:00
Benoit Marty
50aa4946d9 Fix test. 2023-07-07 16:22:42 +02:00
Benoit Marty
be73fc7ba2 Fix Snackbar colors. 2023-07-07 15:39:43 +02:00
Benoit Marty
3e9396e27c Show Snackbar once the verification is finish in the correct screen (#812) 2023-07-07 15:34:15 +02:00
ganfra
b72313bc84 Nodes: rework RootFlowNode with cache service 2023-07-06 18:08:29 +02:00
Marco Romano
f33561c25d Revert "Auto generate dark mode previews and screenshots (#776)" (#784)
This reverts commit 79b529193c.
2023-07-05 15:47:53 +02:00
Marco Romano
79b529193c Auto generate dark mode previews and screenshots (#776)
With this change, composable previews and screenshots should be created with just:
```
@ElementPreviews
@Composable
fun MyViewPreview() {
    ElementPreview { 
        MyView()
    }
}
```

- Adds `@ElementPreviews` which is a shorthand for:
```
@Preview(name = "D")
@Preview(name = "N", uiMode = Configuration.UI_MODE_NIGHT_YES)
```
Should be used in connection with the now public `fun ElementPreview()` composable.

- Adds ElementPreviews to previewAnnotations in dangerfile
- Screenshots of night mode previews are now rendered with night mode
- Replaces `ElementPreviewLight` and `ElementThemedPreview` with `ElementPreview`
- Deprecates `ElementPreviewDark` which should be removed.
- Remaining usages of `ElementPreviewDark` are now ignored during screenshot tests
2023-07-05 13:58:24 +02:00
Benoit Marty
976ee893e2 Remove dead code. 2023-07-03 17:09:04 +02:00
Benoit Marty
1f455238d6 Replace CurrentUserProvider by an extension on MatrixClient. 2023-07-03 17:09:04 +02:00
Benoit Marty
bd879cb226 Use correct icon. 2023-07-03 17:09:04 +02:00
Benoit Marty
7f79cba40d Fix modifier issue. 2023-07-03 17:09:04 +02:00
Benoit Marty
996d362724 Fix test. 2023-07-03 17:09:04 +02:00
Benoit Marty
666e1f1cbc Move BuildMeta fake to common test module. 2023-07-03 17:09:04 +02:00
Benoit Marty
499a862bfc Add application version to the setting screen. 2023-07-03 17:09:04 +02:00
Benoit Marty
c02dd599d9 Disable rageshake by default. Can be enabled in the developed settings, but this is not available in the release version. 2023-07-03 17:09:04 +02:00
Benoit Marty
acec682dee Add "Complete verification" item in the root setting screen. 2023-07-03 17:09:04 +02:00
Benoit Marty
7b5d18aef4 Add quick test. 2023-07-03 17:09:04 +02:00
Benoit Marty
97c4d783d6 Open legals URL 2023-07-03 17:09:04 +02:00
Benoit Marty
6699462e06 Change hierarchy of settings. 2023-07-03 17:09:04 +02:00
Benoit Marty
002ddf4f3f Show current user in the settings and extract code in CurrentUserProvider. 2023-07-03 17:09:04 +02:00
Benoit Marty
189960eb28 Update some setting screens. 2023-07-03 17:09:04 +02:00
Benoit Marty
5f16297939 Merge branch 'develop' into feature/bma/removeOldResources 2023-06-27 16:09:30 +02:00
Benoit Marty
d782162f27 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
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
Benoit Marty
4cb9843415 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
287328f7df More cleanup 2023-06-27 09:51:33 +02:00
Benoit Marty
4a8c49fa28 Use CommonStrings everywhere 2023-06-27 09:45:00 +02:00
Benoit Marty
a226580c8c Move FileSizeFormatter to module :libraries:androidutils 2023-06-26 11:14:53 +02:00
Benoit Marty
f1019f3444 Move cache management to a dedicated class and in the setting module, for clarity. 2023-06-26 11:07:53 +02:00
Benoit Marty
b563b1ec95 Idx -> Index 2023-06-26 11:07:53 +02:00
Benoit Marty
6591fbec17 Use operator invoke. 2023-06-26 11:07:53 +02:00
Benoit Marty
231d4b1577 Fix compilation issue in Fake class. 2023-06-26 11:07:53 +02:00
Benoit Marty
0ee2861452 Clear cache: clear Coil and OkHttpClient cache. 2023-06-26 11:07:53 +02:00
Benoit Marty
58860a9440 Close the client before deleting data, and ensure the app is restarted, using a cache Index. 2023-06-26 11:07:22 +02:00
Benoit Marty
df4bc3d7ce Improve rendering of cache size (and fix compilation issue) 2023-06-26 11:07:22 +02:00
Benoit Marty
5d8adb25ae Display cache size in the developer settings (#643) 2023-06-26 11:06:36 +02:00
Benoit Marty
bf80c251aa Add clear cache action in the developer settings (#643) 2023-06-26 11:06:36 +02:00
Yoan Pintas
d2263372d2 Init analytics modules (#350) 2023-06-05 13:11:34 +00:00
Florian Renaud
c22d181d8c Remove useless OptIn in tests 2023-05-12 10:05:39 +02:00
Benoit Marty
f881bd849d Re-order parameters. 2023-05-05 11:49:27 +02:00
Benoit Marty
232ae32051 Avoid using hard-coded key, use ShowkaseBrowserActivity.getIntent() instead. 2023-05-04 17:31:08 +02:00
Benoit Marty
e8049f81a4 Move the button to open the Showkase browser to the developer settings screen. (#389) 2023-05-04 17:29:03 +02:00
Chris Smith
5c935818c6 Move and refactor MatrixUser (#381)
Move and refactor MatrixUser

Instead of living in matrixui and having an AvatarData, this can
reside in the matrix module and just have the URL. An extension
method in matrixui can then provide the AvatarData when required.

This removes some small duplication, and pushes the UI-specific
information (i.e., what size of avatar is going to be rendered)
further down the stack. It also aligns the field names with those
used by the rust SDK (e.g. "displayName" instead of "userName").
2023-05-03 16:30:19 +00:00
Jorge Martin Espinosa
921fb55220 Group design components in Showkase for the Compound team (#375)
* Screenshot tests changes:

    - Group components for Showkase.
    - Set special Paparazzi config for scrolling screens using non null `Preview.heightDp`.
    - Add merged theme preview with `ElementThemedPreview` component.
2023-05-02 16:13:35 +00:00
ganfra
f98fe8e52c Merge pull request #334 from vector-im/feature/fga/feature_flag
Feature/fga/feature flag
2023-04-18 15:24:04 +02:00
ganfra
82c9ee9982 [FeatureFlag] add more tests 2023-04-18 12:05:29 +02:00
ganfra
279185b175 FeatureFlag: first implementation 2023-04-17 19:44:29 +02:00
Jorge Martin Espinosa
afd58f1634 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