如何为表情符号制作有效的弹出视图?

How to make effective popup view for emojicon?

我有一些例子Emoji Keyboard。如何在软键盘中创建看起来像 emojiconView 的弹出视图

我还有一个项目。我创建了一个与 Dot dash Keyboard 中相同的弹出窗口 如何在软键盘中实现emoji 正确视图。

参见:

但我的观点是:

如何在 SoftKeyboard 中管理此视图。

编辑 1 : 代码

public void createCheatSheet() {
        LayoutInflater inflater = (LayoutInflater) service.getSystemService(Service.LAYOUT_INFLATER_SERVICE);
        ViewGroup viewGrop = null;
        if (this.gridView == null) {
            emojiTextView = new EmojiconTextView(getContext());
            // this.gridView =
            // this.service.getLayoutInflater().inflate(R.layout.cheatsheet2,
            // null);
            LinearLayout l = (LinearLayout) this.service.getLayoutInflater().inflate(R.layout.cheatsheet2, null);
            l.addView(emojiTextView);
            viewGrop = (ViewGroup) inflater.inflate(R.layout.linearlayout, l, true);

        }
        if (emojiTextView == null) {
            // this.gridView =
            // this.service.getLayoutInflater().inflate(R.layout.cheatsheet1,
            // null);
            // emojiTextView = (EmojiconTextView)
            // gridView.findViewById(R.id.Emoji_GridView);

        }

        if (this.popupDialog == null) {
            this.popupDialog = new Dialog(this.service);

            popupDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

            popupDialog.setCancelable(true);
            // FrameLayout boatlayout = new FrameLayout(this.service);
            // emojiTextView = (EmojiconTextView)
            // gridView.findViewById(R.id.Emoji_GridView);
            //
            // FrameLayout.LayoutParams params = new
            // FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT,
            // LayoutParams.MATCH_PARENT);
            // boatlayout.addView(emojiTextView, params);
            // RelativeLayout.LayoutParams parentParams = new
            // RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
            // LayoutParams.WRAP_CONTENT);
            // popupDialog.addContentView(boatlayout, parentParams);
            popupDialog.setCanceledOnTouchOutside(true);
            popupDialog.setContentView(viewGrop);
            // popupDialog.addContentView(emojiTextView, params);

            // emojiTextView.setOnTouchListener(new OnTouchListener() {
            // @Override
            // public boolean onTouch(View v, MotionEvent event) {
            // Toast.makeText(getContext(), "onclick",
            // Toast.LENGTH_LONG).show();
            // return true;
            // }
            // });
            PopupWindow window = new PopupWindow(gridView, 200, 200);
//          Window window = this.popupDialog.getWindow();
            WindowManager.LayoutParams lp = window.getAttributes();
            lp.token = this.getWindowToken();
            lp.type = WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
            window.setAttributes(lp);

            window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
        }
    }

感谢提前。请分享您的代码。

您点击以下链接:

How to draw view on top of soft keyboard like WhatsApp?

您是一名开发人员,但没有任何功能。您为键盘创建自定义视图并关注此项目。

AnySoftKeyboard

https://github.com/AnySoftKeyboard/AnySoftKeyboard

https://github.com/zeuxisoo/android-emoji-keyboard

https://code.google.com/p/indic-keyboards/