EasyEmoji

最近由于公司项目需要,开发一个类似微信表情框,于是花了好些时间整出一个emoji框架,实现最简洁的方式增加一个功能又超强大的表情框架,并且分享出来,供大家使用,在使用中一起改进完善。

让App添加表情最简单,最快速,并且无需更改原有activity布局。
照例先上图:

这里写图片描述

可自由扩展面板功能:

可自由扩展emoji表情功能:

Download

Gradle:

Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:

    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }

Step 2. Add the dependency

    dependencies {
            compile 'com.github.nickyangjun:EasyEmoji:1.2.1'
    }

Or Maven:

    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>

    <dependency>
        <groupId>com.github.nickyangjun</groupId>
        <artifactId>EasyEmoji</artifactId>
        <version>1.2.1</version>
    </dependency>

How do I use Glide?

Step 1. Replace you editText and TextView to support the emoji

使用EmojiconEditText和EmojiconTextView替换原有布局中的EditText和TextView,以支持emoji表情

EmojiconEditText:

 <org.nicky.libeasyemoji.emojicon.EmojiconEditText 
      xmlns:Emojicon="http://schemas.android.com/apk/res-auto"
      android:id="@+id/emoji_input_txt"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_marginLeft="35dp"
      android:layout_marginRight="100dp"
      android:background="@drawable/shape_input_text"
      android:hint="说点什么吧~"
      android:lineSpacingExtra="1dp"
      android:maxLength="140"
      android:maxLines="4"
      android:minHeight="35dp"
      android:paddingLeft="10dp"
      android:paddingRight="10dp"
      android:textColor="@color/black"
      android:textColorHint="@color/hint_gray_999"
      android:textSize="14sp"
      Emojicon:emojiconSize="18sp" />

EmojiconTextView:

  <org.nicky.libeasyemoji.emojicon.EmojiconTextView
      android:id="@+id/emoji_txt"
      android:layout_width="match_parent"
      android:layout_height="50dp" />

Step 2. Get EasyInputManager instance and add default Emoji in your activity,now joyful.

在activity里获取EasyInputManager实例并且添加默认支持的emoji,现在你可以愉快使用emoji啦

mEasyInputManager = EasyInputManagerImpl.newInstance(this);
mEasyInputManager.addDefaultEmoji("emoji",emojiconEditText);



More features can refer to the demo.

Add Panel and Keyboard listener
增加panel和键盘弹出监听

mEasyInputManager.addOnPanelListener(new changePanelListener());
mEasyInputManager.addOnKeyboardIMEListener(new changeKeyboardListener());

Touch blank erea to display keyboard
点击空白区域自动隐藏键盘

mEasyInputManager.setTouchBlankAutoHideIME(true,dip2px(this, 50));

Add custom fragment to panel area
增加自定义界面到panel区域

mEasyInputManager.addFragmentToPanel("attach", AttachFragment.newInstance());

//open panel
mEasyInputManager.openPanel();
//open "attach" panel
mEasyInputManager.openPanel("attach");

//close panel
mEasyInputManager.closePanel();

Add custom expressions
增加自定义表情

//add
mEasyInputManager.getEmojiBuilder().addEmojiStyle(lovedEmoji);

//update
mEasyInputManager.getEmojiBuilder().updateEmojiStyle(lovedEmoji);

github地址:EasyEmoji
为了更好的完善此框架,希望更多对此框架有兴趣的朋友一起加入进来打造更易用更完善的EasyEmoji,欢迎star!!!

更多精彩Android技术可以关注我们的微信公众号,扫一扫下方的二维码或搜索关注公众号:


Android老鸟
这里写图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值