Open pawaom opened 6 years ago
@pawaom have you got any solution for GIF Sticker?
I looked at the Drawable source code,found the solution.
try {
Drawable drawable = new GifDrawable(getResources(), R.drawable.test);
drawable.setCallback(new Drawable.Callback() {
@Override
public void invalidateDrawable( Drawable who) {
stickerView.invalidate();
}
@Override
public void scheduleDrawable(Drawable who, Runnable what, long when) {
stickerView.invalidate();
}
@Override
public void unscheduleDrawable(Drawable who, Runnable what) {
stickerView.invalidate();
}
});
stickerView.addSticker(new DrawableSticker(drawable));
} catch (IOException e) {
e.printStackTrace();
}
@dengyuhan thank you so much, but how about saving StickerView
as GIF file?
@Mouadabdelghafouraitali StickerView cannot save gif. a dedicated encoder is required to save gif, for example gifencoder or android-ndk-gif.
can we add animated sticker (gif)
tried it but the sticker is not animated how can that be done