Commit 8a4e09d8 authored by qq247321453's avatar qq247321453

ImageLoader

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