Commit 8a4e09d8 authored by qq247321453's avatar qq247321453

ImageLoader

parent d3ef672c
...@@ -92,7 +92,11 @@ public interface Constants { ...@@ -92,7 +92,11 @@ public interface Constants {
String UNKNOWN_IMAGE = "unknown.jpg"; String UNKNOWN_IMAGE = "unknown.jpg";
String YDK_FILE_EX = ".ydk"; String YDK_FILE_EX = ".ydk";
int[] CORE_SKIN_BG_SIZE = new int[]{1280, 720}; int[] CORE_SKIN_BG_SIZE = new int[]{1280, 720};
int[] CORE_SKIN_CARD_MINI_SIZE = new int[]{177, 254};
int[] CORE_SKIN_CARD_DECK_SIZE = new int[]{44, 64};
int[] CORE_SKIN_CARD_LIST_SIZE = new int[]{177, 254};
int[] CORE_SKIN_CARD_DETAIL_SIZE = new int[]{354, 508};
int[] CORE_SKIN_CARD_COVER_SIZE = new int[]{177, 254}; int[] CORE_SKIN_CARD_COVER_SIZE = new int[]{177, 254};
int[] CORE_SKIN_AVATAR_SIZE = new int[]{128, 128}; int[] CORE_SKIN_AVATAR_SIZE = new int[]{128, 128};
boolean SUPPORT_BPG = true; boolean SUPPORT_BPG = true;
......
...@@ -105,7 +105,7 @@ public class CardListAdapter extends BaseRecyclerAdapterPlus<Card, ViewHolder> i ...@@ -105,7 +105,7 @@ public class CardListAdapter extends BaseRecyclerAdapterPlus<Card, ViewHolder> i
if(item == null){ if(item == null){
return; return;
} }
imageLoader.bindImage(holder.cardImage, item.Code); imageLoader.bindImage(holder.cardImage, item.Code, ImageLoader.Type.list);
holder.cardName.setText(item.Name); holder.cardName.setText(item.Name);
if (item.isType(CardType.Monster)) { if (item.isType(CardType.Monster)) {
holder.layout_atk.setVisibility(View.VISIBLE); holder.layout_atk.setVisibility(View.VISIBLE);
......
...@@ -103,8 +103,8 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder { ...@@ -103,8 +103,8 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
isDownloadCardImage = true; isDownloadCardImage = true;
ll_bar.startAnimation(AnimationUtils.loadAnimation(context, R.anim.out_from_bottom)); ll_bar.startAnimation(AnimationUtils.loadAnimation(context, R.anim.out_from_bottom));
ll_bar.setVisibility(View.GONE); ll_bar.setVisibility(View.GONE);
imageLoader.bindImage(photoView, msg.arg1, null, true); imageLoader.bindImage(photoView, msg.arg1, null, ImageLoader.Type.origin);
imageLoader.bindImage(cardImage, msg.arg1, null, true); imageLoader.bindImage(cardImage, msg.arg1, null, ImageLoader.Type.detail);
break; break;
case TYPE_DOWNLOAD_CARD_IMAGE_ING: case TYPE_DOWNLOAD_CARD_IMAGE_ING:
tv_loading.setText(msg.arg1 + "%"); tv_loading.setText(msg.arg1 + "%");
...@@ -259,7 +259,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder { ...@@ -259,7 +259,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
private void setCardInfo(Card cardInfo, View view) { private void setCardInfo(Card cardInfo, View view) {
if (cardInfo == null) return; if (cardInfo == null) return;
mCardInfo = cardInfo; mCardInfo = cardInfo;
imageLoader.bindImage(cardImage, cardInfo.Code, null, true); imageLoader.bindImage(cardImage, cardInfo.Code, ImageLoader.Type.detail);
dialog = DialogUtils.getdx(context); dialog = DialogUtils.getdx(context);
cardImage.setOnClickListener((v) -> { cardImage.setOnClickListener((v) -> {
showCardImageDetail(cardInfo.Code); showCardImageDetail(cardInfo.Code);
...@@ -405,13 +405,13 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder { ...@@ -405,13 +405,13 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
} }
}); });
imageLoader.bindImage(cardImage, code, null, true); imageLoader.bindImage(cardImage, code, null, ImageLoader.Type.origin);
return true; return true;
} }
}); });
//先显示普通卡片大图,判断如果没有高清图就下载 //先显示普通卡片大图,判断如果没有高清图就下载
imageLoader.bindImage(photoView, code, null, true); imageLoader.bindImage(photoView, code, null, ImageLoader.Type.detail);
if (!file.exists()) { if (!file.exists()) {
downloadCardImage(code, file); downloadCardImage(code, file);
......
...@@ -98,7 +98,7 @@ public class CardDetailRandom { ...@@ -98,7 +98,7 @@ public class CardDetailRandom {
} }
public void bindCardImage(ImageLoader imageLoader, long code) { public void bindCardImage(ImageLoader imageLoader, long code) {
imageLoader.bindImage(cardImage, code, null, true); imageLoader.bindImage(cardImage, code, ImageLoader.Type.origin);
} }
public View getView() { public View getView() {
......
...@@ -596,7 +596,7 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement ...@@ -596,7 +596,7 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
holder.setRightImage(null); holder.setRightImage(null);
} }
// holder.useDefault(); // holder.useDefault();
imageLoader.bindImage(holder.cardImage, cardInfo.Code); imageLoader.bindImage(holder.cardImage, cardInfo.Code, ImageLoader.Type.deck);
} else { } else {
holder.setCardType(0); holder.setCardType(0);
holder.setRightImage(null); holder.setRightImage(null);
......
...@@ -25,7 +25,7 @@ public class CardGroupView extends FrameLayout { ...@@ -25,7 +25,7 @@ public class CardGroupView extends FrameLayout {
private int mLineLimit = 10; private int mLineLimit = 10;
private int mOrgLineLimit = 10; private int mOrgLineLimit = 10;
private int mLineMaxCount = 15; private int mLineMaxCount = 15;
private int mCardWidth = Constants.CORE_SKIN_CARD_MINI_SIZE[0], mCardHeight = Constants.CORE_SKIN_CARD_MINI_SIZE[1]; private int mCardWidth = Constants.CORE_SKIN_CARD_DECK_SIZE[0], mCardHeight = Constants.CORE_SKIN_CARD_DECK_SIZE[1];
private boolean mPausePadding; private boolean mPausePadding;
private ImageLoader mImageLoader; private ImageLoader mImageLoader;
......
...@@ -95,7 +95,7 @@ public class CardView extends FrameLayout { ...@@ -95,7 +95,7 @@ public class CardView extends FrameLayout {
if (mCard != null && mCard.equals(cardInfo)) return; if (mCard != null && mCard.equals(cardInfo)) return;
mCard = cardInfo; mCard = cardInfo;
if (cardInfo != null && imageLoader != null) { if (cardInfo != null && imageLoader != null) {
imageLoader.bindImage(mCardView, cardInfo.Code, null, true); imageLoader.bindImage(mCardView, cardInfo.Code, ImageLoader.Type.deck);
} else { } else {
mTopImage.setVisibility(View.GONE); mTopImage.setVisibility(View.GONE);
mCardView.setImageBitmap(null); mCardView.setImageBitmap(null);
......
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