MFlisar / GDPRDialog

GDPR fragment dialog implementation
Apache License 2.0
211 stars 53 forks source link

Sub text of disagree button not visible if button color is too dark #81

Closed yshrsmz closed 5 years ago

yshrsmz commented 5 years ago

screenshot_1551088197

Would be great if we can set color for this text. Currently it uses value of TextView's default text color.

MFlisar commented 5 years ago

will change this to use the text color of the button instead... Seems like you have overwritten the borderless button style though, which is not expected to look like this... or something similar, as the no thank you button is a borderless button by default

yshrsmz commented 5 years ago

Oh, indeed it's strange. Actually I do not modify button theme globaly, so maybe it's related to MaterialComponents lib. Will investigate further

MFlisar commented 5 years ago

You can see here that the default borderless style is used for all buttons but the agree button:

https://github.com/MFlisar/GDPRDialog/blob/ba55ba670220b6bb5d51fcf07620cb940316484b/library/src/main/res/layout/gdpr_dialog_bottom.xml#L4-L23

Last release is converted to android x already and you'll see a borderless button in the demo app as well...

yshrsmz commented 5 years ago

Ok it turned out the cause was Material Components lib. If I use Material Components lib and its theme, Button element is converted to MaterialButton instead of AppCompatButton, and that MaterialButton is not compatible with Widget.AppCompat.Button.Borderless. Thus it is recognized as filled, elevated button.

yshrsmz commented 5 years ago

MaterialButton uses backgroundTint attribute to draw its background

https://github.com/material-components/material-components-android/blob/d23b2a4d2f1fc13912d0909973fd5f186231cd94/lib/java/com/google/android/material/button/res/values/styles.xml#L40