Answer by Sadisha for Material icon size adjustment in Jetpack Compose?
If you are using just an Icon you can use the .size() modifier.Icon( imageVector = Icons.Outlined.Clear, contentDescription = "clear", modifier = Modifier.size(24.dp))But if you are using an IconButton...
View ArticleAnswer by Tobias for Material icon size adjustment in Jetpack Compose?
What works for me is to use Modifier.fillMaxSize(...)), e.g.Icon(Icons.Filled.Person, contentDescription = "Person", modifier = Modifier.fillMaxSize(0.5F))Icon(Icons.Filled.Person, contentDescription =...
View ArticleAnswer by Gabriele Mariotti for Material icon size adjustment in Jetpack...
With 1.0.x just use the Modifier.size(xx.dp)Icon(Icons.Filled.Person,"contentDescription", modifier = Modifier.size(128.dp))
View ArticleAnswer by noe for Material icon size adjustment in Jetpack Compose?
The accepted answer no longer works in 1.0.0-alpha11. This is the associated bug report. As per the bug report comments, the new way of doing this from alpha12 on would be:Icon(Icons.Filled.Person,...
View ArticleAnswer by Alon Albert for Material icon size adjustment in Jetpack Compose?
To make the answer above more accesible, define some extension functions:fun VectorAsset.resize(size: Int) = this.resize(size.dp)fun VectorAsset.resize(size: Dp) = this.resize(size, size)fun...
View ArticleAnswer by Muthukrishnan Rajendran for Material icon size adjustment in...
Internally material icon size is 24.dp// All Material icons (currently) are 24dp by 24dp, with a viewport size of 24 by 24.@PublishedApiinternal const val MaterialIconDimension = 24fAnd using the size...
View ArticleMaterial icon size adjustment in Jetpack Compose?
Jetpack compose provides a nice Icon() object to display icons that accepts a vector asset. Typically, you are able to set the size via a modifier:Icon(Icons.Filled.PersonPin,...
View Article