Skip to content

feat(ripple): support animation duration overwrites - #9253

Merged
jelbourn merged 1 commit into
angular:masterfrom
devversion:feat/ripple-animation-overwrites
Jan 24, 2018
Merged

feat(ripple): support animation duration overwrites#9253
jelbourn merged 1 commit into
angular:masterfrom
devversion:feat/ripple-animation-overwrites

Conversation

@devversion

@devversiondevversion commented Jan 5, 2018

Copy link
Copy Markdown
Member
  • 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.

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

@googlebotgooglebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jan 5, 2018
@devversion
devversionforce-pushed the feat/ripple-animation-overwrites branch from a9c8487 to a72537bCompareJanuary 5, 2018 18:55
@devversion
devversionforce-pushed the feat/ripple-animation-overwrites branch from a72537b to 094265cCompareJanuary 6, 2018 10:36
@jelbournjelbourn 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
Copy Markdown
Contributor

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
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Done.

@jelbournjelbourn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@jelbournjelbourn 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
Copy Markdown
Contributor

@devversion passes Google presubmit, just needs rebase

@devversion
devversionforce-pushed the feat/ripple-animation-overwrites branch from 0cd5635 to 1230e5eCompareJanuary 23, 2018 16:53
@devversion

Copy link
Copy Markdown
MemberAuthor

@jelbourn Done.

@jelbourn

Copy link
Copy Markdown
Contributor

@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
devversionforce-pushed the feat/ripple-animation-overwrites branch from 1230e5e to ea98b5dCompareJanuary 24, 2018 15:58
@jelbourn
jelbourn merged commit 3bc4cd3 into angular:masterJan 24, 2018
@devversion
devversion deleted the feat/ripple-animation-overwrites branch January 24, 2018 16:01
@angular-automatic-lock-bot

Copy link
Copy Markdown

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-botangular-automatic-lock-botBot locked and limited conversation to collaborators Sep 8, 2019
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: mergeThe PR is ready for merge by the caretakercla: yesPR author has agreed to Google's Contributor License Agreementtarget: minorThis PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@devversion@jelbourn@googlebot@tinayuangao@andrewseguin