gregkorossy / DateTimePicker

Material themed DateTimePickers from the Android framework for all API levels (API 14+)
Apache License 2.0
73 stars 17 forks source link

Fixed button style error for MaterialComponents theme #7

Closed tcqq closed 6 years ago

tcqq commented 6 years ago

Fixed because theme using MaterialComponents causes button style error.

Before fix:

imageimage

After fix:

tim 20180618224937tim 20180618224941

gregkorossy commented 6 years ago

The AppCompatButton might not be the best solution as the doc says:

This will automatically be used when you use Button in your layouts and the top-level activity / dialog is provided by appcompat. You should only need to manually use this class when writing custom views.

What about the new MaterialButton?

tcqq commented 6 years ago

Using MaterialButton requires support library upgrade to "28.0.0-alpha3" version.

gregkorossy commented 6 years ago

What material components version (or design support lib) do you use? I tried with 28.0.0-alpha1 on API 26 and 28 but cannot reproduce the button styling issue with the sample app using Theme.MaterialComponents.Light.

tcqq commented 6 years ago

No need to add a material component library, change design support lib to "28.0.0-alpha3" version.

compileSdkVersion: android-P supportVersion: 28.0.0-alpha3

gregkorossy commented 6 years ago

Found a better solution. The problem was that the buttonBarStyle and related attributes were not set because they are defined in the alertDialogTheme that is not applied currently to the layout. Adding android:theme="?alertDialogTheme" to the ScrollView fixes it.

gregkorossy commented 6 years ago

Fixed in v1.0.7-alpha3 (technically in alpha1 but that one didn't produce this error).