Commit 7bc09cfa authored by fallenstardust's avatar fallenstardust

判断deckinfo为null时的处理

parent 2e021726
......@@ -27,7 +27,7 @@ public class DeckInfo {
public File source;
private int mainCount, extraCount, sideCount;
private Integer mainCount, extraCount, sideCount;
public DeckInfo() {
mainCards = new ArrayList<>();
......
......@@ -81,7 +81,7 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D
holder.cardImage.setVisibility(View.VISIBLE);
imageLoader.bindImage(holder.cardImage, deckFile.getFirstCode(), ImageLoader.Type.middle);
//填入内容
if (deckInfo.getMainCount()!= null) {
if (deckInfo != null) {
holder.main.setText(String.valueOf(deckInfo.getMainCount()));
if (deckInfo.getMainCount() < 40) {
holder.main.setTextColor(Color.YELLOW);
......@@ -94,13 +94,13 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D
holder.main.setText("-");
holder.main.setTextColor(Color.RED);
}
if (deckInfo.getExtraCount() != null) {//有时候主卡数量是空指,原因待查,暂且空指时显示红色“-”
if (deckInfo != null) {//有时候主卡数量是空指,原因待查,暂且空指时显示红色“-”
holder.extra.setText(String.valueOf(deckInfo.getExtraCount()));
} else {
holder.extra.setText("-");
holder.extra.setTextColor(Color.RED);
}
if (deckInfo.getSideCount() != null) {
if (deckInfo != null) {
holder.side.setText(String.valueOf(deckInfo.getSideCount()));
} else {
holder.side.setText("-");
......@@ -111,7 +111,7 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D
} else {
holder.ll_extra_n_side.setVisibility(View.VISIBLE);
}
if (deckInfo != null) {
//判断是否含有先行卡
Deck deck = this.deckInfo.toDeck();
List<String> strList = new ArrayList<>();
......@@ -162,6 +162,7 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D
}
}
}
}
//多选
if (isManySelect) {
if (selectList.contains(item))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment