material-components-android icon indicating copy to clipboard operation
material-components-android copied to clipboard

[BottomSheetDragHandleView] Background colour incorrect

Open nicbell opened this issue 2 years ago • 4 comments

Description

Bottom sheet drag handle appears far darker than the Material 3 design docs.

image

Docs

image

Specs

image

I looks like the 40% alpha is missing for the MDC Android implementation. Changing the default style fixes it.

<item name="bottomSheetDragHandleStyle">@style/Widget.Xxx.BottomSheet.DragHandle</item>
...
<style name="Widget.Xxx.BottomSheet.DragHandle" parent="Widget.Material3.BottomSheet.DragHandle">
    <!-- Matches specs -->
    <item name="android:alpha">0.4</item>
</style>

Code

https://github.com/material-components/material-components-android/blob/4046525b20ff81c4f4fef654b9e8f09ffd7f5a81/lib/java/com/google/android/material/bottomsheet/res/values/styles.xml#L92

nicbell avatar Feb 27 '23 14:02 nicbell

I actually suspect the spec is wrong because %40 will not provide enough contrast to the background, apparently.

I'll check with our designer if the design spec needs to be updated. Thanks for catching this!

drchen avatar Feb 27 '23 19:02 drchen

Hi,

I checked with the designer and the original design was intended to be light (with 40% opacity). However with our new non-text-contrast requirements coming, our designers are working on a new design of the drag handle that conforms the new contrast requirement.

So the conclusion here is we will keep it as-is for now, until we have the updated design, maybe by the end of Q2 or so.

Thanks for noticing and reporting this. I'll leave this open until we update with the new design.

drchen avatar Mar 01 '23 20:03 drchen

@drchen Thanks for the update!

nicbell avatar Mar 02 '23 14:03 nicbell

Hunter, can you help confirm if we can close this as WAI? (And if we need to update the spec anywhere?)

drchen avatar Feb 10 '25 16:02 drchen