Both `NotifiableEventResolver` and `DefaultNotificationDrawerManager` were creating new Rust SDK Clients while processing notifications instead of reusing the already existing one.
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>
* Add 'reply to' UI to the message composer.
* Move the `BlurHashAsyncImage` to `:libraries:designsystem` as it is now used in several modules.
* Create reusable `AttachmentThumbnail` and associated data classes and enums, it's now added to `:libraries:matrixui`.
* Re-use `AttachmentThumbnail` in a `ActionListView` and `TextComposer`.
* Add 'inReplyTo' models and UI.
* Add min size for images
* Create a separate layout for media items with no reply to info. Also, separate `Timeline__Row` components from `TimelineView`, as it was getting too large.
* Added `EqualWidthColumn` to use inside message bubbles. Also fixed some modifiers for media items replying to other messages.
* Disable `inReplyToClicked`.
* Remove unused resources and libraries.
* Remove any traces of `BlurHashAsyncImage` in `:features:messages`, since it was moved to the design system.
---------
Co-authored-by: ElementBot <benoitm+elementbot@element.io>
Use member count instead of counting members
For the room details screen, use the member count as supplied by
matrix instead of waiting for the entire member list to be
retrieved and then manually adding up all the relevant users.
This removes the loading state of the member count, relying on
a spinner on the member list itself if the user actually wants
to see the members. (The performance of that will be improved
separately on the rust side in the future)
Closes#505
- Make the checkbox non-clickable (the parent handles the clicks,
and this stops the m3 lib padding it out to be a sensible touch
target)
- Align and spread the text properly
- Change the default avatar size to match designs
- Add the edit action in the room details
- Add "Add topic" button in room details
- Add the screen behind that action to edit some room properties: avatar, name, topic
- Handle the save button action
- enable the button only if changes are detected
- display a loader "updating room"
- display an error dialog if any request has failed
- Check user has the right power level to change various attributes
- "Add topic" is only shown if there's no topic and they are able to set on
- Edit menu is only shown if they can change topic, name or avatar
- On the edit page, any fields they can't change are uneditable
Co-authored-by: Chris Smith <csmith@lunarian.uk>
If there are enough selected users that they can't all be displayed,
add extra padding in between the users to ensure that the last
visible one is half visible to provide some scroll affordance.
IconButton makes assumptions about the size of icons, which
we're not abiding by here. That makes it semeingly impossible
to properly center our icon. Instead, rewrite it as a surface
to ensure it's laid out properly