Commit graph

18 commits

Author SHA1 Message Date
Marco Romano
3449ea486a Optional day night preview annotation (#793)
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,
        )
    }
}
```
2023-07-06 12:35:54 +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
Chris Smith
ca1df5829f Danger: remove "add screenshots" warning (#691)
We have screenshot tests that basically negate the need for this,
and when we're doing more complicated things we tend to use
videos anyway which aren't caught by this check.
2023-06-27 15:37:44 +02:00
Chris Smith
5de90c3871 Danger: don't complain about reviewers (#509)
Now we have a CODEOWNERS file a reviewer is assigned automatically,
so there's no need for this.

It also misfires a bunch (maybe if there are no _pending_ reviewers
because they've already reviewed?), so removing it fixes that noise.
2023-06-01 14:02:28 +00:00
Jorge Martín
9efbe52c0d Remove duplicate issue reporting by Danger 2023-06-01 11:04:52 +02:00
Chris Smith
6165e60e53 Make danger check view changes (#391)
Make danger check view changes

Add a check that if a file with @Preview or @LargeHeightPreview
in it is changed, then the corresponding build file includes
the showkase processor.

Also change the check that prompts about screenshots to use
the same @Preview logic instead of checking for "/layout" in
the path which doesn't work with compose.

Also add missing showkase processors
2023-05-05 08:24:12 +00:00
Chris Smith
e5912edfb5 Add Marco to dangerfile (#388) 2023-05-04 12:39:40 +00:00
Benoit Marty
edb5695e24 Merge pull request #179 from vector-im/michaelk/danger_check_github_org
Attempt to check org/group membership before danger complains about signoff.
2023-04-18 10:49:46 +02:00
Michael Kaye
fc0373d1e5 Check for team membership, not org membership 2023-04-04 12:57:43 +01:00
Michael Kaye
15d8980214 Fix 2023-04-04 12:48:54 +01:00
Jorge Martín
ebbc4e1569 Add Chris to the team in the Dangerfile, remove some former colleagues 😢 2023-04-03 16:15:13 +02:00
Jorge Martin Espinosa
93a77d94c1 Try to improve Danger rule for PNGs to ignore screenshots (#234) 2023-03-20 15:09:50 +01:00
Michael Kaye
9df1359f61 Attempt to check public org membership before complaining about signoff. 2023-03-13 14:30:41 +00:00
Benoit Marty
bf6bf9a739 white list renovate, so that the tool does not need to sign-off. 2023-03-07 11:28:52 +01:00
Benoit Marty
cf832ffef4 Allow user github-actions[bot] to update translations.
Check that new strings are not added to `values/strings.xml`
Signoff not required for "github-actions[bot]" user.
2023-01-19 11:13:48 +01:00
Benoit Marty
b2719bc3bc Setup towncrier 2023-01-11 14:57:14 +01:00
Benoit Marty
d7a7e16712 Add quality workflow and Danger files. 2022-12-09 12:06:37 +01:00