google / accompanist

A collection of extension libraries for Jetpack Compose
https://google.github.io/accompanist
Apache License 2.0
7.34k stars 593 forks source link

[Pager] Pager indicator adds a transitive dependency to Material Icons which massively increases the apk size #1688

Closed steliosfran closed 1 year ago

steliosfran commented 1 year ago

Description The pager indicator has a dependency to Material Icons which increased our apk size by ~20MB. It should have been at least written in the documentation, due to the very large size of that dependency. We had to explicitly exclude it in gradle.

Steps to reproduce Add a dependency to com.google.accompanist:accompanist-pager-indicators

Expected behavior No transitive dependency to androidx.compose.material:material-icons-core

Additional context We get a transitive dependency to androidx.compose.material:material-icons-core that massively increases the apk size.

andkulikov commented 1 year ago

Hey. Pager indicators has a dependency on compose:material and compose:material has a dependency on material-icons-core. If you were using compose:material already in your app you wouldn't see any difference. But if you are not using compose:material in your app I don't recommend you to use accompanist-pager-indicators directly as you don't need a material specific theming for the pager indicators. I recommend you to just copy the code you need and adjust it in a way which works for your use case