[FR]: Replace custom preview annotations with androidx.compose.ui.tooling.preview alternatives
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 50/100
Research direction
Start by reading core/designsystem/ThemePreviews.kt and core/ui/DevicePreviews.kt, then locate their usages across the project. Replace those usages with PreviewLightDark and PreviewScreenSizes from androidx.compose.ui.tooling.preview, remove the two custom annotation files, and verify that the project builds and previews still cover the intended themes and screen sizes.
Written by the indexing model from the issue text.
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the problem
The current nowinandroid project uses custom annotations for previews that replicate functionality already available in the Jetpack Compose tooling library:
-
com.google.samples.apps.nowinandroid.core.designsystem.ThemePreviewsfor showing light and dark themes. -
com.google.samples.apps.nowinandroid.core.ui.DevicePreviewsfor showing different device sizes.
This introduces boilerplate code and maintenance overhead for a feature that is now officially supported by the Compose library itself.
Describe the solution
Replace the custom annotations with the standard androidx.compose.ui.tooling.preview alternatives:
- Replace
ThemePreviewswithPreviewLightDark:
PreviewLightDarkfromandroidx.compose.ui.tooling.previewprovides a cleaner, built-in way to render composables in both light and dark themes. This would allow for the removal of theThemePreviews.ktfile. - Replace
DevicePreviewswithPreviewScreenSizes:
PreviewScreenSizesfromandroidx.compose.ui.tooling.previewoffers a direct and idiomatic way to display a composable across a range of screen sizes. This would allow for the removal of theDevicePreviews.ktfile.
Additional context
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
- Dominant language
- Kotlin
- Stars
- 22.1k
- Forks
- 4.7k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from android/nowinandroid
-
[Bug]: Search empty-state copy reads "explorer" instead of "explore"Possibly taken @Amir-yazdanmanesh claimed this 168 days ago. Openbug
Difficulty 1/5 Under an hour Newbie friendliness 84/100
android/nowinandroid#2127 ·
-
[Documentation]: Grammar error in SyncInitializer commentPossibly taken @sahilpatel2521 claimed this 185 days ago. Opendocumentation
Difficulty 1/5 Under an hour Newbie friendliness 92/100
android/nowinandroid#2121 ·
-
[FR]: Move TopicScreen user-facing strings to resourcesPossibly taken @ois0886 claimed this 189 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
android/nowinandroid#2115 ·
-
[Bug]: Interests top-level nav label sources string from feature/search instead of feature/interestsPossibly taken @Noahs212 claimed this 193 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
android/nowinandroid#2112 ·
-
[FR]: Add network connectivity check before launching Chrome Custom TabPossibly taken A pull request linked to this issue is open or already merged. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
android/nowinandroid#2110 ·
All issues in android/nowinandroid
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
emm3000/myGame#2175 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
MetrolistGroup/Metrolist#5426 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
🐛 Type:Bug 📥 State:Awaiting Assignment 🚨 Priority: P0 - Critical
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
backend
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
digitalfabrik/entitlementcard#3330 ·
Maintainers usually reply within 2 days