feat: updates @DevicePreviews to use the Devices object constants#2038
feat: updates @DevicePreviews to use the Devices object constants#2038
@DevicePreviews to use the Devices object constants#2038Conversation
Summary of ChangesHello @telpirion, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the preview capabilities within the application by updating the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request significantly improves the Jetpack Compose previews by updating @DevicePreviews to use standard Devices constants and adding new previews for NiaApp and ForYouScreen. The changes make the previews more robust and easier to maintain. I've also included a suggestion to refactor the preview setup in ForYouEntryProvider.kt to improve code clarity and reduce verbosity.
...n/com/google/samples/apps/nowinandroid/feature/foryou/impl/navigation/ForYouEntryProvider.kt
Outdated
Show resolved
Hide resolved
dturner
left a comment
There was a problem hiding this comment.
Thanks for the PR. Made a few suggestions and have a few questions.
app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/NiaApp.kt
Outdated
Show resolved
Hide resolved
app/src/testDemo/screenshots/compactWidth_compactHeight_showsNavigationBar.png
Show resolved
Hide resolved
...n/com/google/samples/apps/nowinandroid/feature/foryou/impl/navigation/ForYouEntryProvider.kt
Outdated
Show resolved
Hide resolved
...mpl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/ForYouScreen.kt
Outdated
Show resolved
Hide resolved
...mpl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/ForYouScreen.kt
Outdated
Show resolved
Hide resolved
e490faa to
3fda0e3
Compare
|
I removed all of the extra changes as they weren't pertinent to the primary purpose of this PR. Please take another look. |
|
@telpirion Please could you help me understand the form factor previews a bit better?
Original code: Genuine question, aren't these different form factors? Is there something to do with the density being the same that makes them lack form factor diversity?
The "landscape" and "tablet" specs both have width > height which makes them landscape - am I missing something? Or did you just mean that the desktop form factor wasn't present? Did you intend to remove the "landscape" preview? Should we have a preview for the "phone in landscape" form factor? Sorry for all the questions. Screenshot testing and previews for adaptive apps is a hot topic at the moment and I'd like to make sure I understand the space correctly and that we're providing best practices here. One final thought, should we update the |
What I have done and why
@DevicePreviewsannotation didn't show different form factors; they were always portrait. I changed the annotation so that it uses the constants from theDevicesobject.