[Refactor] Create compose screen for PhotoTask Fragment#3548
[Refactor] Create compose screen for PhotoTask Fragment#3548shobhitagarwal1612 wants to merge 14 commits intomasterfrom
Conversation
…mpose using a new PhotoTaskScreen component.
This will be used for loading images asynchronously
* Create a new `UriImage` Composable that uses Coil's `AsyncImage` for efficient image loading. * Replace the `AndroidView` and `ImageView` implementation in `PhotoTaskScreen` with the new `UriImage` component. * Implement smart image scaling in `UriImage` to prevent memory issues when loading large images.
* Remove Glide dependency and version definition from `libs.versions.toml` and `app/build.gradle`. * Delete `GlideDownsampleExifTest.kt` as image loading has been migrated to Coil.
Summary of ChangesHello @shobhitagarwal1612, 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 undertakes a significant refactoring of the PhotoTask Fragment, transitioning its user interface to Jetpack Compose. This modernization effort involves replacing traditional Android XML layouts with Composable functions, integrating the Coil library for efficient image handling within Compose, and consequently removing the legacy Glide image loading library and associated UI components. The change aims to improve the overall architecture and leverage the benefits of declarative UI. 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. Changelog
Activity
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 is a great step forward in modernizing the codebase by refactoring the PhotoTaskFragment to use Jetpack Compose. The migration from XML layouts to composable functions is well-executed, and the switch from Glide to Coil for image loading is a sensible choice. The related code, including tests and resource files, has been cleaned up effectively. I've identified one high-severity issue regarding a ViewModel initialization within a composable function that should be addressed to prevent performance degradation.
app/src/main/java/org/groundplatform/android/ui/datacollection/tasks/photo/PhotoTaskFragment.kt
Outdated
Show resolved
Hide resolved
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request is a well-executed refactoring of the PhotoTaskFragment to Jetpack Compose. The conversion from XML layouts to Compose is clean, and the replacement of the Glide dependency with Coil for image loading is a great modernization step. The new UriImage composable is a good, reusable component, and the updates to the tests to cover the new implementation are thorough. I have one suggestion to make the new UriImage composable more robust.
Fixes #3545
Things done:
coilfor loading images async in compose. This library has compatibility with KMP as well.glidedependency and related classes.Before:
compose-photo-task-before.webm
After:
compose-photo-task-after.webm
@andreia-ferreira @gino-m PTAL?