I have 100+ png files I need to add as stickers. I would like to place them in a folder i.e. "/assets/stickers" or in "res/raw". But i have been unable to figure out how to then read the File/Uri for these images to create the ImageStickerAsset and ImageStickerItem lists.
Any help would be much appreciated
put the sticker png into res/drawable-nodpi/
, not res/raw/
(because loading of images in drawable-nodpi
is faster)
Add the stickers as ImageStickerAsset's like this
AssetConfig assetConfig = settingsList.getConfig();
assetConfig.addAsset(new ImageStickerAsset(
"sticker_FILE_NAME",
ImageSource.create(R.drawable.file_name)
));
Create previews from you sticker, with max 196x196px, prefix the files with something like "_preview" and put they also into res/drawable-nodpi/
Add a StickerCategoryItem("category_NAME", R.string.categoryName, ImageSource.create(R.drawable.file_name_preview), ...)
Replace ...
with your ImageStickerItem's (must have the same ID as the assets) and separate the items with a commas
new ImageStickerItem("sticker_FILE_NAME", R.string.myname, ImageSource.create(R.drawable.file_name_preview)),