Skip to content

Conversation

JolandaVerhoef
Copy link
Collaborator

This commit replaces the Material Icons dependency with local drawable resources for all icons used in the Jetchat sample. This involves:

  • Adding new vector drawable XML files for each icon.
  • Updating composable functions to use painterResource for loading these local drawables instead of relying on the Icons object from the material-icons-extended library.
  • Removing the material-icons-extended dependency from the app's build.gradle.kts file.
  • Removing tint from ic_baseline_person_24.xml as it's applied in Compose.

This commit replaces the Material Icons dependency with local drawable resources for all icons used in the Jetchat sample.
This involves:
- Adding new vector drawable XML files for each icon.
- Updating composable functions to use painterResource for loading these local drawables instead of relying on the Icons object from the material-icons-extended library.
- Removing the material-icons-extended dependency from the app's build.gradle.kts file.
- Removing tint from `ic_baseline_person_24.xml` as it's applied in Compose.
@JolandaVerhoef JolandaVerhoef requested a review from a team as a code owner July 3, 2025 17:21
@JolandaVerhoef JolandaVerhoef requested review from dturner and riggaroo and removed request for dturner July 3, 2025 17:21
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @JolandaVerhoef, 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 refactors how icons are handled within the Jetchat sample application. The primary goal is to remove the external dependency on the material-icons-extended library by replacing all its usages with local vector drawable resources. This change enhances the project's self-sufficiency and potentially optimizes the application's footprint.

Highlights

  • Dependency Decoupling: The material-icons-extended library has been completely removed from the project's build configuration, reducing external dependencies and potentially the app's footprint.
  • Local Icon Management: All previously used Material Icons are now provided as local vector drawable XML files, ensuring that icon assets are bundled directly within the application.
  • Composable Function Updates: Existing Compose UI components that previously referenced Icons.Filled or Icons.Outlined now utilize painterResource to load icons from the newly added local drawables.
  • Drawable Resource Standardization: A minor adjustment was made to ic_baseline_person_24.xml to remove an inline tint, aligning with Compose's approach to applying tints programmatically.
Using Gemini Code Assist

The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and 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 to provide feedback.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the Material Icons dependency and replaces them with local resources. I've added comments to improve code readability by using named arguments and to address a hardcoded color in ic_baseline_person_24.xml.

Comment on lines 23 to 24
android:fillColor="@color/blue500"
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The <path> inside this drawable has a hardcoded android:fillColor="@color/blue500". This prevents the icon from being tinted correctly in Compose, as the hardcoded fill color takes precedence. To allow for proper tinting, remove the android:fillColor attribute from the path.

@@ -255,7 +252,7 @@ fun ChannelNameBar(
actions = {
// Search icon
Icon(
imageVector = Icons.Outlined.Search,
painterResource(id = R.drawable.ic_search),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using named arguments for the painterResource call improves readability.

Suggested change
painterResource(id = R.drawable.ic_search),
painter = painterResource(id = R.drawable.ic_search),

@@ -265,7 +262,7 @@ fun ChannelNameBar(
)
// Info icon
Icon(
imageVector = Icons.Outlined.Info,
painterResource(id = R.drawable.ic_info),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using named arguments for the painterResource call improves readability.

Suggested change
painterResource(id = R.drawable.ic_info),
painter = painterResource(id = R.drawable.ic_info),

@@ -114,7 +113,7 @@ fun RecordButton(
state = tooltipState,
) {
Icon(
Icons.Default.Mic,
painterResource(id = R.drawable.ic_mic),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using named arguments for the painterResource call improves readability.

Suggested change
painterResource(id = R.drawable.ic_mic),
painter = painterResource(id = R.drawable.ic_mic),

@JolandaVerhoef JolandaVerhoef merged commit ddf4ce4 into main Jul 4, 2025
5 checks passed
@JolandaVerhoef JolandaVerhoef deleted the jv/jetchat-new-icons branch July 4, 2025 09:00
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.

2 participants