mikepenz / AboutLibraries

AboutLibraries automatically collects all dependencies and licenses of any gradle project (Kotlin MultiPlatform), and provides easy to integrate UI components for Android and Compose-jb environments
http://mikepenz.github.io/AboutLibraries/
Apache License 2.0
3.62k stars 419 forks source link

Jetpack Compose: Dialog confirm button cannot be styled for Material 3 apps #926

Closed svenjacobs closed 11 months ago

svenjacobs commented 11 months ago

Since AboutLibraries for Compose is based on Material 2, the only possibility for Material 3 apps to style this library is via the colors parameter of LibrariesContainer. Unfortunately there is no parameter in LibraryDefaults.libraryColors() that sets the confirm button text color.

So in LicenseDialog the Text composable inside TextButton implicitly takes the color from the Material 2 MaterialTheme CompositionLocal which is not declared (or let's say defined with custom colors) for Material 3 apps. So we get the (ugly 😉) default purple color.

dialog

mikepenz commented 11 months ago

That is a great report. Would you have the bandwidth to contribute a fix for this? Thank you!

svenjacobs commented 11 months ago

Sure, I will give it a try 😉

svenjacobs commented 11 months ago

@mikepenz See pull request #927

mikepenz commented 11 months ago

Thank you @svenjacobs

mikepenz commented 11 months ago

Going to get this into a small release. It's probably worth to consider upgrading to Material3 soon. Need to figure out how it handles compatibility for people 🤔

svenjacobs commented 11 months ago

Going to get this into a small release. It's probably worth to consider upgrading to Material3 soon. Need to figure out how it handles compatibility for people 🤔

@mikepenz That's an interesting problem because a big part of your library is to provide UI components. As we have seen in this issue, even simple components like Text are either provided and styled by M2 or M3 but not by both at the same time.

You probably have to create a new major version based on M3 and also support the previous M2 version for a while?