iamutkarshtiwari / Ananas

An easy image editor integration for your Android apps.
MIT License
250 stars 112 forks source link

How to import my own stickers to edit image view? #76

Open yambosyam82 opened 3 years ago

yambosyam82 commented 3 years ago

For the function withStickerFeature(), I found that I can't change the default sticker set, how can I change it? Please update me if you have any solutions of it, thankyou!

tmarsteel commented 3 years ago

You can specify them in your strings resources. First, specify the category/type labels:

<string-array name="iamutkarshtiwari_github_io_ananas_type_names">
    <item>Shapes</item>
    <item>More...</item>
</string-array>

You can then specify the path beneath res/drawable to the stickers of each category/type:

<string-array translatable="false" name="iamutkarshtiwari_github_io_ananas_types">
    <item>shape</item> <!-- path for category 1 -->
    <item>foo</item> <!-- path for category 2 ... -->
</string-array>

And then you have to specify the amount of stickers in each category/type:

<integer-array translatable="false" name="iamutkarshtiwari_github_io_ananas_type_count">
    <item>2</item> <!-- 2 stickers in category 1 -->
</integer-array>

The darwables for the stickers have to be located in res/drawable/$path_$n. So e.g. my two files for category 1 are res/drawable/shape_1.png and res/drawable/shape_2.png.

Note that the drawables must be bitmaps as of now. XML drawables don't work.