Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ripple): support animation duration overwrites #9253

Merged

Conversation

devversion
Copy link
Member

@devversion devversion commented Jan 5, 2018

  • Adds a new option to the ripples that allows developers to have a better control of the animation (all ripples, or even individual ripples).

  • Deprecates the matRippleSpeedFactor in favor of the matRippleAnimation binding that accepts a RippleAnimationConfig. The configuration is more explicit, clean and not confusing as the speedFactor.

  • To provide a more user-friendly launch() method API, the passed ripple config will extend the default ripple config from the MatRipple instance (removes unnecessary bloat; requested in Proposal: Provide public access to a button's ripple #4179 (comment))

  • Disables ripples for most of the demo buttons in the ripple demo (allows better debugging; when pressing the buttons)

Text from the ripple overview (Disabling animation)

The animation of ripples can be disabled by using the animation global option. If the
enterDuration and exitDuration is being set to 0, ripples will just appear without any
animation.

This is specifically useful in combination with the disabled global option, because globally
disabling ripples won't affect the focus indicator ripples. If someone still wants to disable
those ripples for performance reasons, the duration can be set to 0, to remove the ripple feel.

const globalRippleConfig: RippleGlobalOptions = {
  disabled: true,
  animation: {
    enterDuration: 0,
    exitDuration: 0
  }
};

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jan 5, 2018
@devversion devversion force-pushed the feat/ripple-animation-overwrites branch from a9c8487 to a72537b Compare January 5, 2018 18:55
@devversion devversion force-pushed the feat/ripple-animation-overwrites branch from a72537b to 094265c Compare January 6, 2018 10:36
@jelbourn jelbourn added the target: minor This PR is targeted for the next minor release label Jan 11, 2018
* There are two animation phases with different durations for the ripples.
*/
export interface RippleAnimationConfig {
/** Duration in milliseconds for the enter animation. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you expand the comment a bit more to describe what constitutes "enter animation" and "exit animation"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Jan 11, 2018
@jelbourn
Copy link
Member

@devversion passes Google presubmit, just needs rebase

@devversion devversion force-pushed the feat/ripple-animation-overwrites branch from 0cd5635 to 1230e5e Compare January 23, 2018 16:53
@devversion
Copy link
Member Author

@jelbourn Done.

@jelbourn
Copy link
Member

@devversion can you rebase again? Conflicted with your other PR for radio buttons that got merged first

* Adds a new option to the ripples that allows developers to have a better control of the animation (all ripples, or even individual ripples).
* Deprecates the `matRippleSpeedFactor` in favor of the `matRippleAnimation` binding that accepts a `RippleAnimationConfig`. The configuration is more explicit, clean and not confusing as the `speedFactor`.
* To provide a more user-friendly `launch()` method API, the passed ripple config will extend the default ripple config from the `MatRipple` instance (removes unnecessary bloat; requested in angular#4179 (comment))
* Disables ripples for most of the demo buttons in the ripple demo (allows better debugging; when pressing the buttons)
@devversion devversion force-pushed the feat/ripple-animation-overwrites branch from 1230e5e to ea98b5d Compare January 24, 2018 15:58
@jelbourn jelbourn merged commit 3bc4cd3 into angular:master Jan 24, 2018
@devversion devversion deleted the feat/ripple-animation-overwrites branch January 24, 2018 16:01
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants