use of pri.weiqiang.liyujapanese.ui.adapter.GojuonMemoryRecyclerAdapter in project MyJapanese by 54wall.
the class GojuonMemoryFragment method setData.
@Override
public void setData(List<GojuonMemory> data) {
Log.e(TAG, "setData!!");
adapter = new GojuonMemoryRecyclerAdapter(category_gojuon_memory, data);
adapter.setOnItemClickListener(new GojuonMemoryRecyclerAdapter.OnItemClickListener() {
@Override
public void onClick(GojuonMemory bean) {
Log.e(TAG, "onItemClick bean:" + bean.getRome() + ":" + bean.getKatakana());
SoundPoolManager.getInstance().play(bean.getRome());
}
});
adapter.setOnItemLongClickListener(new GojuonMemoryRecyclerAdapter.OnItemLongClickListener() {
@Override
public void onLongClick(GojuonMemory item) {
Log.e(TAG, "onLongClick item:" + item.getRome() + ":" + item.getKatakana());
GojuonGif gif = GifManager.getInstance().getJPGif(item.getRome());
if (gif != null) {
if (BaseApplication.TYPE_MING == Constants.TYPE_HIRAGANA) {
new ImageDialog.Builder(getContext()).setResId(gif.getHiragana()).override((int) ResourceUtils.getDimension(getContext(), R.dimen.dialog_width), (int) ResourceUtils.getDimension(getContext(), R.dimen.dialog_height)).create().show();
} else {
new ImageDialog.Builder(getContext()).setResId(gif.getKatakana()).override((int) ResourceUtils.getDimension(getContext(), R.dimen.dialog_width), (int) ResourceUtils.getDimension(getContext(), R.dimen.dialog_height)).create().show();
}
}
}
});
mRecyclerView.setAdapter(adapter);
}
use of pri.weiqiang.liyujapanese.ui.adapter.GojuonMemoryRecyclerAdapter in project LiYuJapanese by 54wall.
the class GojuonMemoryFragment method setData.
@Override
public void setData(List<GojuonMemory> data) {
Log.e(TAG, "setData!!");
adapter = new GojuonMemoryRecyclerAdapter(category_gojuon_memory, data);
adapter.setOnItemClickListener(new GojuonMemoryRecyclerAdapter.OnItemClickListener() {
@Override
public void onClick(GojuonMemory bean) {
Log.e(TAG, "onItemClick bean:" + bean.getRome() + ":" + bean.getKatakana());
SoundPoolManager.getInstance().play(bean.getRome());
}
});
adapter.setOnItemLongClickListener(new GojuonMemoryRecyclerAdapter.OnItemLongClickListener() {
@Override
public void onLongClick(GojuonMemory item) {
Log.e(TAG, "onLongClick item:" + item.getRome() + ":" + item.getKatakana());
GojuonGif gif = GifManager.getInstance().getJPGif(item.getRome());
if (gif != null) {
if (BaseApplication.TYPE_MING == Constants.TYPE_HIRAGANA) {
new ImageDialog.Builder(getContext()).setResId(gif.getHiragana()).override((int) ResourceUtils.getDimension(getContext(), R.dimen.dialog_width), (int) ResourceUtils.getDimension(getContext(), R.dimen.dialog_height)).create().show();
} else {
new ImageDialog.Builder(getContext()).setResId(gif.getKatakana()).override((int) ResourceUtils.getDimension(getContext(), R.dimen.dialog_width), (int) ResourceUtils.getDimension(getContext(), R.dimen.dialog_height)).create().show();
}
}
}
});
mRecyclerView.setAdapter(adapter);
}
Aggregations