Adds the `@DayNightPreviews` annotation that when used on a composable will:
- Display both a day mode and night mode preview in Android Studio.
- Produce both a day and night screenshot during screenshot testing.
The usage of this new annotation is optional, all the current previews continue to work without breakages.
New code can use, when appropriate, the new `@DayNightPreviews` annotation and replace the pattern using three `LightPreview/DarkPreview/ContentToPreview` functions with:
```
@DayNightPreviews@Composable
fun MyScreenPreview(@PreviewParameter(MyStateProvider::class) state: MyState) {
ElementPreview {
MyScreen(
state = state,
)
}
}
```
* Fix actions for redacted, not sent and media messages
* Make `EventDebugInfoView` sections fill max width
* Don't display action list if there are no actions to display
---------
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