use of pri.weiqiang.liyujapanese.mvp.bean.gojuon.GojuonGif in project MyJapanese by 54wall.
the class MemoryFragment method setData.
@Override
public void setData(List<GojuonItem> data) {
if (adapter == null) {
adapter = new MemorySwipeAdapter(data);
adapter.setOnWriteButtonClickListener(new MemorySwipeAdapter.OnWriteButtonClickListener() {
@Override
public void onClick(GojuonItem item) {
GojuonGif gif = GifManager.getInstance().getJPGif(item.getRome());
if (gif != null) {
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();
}
}
});
adapter.setOnYinButtonClickListener(new MemorySwipeAdapter.OnYinButtonClickListener() {
@Override
public void onClick(GojuonItem item) {
SoundPoolManager.getInstance().play(item.getRome());
}
});
}
adapter.setList(data);
mSwipeFlingAdapterView.setAdapter(adapter);
}
use of pri.weiqiang.liyujapanese.mvp.bean.gojuon.GojuonGif 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);
}
use of pri.weiqiang.liyujapanese.mvp.bean.gojuon.GojuonGif in project LiYuJapanese by 54wall.
the class MemoryFragment method setData.
@Override
public void setData(List<GojuonItem> data) {
if (adapter == null) {
adapter = new MemorySwipeAdapter(data);
adapter.setOnWriteButtonClickListener(new MemorySwipeAdapter.OnWriteButtonClickListener() {
@Override
public void onClick(GojuonItem item) {
GojuonGif gif = GifManager.getInstance().getJPGif(item.getRome());
if (gif != null) {
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();
}
}
});
adapter.setOnYinButtonClickListener(new MemorySwipeAdapter.OnYinButtonClickListener() {
@Override
public void onClick(GojuonItem item) {
SoundPoolManager.getInstance().play(item.getRome());
}
});
}
adapter.setList(data);
mSwipeFlingAdapterView.setAdapter(adapter);
}
Aggregations