-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Animate the like button #5033
Animate the like button #5033
Conversation
Your Render PR Server URL is https://social-app-pr-5033.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cr8irvrv2p9s738ib4f0. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, looks great!
if (PlatformInfo.getIsReducedMotionEnabled()) { | ||
likeAnimValue.value = 1 | ||
} else { | ||
likeAnimValue.value = withTiming(1, { | ||
duration: 400, | ||
easing: Easing.out(Easing.cubic), | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With these, you can tell the withTiming
call to reduce motion if needed.
if (PlatformInfo.getIsReducedMotionEnabled()) { | |
likeAnimValue.value = 1 | |
} else { | |
likeAnimValue.value = withTiming(1, { | |
duration: 400, | |
easing: Easing.out(Easing.cubic), | |
}) | |
} | |
likeAnimValue.value = withTiming(1, { | |
duration: 400, | |
easing: Easing.out(Easing.cubic), | |
reduceMotion: ReduceMotion.System, | |
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't work :(
Easing, | ||
interpolate, | ||
SharedValue, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easing, | |
interpolate, | |
SharedValue, | |
Easing, | |
interpolate, | |
ReduceMotion, | |
SharedValue, |
@@ -45,6 +54,7 @@ import { | |||
Heart2_Stroke2_Corner0_Rounded as HeartIconOutline, | |||
} from '#/components/icons/Heart2' | |||
import * as Prompt from '#/components/Prompt' | |||
import {PlatformInfo} from '../../../../../modules/expo-bluesky-swiss-army' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import {PlatformInfo} from '../../../../../modules/expo-bluesky-swiss-army' |
Just tried this out on the preview branch, it looks so good! Great job 👌🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only briefly had a look on web but this is amazing, 10/10
* Animate the like button * Respect reduced motion * Move like count into animated component * Animate text * Fix layout on Android * Animate text backwards too * Fix bad copypasta * Reflect nonlocal updates to animated values (cherry picked from commit ed232e6)
Inspired by #4405 but a slightly different animation (inspired by the one in examples on the React homepage).
web.mov
ios.mov
android.mov