question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Widget.MaterialComponents.Button.TextButton] `rippleColor` is not working when set from styles for `MaterialAlertDialog`

See original GitHub issue

RippleColor is not working for MaterialAlertDialog

I had setup a theme as:

<style name="Material.Dialog.Alert" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
        <item name="buttonBarPositiveButtonStyle">
            @style/Material.Dialog.Alert.Button.Positive
        </item>
    </style>

for the MaterialAlertDialog: <item name="materialAlertDialogTheme">@style/Material.Dialog.Alert</item>

and a TextButton styles as:

<style name="Material.Dialog.Alert.Button.Positive" parent="Widget.MaterialComponents.Button.TextButton">
        <item name="rippleColor">@color/link_primary</item> //This property doesnt have any effect
        <item name="android:textColor">@color/link_primary</item>
    </style>

Parent theme: Theme.MaterialComponents.Light.NoActionBar.Bridge

Android API version: 21, 25, 28, 29

Material Library version: com.google.android.material:material:1.1.0-alpha04 (Didnt see any fix on the new releases documentation though)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
hrskrscommented, Jan 2, 2020

This is not working with the latest version (1.2.0-alpha03) too if the parent theme is Theme.MaterialComponents.Light.NoActionBar.Bridge

It works, if parent theme is Theme.MaterialComponents.Light.NoActionBar though

I mean the ripple effect for MaterialAlertDialog is not working at all (even the default one - mtrl_btn_text_btn_ripple_color.xml) when the parent theme is set to Theme.MaterialComponents.Light.NoActionBar.Bridge

0reactions
drchencommented, Oct 6, 2021

+1 to Gabriele’s answer. I’m going to close the issue. : )

Read more comments on GitHub >

github_iconTop Results From Across the Web

MaterialComponents theme alert dialog buttons - Stack Overflow
I figured out what was causing this problem. I need to use different AlertDialog class: androidx.appcompat.app.AlertDialog.
Read more >
Android Material Components - MaterialAlertDialog
Basic Implementation. Now let's create a basic MaterialAlertDialog using the Builder pattern: · Styled Buttons. We can style the buttons of ...
Read more >
Material Design — Custom Alert Dialog | by lcdsmao - Medium
Create a custom alert dialog theme that inherited from ThemeOverlay.MaterialComponents.MaterialAlertDialog: Then you can then customize the style of the ...
Read more >
android - MaterialComponents theme alert dialog buttons - Stack ...
But now I have a problem, in this pages there's a note ... <style name="Alert.Button.Positive" parent="Widget.MaterialComponents.Button.TextButton"> <item ...
Read more >
Tips and Tricks for Android Material Support Library 2
Everyone likes a satisfying ripple effect on buttons, and for everything else ... Material Support Library, you'll need a broader solution to this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found