Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert XML Fluent Icons to ImageVector Compose Icons #597

Closed
wants to merge 0 commits into from

Conversation

Younes-Charfaoui
Copy link

@Younes-Charfaoui Younes-Charfaoui commented Jul 3, 2023

What has been done 🔥

This pull request (PR) aims to enhance the icons set provided by fluent system icons converting existing XML icons to Jetpack Compose ImageVector icons. By migrating to Jetpack Compose, we can leverage the declarative nature of Compose UI and take advantage of its powerful features for rendering scalable icons. This conversion will result in improved performance, flexibility, and maintainability of the icons in the project.

The main purpose was to have fluent API access to Fluent icons, the developer using Jetpack Compose can create an Icon like the following:

Icon(imageVector = FluentIcons.Filled.MyLocation12, contentDescription = "My Location")

How it was done ✅

I have created a parser that parses the XML icons and converts them to fluentIcons using ImageVector compose's nature using materialPath.

Changes Made 💡

  • Converted existing XML icons to Jetpack Compose ImageVector format.
  • Added necessary code to accommodate the changes introduced by the new icon format (especially the different sizes of the icons)

Testing Done ✔

  • Verified that the icons maintain their original appearance and fidelity after the conversion process.

I think we can also make some screenshot tests for each icon, but that would take a long time to run the tests.

Missing Stuff 😅

Three icons are still remaining since they don't share the same structure as the other icons (they contain an extra clip-path); I will try to convert those manually. Here are the icons:

  • ic_fluent_my_location_12_filled.xml
  • ic_fluent_my_location_12_regular.xml
  • ic_fluent_mention_12_filled.xml

@Macintosh-Fan
Copy link

Huge pull request :O

compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.3"
Copy link

@mishramayank1 mishramayank1 Jul 12, 2023

Choose a reason for hiding this comment

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

The Android build check fail as compose compiler & kotlin version is not compatible. As per the
https://developer.android.com/jetpack/androidx/releases/compose-kotlin , compose version 1.2.0-rc02 is compatible with kolin 1.6.21. Please evaluate it.

Copy link
Author

Choose a reason for hiding this comment

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

Updated the version of compose @mishramayank1, try it again please!

@boukhalfa-khaled
Copy link

+945,851 −13 Wow, with only a little work involved, we've got a huge pull request.

@Macintosh-Fan
Copy link

🫡

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.

6 participants