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

Grab sticker #333

Open
Nikhil0108L opened this issue Jan 22, 2023 · 1 comment
Open

Grab sticker #333

Nikhil0108L opened this issue Jan 22, 2023 · 1 comment

Comments

@Nikhil0108L
Copy link

Add a cmd so we can also grab a sticker like a emoji

@azurenekowo
Copy link

You can grab custom (server-uploaded stickers) because they are stored in image formats. Not with built-in stickers like the Wumpus pack and such... they use Lottie and trying to grab them only results in an unreadable .json file.

As for custom stickers, https://cdn.discordapp.com/stickers/[sticker id].png?size=1024

/*
/   Not enough explaination?
*/

Click away if you have nerdphobia:
(This was copied from https://codingwithmitch.com/blog/understanding-the-internals-of-lottie-rendering-the-animation-file/)

Lottie is a library for Android, iOS, Web, and Windows that parses Adobe After Effects animations exported as json with Bodymovin and renders them natively on mobile and on the web.

Early days of Dynamic Animation

In the year 2014 with the release of Android 5.0 (API 21) Lollipop, Android supported Vector Drawables and Animated Vector Drawables.

But even with the support for Animated Vector Drawables, making dynamic vector animation was not easy. It couldn't be loaded programmatically or over the internet. Moreover, it had issues with resolving vector path transformation animation in Android 4.x.

Producing Animation

Some other ways to produce the animation effect were:
  • Using gifs: Gifs are rendered at a fixed size that can't be scaled up to match large and high-density screens. They were not an ideal replacement.
  • Using image sequences: One of the ways to achieve animation effect is to divide the animation into multiple pictures, and then periodically replace the pictures drawn on the screen to form the animation. This method is very simple, but the shortcomings are obvious. Very memory consuming, so it wasn't recommended.
  • Facebook Keyframes: They are now deprecated and had a limited feature set. So, not a very ideal choice either. Yes, this is used to render the react menu.

The direct consequence of the above is that there was not a hint of dynamic vector animation in almost all the major apps, but until the emergence of Lottie.

Emergence of Lottie

Lottie is an animation rendering library open-sourced by Airbnb. With Android, it also supports iOS, React Native, Windows, and Web platforms. Lottie currently supports rendering and playing After Effects animations. Lottie uses the JSON data exported by bodymovin, an After Effects plug-in as the animation data source.

Designers use After Effects to make animations and export JSON files. We can put the JSON file on the svg-sprite Lottie-Player and run it to see the effect.
The resources used by Lottie need to first convert the aep (After Effects Project) file generated by Adobe After Effects into a general JSON format file through bodymovin.
bodymovin exports the After Effects animation as a description of the animation, and the job of lottie-android is to translate the described animation with native code, and its core principle is canvas drawing.
Lottie's animation is drawn by a pure canvas.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants