* First attempt at implementing encrypted history banner and removing old UTDs
* Get the right behavior in the timeline
* Implement the designs
* Extract post-processing logic, add tests
* Add encryption banner to timeline screenshots
* Create FTUE feature to handle welcome screen and analytics
* Move classes to their own packages, add tests for `DefaultFtueState`.
* Remove unnecessary private MutableStateFlow
* Move some FTUE related methods and classes back to the `impl` module
* Handle back press at each FTUE step
* Remove unneeded `TestScope` receiver for `createState` in tests.
* Use light & dark previews for the banner view.
* Move color customization from `TextStyle` to `Text` component.
* Rename `InfoList` design components, use them in `AnalyticsOptInView` too.
* Cleanup MatrixClient.
* Fix copy&paste error
Co-authored-by: Benoit Marty <benoit@matrix.org>
* Fix typo
* Fix Maestro tests
---------
Co-authored-by: ElementBot <benoitm+elementbot@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
* Use outlined textfields in the login screen
* Fix enabled status
* Fix loading state for button in `ConfirmAccountProviderView` too
* Update subtitle string
* Remove no longer used translation
---------
Co-authored-by: ElementBot <benoitm+elementbot@element.io>
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
* 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`.
* 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>
* 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.
* Add `Copy` action for text events
* Remove 'Copy' action from the list for non-text events
* Use `@ContributesBinding` to inject `AndroidClipboardHelper`.