Search in sources :

Example 1 with EmojiGridAdapter

use of org.kymjs.emoji.adapter.EmojiGridAdapter in project KJFrameForAndroid by kymjs.

the class EmojiPageFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    sGrid = new GridView(getActivity());
    sGrid.setNumColumns(KJEmojiConfig.COLUMNS);
    adapter = new EmojiGridAdapter(getActivity(), datas);
    sGrid.setAdapter(adapter);
    sGrid.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            EditText editText = (EditText) getActivity().findViewById(R.id.emoji_titile_input);
            if (position + 1 != datas.size()) {
                InputHelper.input(editText, (Emojicon) parent.getAdapter().getItem(position));
            } else {
                InputHelper.backspace(editText);
            }
        }
    });
    sGrid.setSelector(new ColorDrawable(Color.TRANSPARENT));
    return sGrid;
}
Also used : EmojiGridAdapter(org.kymjs.emoji.adapter.EmojiGridAdapter) EditText(android.widget.EditText) OnItemClickListener(android.widget.AdapterView.OnItemClickListener) ColorDrawable(android.graphics.drawable.ColorDrawable) Emojicon(org.kymjs.emoji.model.Emojicon) GridView(android.widget.GridView) GridView(android.widget.GridView) View(android.view.View) AdapterView(android.widget.AdapterView)

Aggregations

ColorDrawable (android.graphics.drawable.ColorDrawable)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)1 EditText (android.widget.EditText)1 GridView (android.widget.GridView)1 EmojiGridAdapter (org.kymjs.emoji.adapter.EmojiGridAdapter)1 Emojicon (org.kymjs.emoji.model.Emojicon)1