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

UI: Add scaling click animation to Button component #559

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

ksharma-xyz
Copy link
Owner

@ksharma-xyz ksharma-xyz commented Jan 22, 2025

TL;DR

Added a new scaling click animation for buttons that shrinks the component when pressed.

What changed?

  • Created a new ScaleIndicationNode that handles press animations
  • Added scalingKlickable modifier that implements the scaling animation
  • Updated the Button component to use the new scaling animation instead of the default click behavior
  • The scaling animation shrinks components to 90% of their size when pressed

How to test?

  1. Run the app and navigate to any screen with buttons
  2. Press and hold a button to see it scale down
  3. Release the button to see it animate back to full size
  4. Verify the animation feels smooth and responsive

Why make this change?

To provide better visual feedback during button interactions, making the UI feel more dynamic and responsive. The scaling animation gives users clear indication that their touch input was registered, improving the overall user experience.

@ksharma-xyz ksharma-xyz force-pushed the 01-20-use_krail_ripple branch from 519d8c5 to ba92cd2 Compare January 22, 2025 11:54
@ksharma-xyz ksharma-xyz force-pushed the 01-22-create_scaling_button branch from 64c6304 to 2a7aa6c Compare January 22, 2025 11:54
@ksharma-xyz ksharma-xyz force-pushed the 01-20-use_krail_ripple branch from ba92cd2 to 7c8e965 Compare January 23, 2025 08:32
@ksharma-xyz ksharma-xyz force-pushed the 01-22-create_scaling_button branch from 2a7aa6c to 0d23013 Compare January 23, 2025 08:32
@ksharma-xyz ksharma-xyz marked this pull request as ready for review January 23, 2025 08:33
@ksharma-xyz ksharma-xyz changed the title Create Scaling button UI: Add scaling click animation to Button component Jan 23, 2025
Base automatically changed from 01-20-use_krail_ripple to main January 23, 2025 08:44
@ksharma-xyz ksharma-xyz force-pushed the 01-22-create_scaling_button branch from 0d23013 to f962ef4 Compare January 23, 2025 08:44
@ksharma-xyz ksharma-xyz merged commit 1cce149 into main Jan 23, 2025
2 checks passed
Copy link
Owner Author

Merge activity

  • Jan 23, 3:55 AM EST: A user merged this pull request with Graphite.

@ksharma-xyz ksharma-xyz deleted the 01-22-create_scaling_button branch January 23, 2025 08:55
@ksharma-xyz ksharma-xyz added this to the 1.0.6 milestone Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant