Skip to content

Bug with the ripple effect in widgets #4254

@HehehBoiii78

Description

@HehehBoiii78

Description:
The ripple effect of: a menu in the top app bar, a list item in a drop-down menu, single-choice or multi-choice items in a Material 3 dialog and a ListView - doesn't start from the location of the touch properly. This problem has been sickening for years at this point.

In the "Steps to reproduce" section, I've only shown one widget which does have this issue as an example, but in the attachment attached, other widgets affected by this issue are shown as well.

Important

Jetpack Compose must not be used to reproduce this bug, as this issue isn't present in it. Instead, use any version of the library provided by this repository (Material Components for Android).

Steps to reproduce:

  1. Create a new project in Android Studio.
  2. Import all the dependencies required for Material 3 support.
  3. Add a "Menu" to the "Toolbar" of the project. (Add a Toolbar first if it isn't there already)
  4. Add items to the menu.
  5. Touch and hold an item in the menu.
  • At first, the ripple starts from the center of the item.
  1. Touch and hold the same item again.
  • Then, from where you touched the item last time, the ripple will start from there.
  1. Touch and hold the same item once again.
  • Then, from where you touched the item last time, the ripple will start from there.

Expected behavior:
The ripple should start from the location of the touch everytime, not from a completely different location.

Minimal sample app repro:
The attachment below has a ZIP file which contains the source code of an app which exactly demonstrates the issue outlined.
Bug_Demo.zip

Material Library version:
Happens with any version of this library.

Device:
Any Android device.

Additional context:
In the drop-down menu present in the provided app, the ripple is even weirder. The ripple first starts from the correct location, then starts only from the center if the same item is touched repeatedly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions