use of org.kymjs.emoji.model.Emojicon in project KJFrameForAndroid by kymjs.
the class EmojiPageFragment method initData.
private void initData(int index, int type) {
datas = new ArrayList<Emojicon>();
if (KJEmojiFragment.EMOJI_TAB_CONTENT > 1) {
datas = DisplayRules.getAllByType(type);
} else {
List<Emojicon> dataAll = DisplayRules.getAllByType(type);
int max = Math.min((index + 1) * KJEmojiConfig.COUNT_IN_PAGE, dataAll.size());
for (int i = index * KJEmojiConfig.COUNT_IN_PAGE; i < max; i++) {
datas.add(dataAll.get(i));
}
datas.add(new Emojicon(KJEmojiConfig.DELETE_EMOJI_ID, 1, "delete:"));
}
}
use of org.kymjs.emoji.model.Emojicon 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