Commit graph

115 commits

Author SHA1 Message Date
Benoit Marty
072b59e06b Use a val for the StateFlow, and expose a StateFlow. 2023-07-06 17:25:02 +02:00
Benoit Marty
9dc8633b7b Update tests 2023-07-06 12:01:38 +02:00
Benoit Marty
9a7111cba1 Show the "You're in" screen 2023-07-06 11:48:06 +02:00
Benoit Marty
0b0abbb6b6 Add You're in screen (UI)
tom
2023-07-06 11:48:06 +02:00
Benoit Marty
23d1c0ef44 Iterate on this image, the rendering was not perfect. 2023-07-06 11:48:06 +02:00
Benoit Marty
8f6d351054 Waitlist screen 2023-07-05 15:57:39 +02:00
Benoit Marty
dabd38e1b5 Sync strings. 2023-07-05 15:53:28 +02:00
Marco Romano
ca695ca077 Revert "Auto generate dark mode previews and screenshots (#776)" (#784)
This reverts commit fd467c2451.
2023-07-05 15:47:53 +02:00
Marco Romano
fd467c2451 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
bmarty
6e54ed7b77 Sync Strings from Localazy 2023-07-03 00:11:17 +00:00
renovate[bot]
d6780b1107 Update kotlin 2023-06-28 22:23:44 +00:00
Jorge Martin Espinosa
683b0b3594 Link Compound's TypographyTokens to ElementTheme. (#700)
* Link Compound's `TypographyTokens` to `ElementTheme`.

Also add some docs about when we should use each set of tokens.

* Renamed `LocalColors` to `LocalLegacyColors`.

Made both `LocalLegacyColors` and `LocalCompoundColors` internal. This means it will need to always be used through `ElementTheme.`

Also, removed any usages of `LocalColors.current` accross the project, they're now used through `ElementTheme.legacyColors`.
2023-06-28 08:53:20 +00:00
Jorge Martin Espinosa
a16335b4b7 [Compound] Integrate compound tokens (#586)
* Added tokens.

* Apply color to MaterialTheme, also add typography.

* Map colors to the right ones in the themes.

* Create and improve previews of some components

* More preview improvements

* Add `tertiary` and `onTertiary` colors, remove some unused ones.

* Fix usage of deleted color token

* Fix bug in Switch previews

* Create a separate `:libraries:theme` module to keep everything related to colors, typography and Compound in general.

* Fix `DatePickerPreview`

* Add missing Compound generated files by fixing their package name

* Move `ElementTheme` to the `:libraries:theme` module, make some variables internal.

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-06-27 16:15:40 +00:00
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
Jorge Martin Espinosa
cf2723ac7f [Message Actions] Copy events to clipboard (#665)
* Add `Copy` action for text events

* Remove 'Copy' action from the list for non-text events

* Use `@ContributesBinding` to inject `AndroidClipboardHelper`.
2023-06-23 14:39:07 +00:00
Jorge Martin Espinosa
42827206b3 [Message Actions] Forward messages (#635)
* Add forwarding messages base

* Make forwarding single-selection

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-06-22 13:27:59 +02:00
Benoit Marty
f38f1487c5 Merge pull request #626 from vector-im/feature/bma/sonar
Sonar
2023-06-21 10:41:26 +02: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
2452d8aa91 Fix the 6 issues reported by Sonar. 2023-06-16 18:08:20 +02:00
Benoit Marty
b9ec124af4 Move extension openUrlInChromeCustomTab to :androidutils module. 2023-06-16 10:32:28 +02:00
Benoit Marty
9e73e70a22 Enforce usage of TestScope.testScheduler 2023-06-12 19:49:56 +02:00
Benoit Marty
456e17de34 Fix infinite tests. 2023-06-12 18:51:17 +02:00
Benoit Marty
f7b20e2373 Let HomeserverResolver emit the List and not the Async. 2023-06-12 18:50:55 +02:00
Benoit Marty
5ce57ae951 Improve accessibility with keyboard. 2023-06-09 18:45:32 +02:00
Benoit Marty
9d00c9e120 Reduce space above the result to give more visibility especially when the keyboard is opened. 2023-06-09 18:36:10 +02:00
Benoit Marty
168f5dfa89 Add a 5s timeout to avoid infinite loading (actually waiting for network timeout which can be long and is harder to configure). 2023-06-09 18:34:00 +02:00
Benoit Marty
25eb3a556b Use a LazyColumn, in case we get more results in the future. 2023-06-09 18:30:44 +02:00
Benoit Marty
445df09411 Always use import io.element.android.libraries.ui.strings.R as StringR 2023-06-09 18:19:00 +02:00
Benoit Marty
4f4d024a9f No need to pass maxLines = 1 if singleline = true anymore. 2023-06-09 18:16:23 +02:00
Benoit Marty
9527c6825e Use the search icon on this screen. 2023-06-09 18:10:59 +02:00
Benoit Marty
921a352947 Inline the scroll state. 2023-06-09 18:09:09 +02:00
Benoit Marty
7948f8d0fa Better comment 2023-06-09 18:06:29 +02:00
Benoit Marty
5d3199e31c Move the resolver to the parent package. 2023-06-09 18:05:08 +02:00
Benoit Marty
0b18fceb39 Use LaunchedEffect to avoid multiple calls. 2023-06-09 17:58:36 +02:00
Benoit Marty
f311641ab3 Merge the 2 map. 2023-06-09 17:55:09 +02:00
Benoit Marty
ee38aee147 Rename InlineErrorMessage to simple Error to not consider how the error will be used (actually used in a dialog now) 2023-06-09 17:51:42 +02:00
Benoit Marty
5bec246034 Use function ref. 2023-06-09 17:45:51 +02:00
Benoit Marty
9562600be4 Enforce lambda parameters to be passed in. 2023-06-09 17:43:34 +02:00
Benoit Marty
fee86b281e Rename nodes and organize by package into screens subpackage for clarity 2023-06-09 17:38:04 +02:00
Benoit Marty
b72cf1dcdd Update strings. 2023-06-09 16:34:22 +02:00
Benoit Marty
4266faa204 Update maestro test regarding the new login flow. 2023-06-09 10:19:49 +02:00
Benoit Marty
d703eb05ec Format 2023-06-09 10:19:49 +02:00
Benoit Marty
563f8d3403 Add tests. 2023-06-08 22:56:36 +02:00
Benoit Marty
319d74b12b Rework HomeserverResolver 2023-06-08 22:04:12 +02:00
Benoit Marty
097b16d4b1 Rename file 2023-06-08 18:20:26 +02:00