use of pri.weiqiang.liyujapanese.ui.adapter.GojuonRecyclerAdapter in project MyJapanese by 54wall.
the class GojuonFragment method setData.
@Override
public void setData(List<GojuonItem> data) {
adapter = new GojuonRecyclerAdapter(data);
adapter.setOnItemClickListener(new GojuonRecyclerAdapter.OnItemClickListener() {
@Override
public void onClick(GojuonItem item) {
SoundPoolManager.getInstance().play(item.getRome());
}
});
adapter.setOnItemLongClickListener(new GojuonRecyclerAdapter.OnItemLongClickListener() {
@Override
public void onLongClick(GojuonItem 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.GojuonRecyclerAdapter in project LiYuJapanese by 54wall.
the class GojuonFragment method setData.
@Override
public void setData(List<GojuonItem> data) {
adapter = new GojuonRecyclerAdapter(data);
adapter.setOnItemClickListener(new GojuonRecyclerAdapter.OnItemClickListener() {
@Override
public void onClick(GojuonItem item) {
SoundPoolManager.getInstance().play(item.getRome());
}
});
adapter.setOnItemLongClickListener(new GojuonRecyclerAdapter.OnItemLongClickListener() {
@Override
public void onLongClick(GojuonItem 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