Git Product home page Git Product logo

android-expression's Introduction

这是一个 Android 自定义表情库

license Release Version

效果图

expression.gif

文章详解

快速打造 Android 自定义表情库

使用方法

  1. 添加依赖:    compile 'com.mabeijianxi:jianxiexpression:2.2.8'
  2. 在需要使用表情输入的地方使用 ExpressionEditText 这个 View,并且在相应位置实现 ExpressionGridFragment.ExpressionClickListener,ExpressionGridFragment.ExpressionDeleteClickListener 。实现内容如下:
@Override
    public void expressionDeleteClick(View v) {
        ExpressionShowFragment.delete(et_send_content);
    }

    /**
     * 这里必须实现表情点击后才能把具体表情传入edittext
     * @param str
     */
    @Override
    public void expressionClick(String str) {
        ExpressionShowFragment.input(et_send_content, str);
    }
  1. 在想显示表情的键盘的位置用一个 FrameLayout 填充,然后在需要显示表情键盘的时候如下操作:
getSupportFragmentManager().beginTransaction().replace(R.id.fl_emogi, ExpressionShowFragment.newInstance()).commit();
  1. 在你需要展示而非输入的地方使用 ExpressionTextView 。

注意事项

如果你需要对 ExpressionTextView 再设置其他 Spannable ,设置完不要直接调用 setText ,你需要调用 setSpannableString 这个方法才不会不覆盖。

更新日志

2017.07.07

   提交 2.2.8

android-expression's People

Contributors

mabeijianxi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.