[TabLayout] ripple is darker than set color
See original GitHub issueHi, all my ripples are of color ?attr/colorControlHighlight which I override to #11000000.
However if I override it on tabLayout via
<style name="DefaultTabLayout" parent="Widget.MaterialComponents.TabLayout">
...
<item name="tabRippleColor">?attr/colorControlHighlight</item>
...
</style>
Its ripple is still way darker than some component next to it on which I manually set a ripple foreground selector
For completeness, here is the ripple selector I use on my other views
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?attr/colorControlHighlight">
<item android:id="@id/android:mask">
<color android:color="@color/colorWhite" />
</item>
</ripple>
First I thought It was a MDC thing, but then I also override rippleColor of a MaterialButton and that works fine.
Here is a screenshot
You can see both the button and unselected tab pressed, and observe tab being way darker
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
TabLayout highlite and Ripple effect - android - Stack Overflow
1)Can i remove TabLayout highlight or change highlight color of tab layout? 2)Can i add ripple effect for tab. Each tab contain TextView...
Read more >Tablayout Highlite And Ripple Effect - ADocLib
Sets the ripple color for this TabLayout.with GRAVITYCENTER while the tabs fit within the TabLayout's content width.xml.
Read more >Tabs - Material Design
Tabs organize high level content in an app content, such as switching between views, data sets, or functional aspects of an app.
Read more >Theming with AppCompat - Medium
As you might expect from the name, colorPrimaryDark is a darker variant of your primary color, which is used as the background color...
Read more >TabHost - Android Developers
Whether or not the auto handwriting initiation is enabled in this View. ... android:outlineAmbientShadowColor, Sets the color of the ambient shadow that is ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m experiencing the same thing in Android 13. It’s impossible to set
app:tabRippleColor
fully transparent…What you can do for now is setting it to #0000, which is transparent white (instead of transparent black what android:color/transparent is.
Change white to whatever the background color is. Only problem this way is that it’s still broken in automatic dark mode in Android 13.
These are just workaround though, it’s something broken that hopefully gets fixed someday.
Any update on this? We are not using Material 3 Theme and migrating to it requires a huge amount of time and effort. Now is not a right time for us to do it so we hope that there is an alternative way to fix this. Thanks