Commit 7bc09cfa authored by fallenstardust's avatar fallenstardust

判断deckinfo为null时的处理

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