I'm following this guide in order to build a stickers app: https://github.com/WhatsApp/stickers/tree/master/Android
What I'm doing in a different way, is getting the json, tray images and sticker files from a web service instead from assets.
Everything is working fine (including adding the stickers to whatsapp) except for one thing: the webp stickers are not showing in the pack detail view (sticker_pack_details.xml
).
I'm changing where the sticker file is loaded like this
StickerPreviewAdapter.java
public void onBindViewHolder(@NonNull final StickerPreviewViewHolder stickerPreviewViewHolder, final int i)}
{
stickerPreviewViewHolder.stickerPreviewView.setImageResource(errorResource);
//stickerPreviewViewHolder.stickerPreviewView.setImageURI(StickerPackLoader.getStickerAssetUri(stickerPack.identifier, stickerPack.getStickers().get(i).imageFileName));
String filename = "/data/user/0/com.example.samplestickerapp/files/" + stickerPack.identifier + "/" + stickerPack.getStickers().get(i).imageFileName;
android.net.Uri stickerURI = android.net.Uri.parse(filename);
stickerPreviewViewHolder.stickerPreviewView.setImageURI(stickerURI);
}
The commented line fetches the stickers from assets, but I've changed it so the stickers are grabbed from the internal storage.
Am I missing something or looking in the wrong place?
I've also changed readContentFile()
and fetchFile()
* from StickerContentProvider.java so the sticker is fetched from internal storage rather than assets.
*as stated here: https://github.com/WhatsApp/stickers/blob/master/Android/README.md#expose-files-that-are-stored-internally-as-stickers-through-contentprovider