StickerView
StickerView copied to clipboard
can we add animated sticker (gif)
can we add animated sticker (gif)
tried it but the sticker is not animated how can that be done
@pawaom have you got any solution for GIF Sticker?
I looked at the Drawable source code,found the solution.
![](https://user-images.githubusercontent.com/17588779/54737651-059c3880-4bec-11e9-8e38-c43dac5ce77b.gif)
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.