Commit 511d83d1 authored by kenan's avatar kenan

图片尺寸

parent 730ae6a3
......@@ -93,9 +93,8 @@ public interface Constants {
String YDK_FILE_EX = ".ydk";
int[] CORE_SKIN_BG_SIZE = new int[]{1280, 720};
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_SMALL_SIZE = new int[]{177, 254};
int[] CORE_SKIN_CARD_MIDDLE_SIZE = new int[]{531, 762};
int[] CORE_SKIN_CARD_COVER_SIZE = new int[]{177, 254};
int[] CORE_SKIN_AVATAR_SIZE = new int[]{128, 128};
......
......@@ -48,12 +48,10 @@ public class ImageLoader implements Closeable {
public enum Type {
//origin size
origin,
//44x64
deck,
//177x254
list,
//354x508
detail
small,
//531x762
middle
}
private static class Cache {
......@@ -150,14 +148,11 @@ public class ImageLoader implements Closeable {
if (type != Type.origin) {
int[] size = null;
switch (type) {
case deck:
size = Constants.CORE_SKIN_CARD_DECK_SIZE;
case small:
size = Constants.CORE_SKIN_CARD_SMALL_SIZE;
break;
case list:
size = Constants.CORE_SKIN_CARD_LIST_SIZE;
break;
case detail:
size = Constants.CORE_SKIN_CARD_DETAIL_SIZE;
case middle:
size = Constants.CORE_SKIN_CARD_MIDDLE_SIZE;
break;
}
if (size != null) {
......
......@@ -105,7 +105,7 @@ public class CardListAdapter extends BaseRecyclerAdapterPlus<Card, ViewHolder> i
if(item == null){
return;
}
imageLoader.bindImage(holder.cardImage, item, ImageLoader.Type.list);
imageLoader.bindImage(holder.cardImage, item, ImageLoader.Type.small);
holder.cardName.setText(item.Name);
if (item.isType(CardType.Monster)) {
holder.layout_atk.setVisibility(View.VISIBLE);
......
......@@ -5,7 +5,6 @@ import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
......@@ -35,7 +34,6 @@ import cn.garymb.ygomobile.ui.adapters.BaseAdapterPlus;
import cn.garymb.ygomobile.utils.CardUtils;
import cn.garymb.ygomobile.utils.DownloadUtil;
import cn.garymb.ygomobile.utils.FileUtils;
import cn.garymb.ygomobile.utils.NetUtils;
import cn.garymb.ygomobile.utils.YGOUtil;
import ocgcore.CardManager;
import ocgcore.DataManager;
......@@ -107,7 +105,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
ll_bar.startAnimation(AnimationUtils.loadAnimation(context, R.anim.out_from_bottom));
ll_bar.setVisibility(View.GONE);
imageLoader.bindImage(photoView, msg.arg1, ImageLoader.Type.origin);
imageLoader.bindImage(cardImage, msg.arg1, ImageLoader.Type.detail);
imageLoader.bindImage(cardImage, msg.arg1, ImageLoader.Type.middle);
break;
case TYPE_DOWNLOAD_CARD_IMAGE_ING:
tv_loading.setText(msg.arg1 + "%");
......@@ -263,7 +261,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
private void setCardInfo(Card cardInfo, View view) {
if (cardInfo == null) return;
mCardInfo = cardInfo;
imageLoader.bindImage(cardImage, cardInfo, ImageLoader.Type.detail);
imageLoader.bindImage(cardImage, cardInfo, ImageLoader.Type.middle);
dialog = DialogUtils.getdx(context);
cardImage.setOnClickListener((v) -> {
showCardImageDetail(cardInfo.Code);
......@@ -418,7 +416,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
});
//先显示普通卡片大图,判断如果没有高清图就下载
imageLoader.bindImage(photoView, code, null, ImageLoader.Type.detail);
imageLoader.bindImage(photoView, code, null, ImageLoader.Type.middle);
if (!file.exists()) {
downloadCardImage(code, file, false);
......
......@@ -596,7 +596,7 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
holder.setRightImage(null);
}
// holder.useDefault();
imageLoader.bindImage(holder.cardImage, cardInfo, ImageLoader.Type.deck);
imageLoader.bindImage(holder.cardImage, cardInfo, ImageLoader.Type.small);
} else {
holder.setCardType(0);
holder.setRightImage(null);
......
......@@ -25,7 +25,8 @@ public class CardGroupView extends FrameLayout {
private int mLineLimit = 10;
private int mOrgLineLimit = 10;
private int mLineMaxCount = 15;
private int mCardWidth = Constants.CORE_SKIN_CARD_DECK_SIZE[0], mCardHeight = Constants.CORE_SKIN_CARD_DECK_SIZE[1];
private int mCardWidth = Constants.CORE_SKIN_CARD_SMALL_SIZE[0];
private int mCardHeight = Constants.CORE_SKIN_CARD_SMALL_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, ImageLoader.Type.deck);
imageLoader.bindImage(mCardView, cardInfo, ImageLoader.Type.small);
} 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