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;
}
Aggregations