svg-to-compose icon indicating copy to clipboard operation
svg-to-compose copied to clipboard

Visual test

Open BreimerR opened this issue 2 years ago • 4 comments

image

BreimerR avatar Mar 20 '22 00:03 BreimerR

Hi @BreimerR, could you explain your use case? I did a test here and seems that Compose default Modifier.size() has the same effect side by side.

I think your implementation is perfect to work with applying a base size to the SVG like 32dp is by default, but I think that the name in the Icon should be optional.

image

DevSrSouza avatar Mar 23 '22 02:03 DevSrSouza

Referenced from: Boiler code reduction. Instead of using Modifier.size(). The commit resizes all the nodes. Thus no need for the Modifier.

@Composable
fun Icon(){
     Icon(Icons.SomeLargeIcon,modifier = Modifier.size(24.dp))
}

Becomes

@Composable
fun SomeLargeIcon(){
     Icon(Icons.SomeLargeIcon24)
}

BreimerR avatar Mar 26 '22 03:03 BreimerR

I don't think this is a good solution for removing boilerplate, Icons generation generation alot alot alot of code generation that can ingress code size to just not use Modifier.size(). Compose is flexible, you can always create a custom icon function that was size pre defined. I will protype a function for that use case: something like AwesomeIcons.Something.size64

DevSrSouza avatar Mar 26 '22 04:03 DevSrSouza

I still think your PR is awesome but generating multiple icons with difference only on the icon size is not a good a idea in my opinion, but allowing to generate a icon with a specified size would be awesome and this PR also support that. If you are able to open a new PR adding the scale/size functionality would be awesome.

DevSrSouza avatar Mar 26 '22 04:03 DevSrSouza