use of pri.weiqiang.liyujapanese.mvp.bean.gojuon.GojuonItem in project LiYuJapanese by 54wall.
the class GojuonRecyclerAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
GojuonItem item = list.get(position);
if (BaseApplication.TYPE_MING == Constants.TYPE_HIRAGANA) {
holder.tv_jiaming.setText(item.getHiragana());
} else {
holder.tv_jiaming.setText(item.getKatakana());
}
if (holder.tv_rome != null) {
holder.tv_rome.setText(item.getRome());
}
holder.item = item;
if (getItemViewType(position) == Constants.TYPE_ITEM && holder.item.isExisted()) {
holder.view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (onItemClickListener != null) {
onItemClickListener.onClick(holder.item);
}
}
});
if (holder.item.getCategory() != Constants.CATEGORY_AOYIN) {
holder.view.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
if (onItemLongClickListener != null) {
onItemLongClickListener.onLongClick(holder.item);
}
return true;
}
});
}
}
}
use of pri.weiqiang.liyujapanese.mvp.bean.gojuon.GojuonItem in project LiYuJapanese by 54wall.
the class DBManager method getAoYin.
public List<GojuonItem> getAoYin() {
if (aoYin == null) {
aoYin = new ArrayList<>();
List<GojuonItem> query = query();
for (GojuonItem item : query) {
if (item.getCategory() == Constants.CATEGORY_AOYIN) {
aoYin.add(item);
}
}
Collections.sort(aoYin, new GojuonItemComporator());
}
return aoYin;
}
use of pri.weiqiang.liyujapanese.mvp.bean.gojuon.GojuonItem in project LiYuJapanese by 54wall.
the class DBManager method addHeaderString.
public void addHeaderString(List<GojuonItem> list, int row, int column) {
for (int i = 1; i < column; i++) {
GojuonItem item = list.get(i);
String hiragana = item.getHiragana();
String katakana = item.getKatakana();
item.setHiragana(hiragana + ResourceUtils.getString(BaseApplication.getInstance(), R.string.column));
item.setKatakana(katakana + ResourceUtils.getString(BaseApplication.getInstance(), R.string.column));
}
for (int i = 1; i < row; i++) {
GojuonItem item = list.get(i * column);
String hiragana = item.getHiragana();
String katakana = item.getKatakana();
item.setHiragana(hiragana + ResourceUtils.getString(BaseApplication.getInstance(), R.string.row));
item.setKatakana(katakana + ResourceUtils.getString(BaseApplication.getInstance(), R.string.row));
}
}
use of pri.weiqiang.liyujapanese.mvp.bean.gojuon.GojuonItem in project LiYuJapanese by 54wall.
the class DBManager method getQingYin.
public synchronized List<GojuonItem> getQingYin() {
if (qingYin == null) {
qingYin = new ArrayList<>();
List<GojuonItem> query = query();
for (GojuonItem item : query) {
if (item.getCategory() == Constants.CATEGORY_QINGYIN) {
qingYin.add(item);
}
}
Collections.sort(qingYin, new GojuonItemComporator());
}
return qingYin;
}
use of pri.weiqiang.liyujapanese.mvp.bean.gojuon.GojuonItem in project LiYuJapanese by 54wall.
the class DBManager method getAoYinWithoutHeader.
public List<GojuonItem> getAoYinWithoutHeader() {
if (aoYinWithoutHeader == null) {
aoYinWithoutHeader = new ArrayList<>();
List<GojuonItem> query = getAoYin();
for (GojuonItem item : query) {
if (item.getRow() != 0 && item.getColumn() != 0 && item.isExisted()) {
aoYinWithoutHeader.add(item);
}
}
}
return aoYinWithoutHeader;
}
Aggregations