use of pri.weiqiang.liyujapanese.ui.adapter.MemorySwipeAdapter 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.ui.adapter.MemorySwipeAdapter 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