Giter VIP home page Giter VIP logo

smoothemotionkeyboard's Introduction

SmoothEmojiKeyBoard

流畅切换表情/输入法的layout
有许多输入法/表情切换的时候,会先把表情顶上去一下,有一种跳跃感.
很多开发者都是通过延迟一定时间再来显示表情面板,这样只是减小了跳跃的概率,
但是键盘的隐藏时间不确定,还是会出现跳跃的情况.
这时候用户/产品/QA可能就不爽了......
于是就搞了这个..


Feature

  • 流畅切换 输入法/表情(不闪动)

  • 自动适应 输入法高度变化,高度跟随,亦可限制表情栏最小高度,避免输入法高度太小导致表情显示不完整

  • 自动适应 动态显示/隐藏navigationbar

  • smoothly switch softKeyBoard|EmotionBoard

  • autofit dynamic softKeyBoard height change

  • autofit dynamic show/hide navigationbar

PreView

Usage

dependencies{
    compile 'com.github.cpoopc:smoothsoftinputlayout:1.0.0' // jcenter
}
  1. android:windowSoftInputMode="adjustResize"
  2. 继承BaseSoftInputLayout,自定义布局,实现父类定义的几个抽象方法(参考已经实现的2种布局:ChatSoftInputLayout|EditSoftInputLayout)
public class ChatSoftInputLayout extends BaseSoftInputLayout {

    @Override
    protected void inflateView() {
        View layout = LayoutInflater.from(getContext()).inflate(R.layout.chat_softinput_layout, this, true);
        ...
        setupEmotionView(layout);
        setupOtherView(layout);
    }

    private void setupEmotionView(View layout) {
        ...
        add2ShowViewList(emotionView);
        add2MappingMap(btnEmotion, SHOW_EMOTION, emotionView);// btnEmotion-(SHOW_EMOTION-emotionView)
    }

    @Override
    protected View getContainer() {
        return container;
    }

    @Override
    protected View getFrame() {
        return frame;
    }

    @Override
    public EditText getEditText() {
        return editText;
    }

    @Override
    protected View getBtnKeyBoard() {
        return null;
    }

}

xml中引入控件

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">
    <com.cpoopc.smoothemotionkeyboard.inputboard.ChatSoftInputLayout
        android:id="@+id/softinputLayout"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
    </com.cpoopc.smoothemotionkeyboard.inputboard.ChatSoftInputLayout>
</RelativeLayout>

smoothemotionkeyboard's People

Contributors

cpoopc avatar

Watchers

James Cloos avatar YugeCse 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.