material-components / material-components/material-components-android
[Snackbar] Snackbar flickers and ignores `gestureInsetBottomIgnored = false` when `anchorViewLayoutListenerEnabled = true`
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
**Description:**
https://github.com/user-attachments/assets/aba1672c-4bad-412f-9b4d-0b69870ec653
**Source code:**
```java
// ...
View anchorView = view.findViewById(R.id.anchor_view);
ValueAnimator animation = ValueAnimator.ofInt(100, -400);
animation.setDuration(3000);
animation.setRepeatMode(Animation.REVERSE);
animation.setRepeatCount(Animation.INFINITE);
animation.addUpdateListener(updatedAnimation -> {
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) anchorView.getLayoutParams();
params.setMargins(0, 0, 0, (int) updatedAnimation.getAnimatedValue());
anchorView.setLayoutParams(params);
});
animation.start();
Snackbar snackbar = Snackbar.make(view, "Test snackbar", Snackbar.LENGTH_INDEFINITE);
snackbar.setAnchorView(anchorView);
snackbar.setAnchorViewLayoutListenerEnabled(true);
snackbar.setGestureInsetBottomIgnored(false);
snackbar.show();
// ...
```
```xml
```
**Device:** Pixel 4a (5G)
**Android API version:** 34
**Material Library version:** 1.13.0-alpha06
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided Java and XML example on Android API 34, focusing on Snackbar anchor layout updates and gesture inset handling. Done means the Snackbar no longer flickers while the anchor moves and gestureInsetBottomIgnored=false is respected when anchorViewLayoutListenerEnabled=true.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100