Skip to content

Conversation

@hmzgtl16
Copy link

What I have done and why

I have replaced the custom preview annotations used in the nowinandroid repository with the official, standardized alternatives from the $\text{androidx.compose.ui.tooling.preview}$ library.

This work was executed in two main steps:

  1. Replaced $\text{ThemePreviews}$ with $\text{@PreviewLightDark}$: The custom annotation for showing a Composable in light and dark mode was replaced by the official $\text{@PreviewLightDark}$. This allowed for the removal of the custom $\text{ThemePreviews}$ definition file, simplifying the code.
  2. Replaced $\text{DevicePreviews}$ with $\text{@PreviewScreenSizes}$: The custom annotation for displaying a Composable across different screen sizes was replaced by the official $\text{@PreviewScreenSizes}$. This standardized the way we check for responsive UI behavior and allowed for the removal of the outdated $\text{DevicePreviews}$ definition file.

All corresponding custom utility files were removed following these replacements, resulting in a cleaner and more maintainable preview setup.

Related issues/PRs:

1923

This replaces the custom `ThemePreviews` annotation with the official `PreviewLightDark` from Compose UI Tooling.
…features and remove outdated `DevicePreviews`.
@hmzgtl16 hmzgtl16 requested a review from dturner as a code owner November 22, 2025 19:22
@hmzgtl16 hmzgtl16 changed the title Replace Custom Preview Annotations with Official Tooling ($\text{@PreviewLightDark}$ and $\text{@PreviewScreenSizes}$) Replace Custom Preview Annotations with Official Tooling@PreviewLightDark and @PreviewScreenSizes Nov 22, 2025
@hmzgtl16 hmzgtl16 changed the title Replace Custom Preview Annotations with Official Tooling@PreviewLightDark and @PreviewScreenSizes Replace Custom Preview Annotations with Official Tooling @PreviewLightDark and @PreviewScreenSizes Nov 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant