Introduction

The Emoji Wall is an activity that allows your users to select one emoji from the Makemoji library or the built in Android emoji. Declare it in your manifest to launch it. Alternatively, you can host the MojiWallFragment in your own activity that implements IMojiSelected.

    <activity
        android:name="com.makemoji.mojilib.wall.MojiWallActivity"
        android:label="Emoji Wall Activity">
    </activity>
    Intent intent = new Intent(this, MojiWallActivity.class);
    //intent.putExtra(MojiWallActivity.EXTRA_THEME,R.style.MojiWallDefaultStyle_Light); //to theme it
    intent.putExtra(MojiWallActivity.EXTRA_SHOWRECENT,true);//show recently used emojis as a tab
    intent.putExtra(MojiWallActivity.EXTRA_SHOWUNICODE,true);//show unicode emojis as a tab
    startActivityForResult(intent,IMojiSelected.REQUEST_MOJI_MODEL);


Data

The result is returned as a json string that can be converted into a MojiModel containing the name, image url, and unicode character, if applicable.

     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
         super.onActivityResult(requestCode,resultCode,data);
         if (requestCode == IMojiSelected.REQUEST_MOJI_MODEL && resultCode== RESULT_OK){
             try{
                 String json = data.getStringExtra(Moji.EXTRA_JSON);
                 MojiModel model = MojiModel.fromJson(new JSONObject(json));
             }
             catch (Exception e){
                 e.printStackTrace();
             }
         }
     }


Themeing

To theme the activity, pass the activity theme as an extra when starting the activity. Make sure it extends from AppCompat and includes the following attributes.

        <item name="_mm_wall_tab_layout">@layout/mm_wall_tab</item>
        <item name="_mm_wall_header_layout">@layout/mm_wall_header</item>
        <item name="_mm_wall_tabs_bg">@android:color/black</item>
        <item name="_mm_wall_pager_bg">@color/_mm_grey_900</item>