A new page for AXEmojiView which shows memoji just like stickers

AXMemojiView

AXMemojiView is a new page for AXEmojiView which shows memoji just like stickers.

Installation

You have to work with AXEmojiView first!

AXMemojiView is available in the JCenter, so you just need to add it as a dependency (Module gradle)

Gradle

implementation 'com.aghajari.memojiview:AXMemojiView:1.0.0'
implementation 'com.aghajari.emojiview:AXEmojiView:1.2.4'

Maven

<dependency>
  <groupId>com.aghajari.memojiview</groupId>
  <artifactId>AXMemojiView</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

Usage

you just need to install AXMemojiView after installing EmojiView. there is two option to do that, using your own MemojiProvider or read a json file as the MemojiProvider.

AXMemojiManager.install(this, MemojiProvider);

and now you can add AXMemojiView to your AXEmojiPager as a page
or just show AXMemojiView in a EmojiPopupLayout

AXMemojiView memojiView = new AXMemojiView(context);
emojiPager.addPage(memojiView, icon);

Customization

Customize theme with AXMemojiTheme.

AXMemojiManager.getMemojiViewTheme().setSelectedColor(0xffFF4081);
AXMemojiManager.getMemojiViewTheme().setCategoryColor(Color.WHITE);
AXMemojiManager.getMemojiViewTheme().setAlwaysShowDivider(true);
AXMemojiManager.getMemojiViewTheme().setBackgroundColor(Color.LTGRAY);
...

MemojiProvider

I'm using "+1500 memoji Pack" as the default MemojiProvider.

but you can use your own provider or improve this one.

the json format of the MemojiProvider will be like this :

{
 "CategoryName": {
  "CharacterName": [
   {
    "images": [
     {
      "name": "memoji_1_1.png",
      "skin": "white"
     },
     {
      "name": "memoji_1_2.png",
      "skin": "black"
     }
    ],
    "emoji": "?",
    "posture": "Happy"
   }
  ]
 }
}

+1500 memoji Pack

Moein Rabti : +1500 memoji Pack includes 28 characters in white and black skin color and 29 different poses.

assets/Memoji

MemojiLoader

Since the size of the memoji files is very large, it is better to upload them to the your server and load them with glide by using MemojiLoader :

new MemojiLoader() {
           @Override
           public void onLoadMemoji(AppCompatImageView view, Memoji memoji) {

               // Load memojis from server
               /**String serverURL = "https://..../Memoji/";
               String url = serverURL + memoji.getCategory()+"/"+memoji.getCharacter()+"/"+memoji.getImage();
               Glide.with(view)
                .load(url)
                .into(view);*/

               // Load memojis from assets
               Glide.with(view)
                       .load(Uri.parse("file:///android_asset/Memoji/"+memoji.getCategory()+"/"+memoji.getCharacter()+"/"+memoji.getImage()))
                       .into(view);
           }

           @Override
           public void onLoadMemojiCategory(AppCompatImageView view, Memoji memoji, boolean selected) {
               onLoadMemoji(view,memoji);
           }
       };

you can also load the MemojiProvider as a json and download it from your server, in this way you can add new memoji packs to your app when ever you want.

Author

  • Amir Hossein Aghajari

GitHub