material-components / material-components/material-components-android

[BaseTransientBottomBar] Animation time is too long

Open
#3,278 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Widget: Snackbar
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

Description: Snackbar animation time at the beginning and end is too long, including slide animation and fade animation, in Theme.MaterialComponents.

Expected behavior:
animationSlideDuration is 250, which is R.attr.motionDurationShort4

animationFadeInDuration is 150, which is R.attr.motionDurationShort2

animationFadeOutDuration is 75, which is R.attr.motionDurationShort1

Source code:

animationSlideDuration = MotionUtils.resolveThemeDuration(context, R.attr.motionDurationLong2,
        DEFAULT_SLIDE_ANIMATION_DURATION);
    animationFadeInDuration = MotionUtils.resolveThemeDuration(context, R.attr.motionDurationLong2,
        DEFAULT_ANIMATION_FADE_IN_DURATION);
    animationFadeOutDuration =
        MotionUtils.resolveThemeDuration(
            context, R.attr.motionDurationMedium1, DEFAULT_ANIMATION_FADE_OUT_DURATION);

Minimal sample app repro:
SnackBarTest.zip

Android API version: 29

Material Library version: 1.9.0-alpha02

Device: HONOR 9X

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the BaseTransientBottomBar animation-duration code shown in the issue and compare each resolved theme attribute with the expected short-duration attributes. Use the provided SnackBarTest.zip sample app to verify the slide and fade timings; done means the three durations resolve as specified on the reported setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.