Commit 511d83d1 authored by kenan's avatar kenan

图片尺寸

parent 730ae6a3
...@@ -93,9 +93,8 @@ public interface Constants { ...@@ -93,9 +93,8 @@ public interface Constants {
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_DECK_SIZE = new int[]{44, 64}; int[] CORE_SKIN_CARD_SMALL_SIZE = new int[]{177, 254};
int[] CORE_SKIN_CARD_LIST_SIZE = new int[]{177, 254}; int[] CORE_SKIN_CARD_MIDDLE_SIZE = new int[]{531, 762};
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};
......
...@@ -48,12 +48,10 @@ public class ImageLoader implements Closeable { ...@@ -48,12 +48,10 @@ public class ImageLoader implements Closeable {
public enum Type { public enum Type {
//origin size //origin size
origin, origin,
//44x64
deck,
//177x254 //177x254
list, small,
//354x508 //531x762
detail middle
} }
private static class Cache { private static class Cache {
...@@ -150,14 +148,11 @@ public class ImageLoader implements Closeable { ...@@ -150,14 +148,11 @@ public class ImageLoader implements Closeable {
if (type != Type.origin) { if (type != Type.origin) {
int[] size = null; int[] size = null;
switch (type) { switch (type) {
case deck: case small:
size = Constants.CORE_SKIN_CARD_DECK_SIZE; size = Constants.CORE_SKIN_CARD_SMALL_SIZE;
break; break;
case list: case middle:
size = Constants.CORE_SKIN_CARD_LIST_SIZE; size = Constants.CORE_SKIN_CARD_MIDDLE_SIZE;
break;
case detail:
size = Constants.CORE_SKIN_CARD_DETAIL_SIZE;
break; break;
} }
if (size != null) { if (size != null) {
......
...@@ -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, ImageLoader.Type.list); imageLoader.bindImage(holder.cardImage, item, ImageLoader.Type.small);
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);
......
...@@ -5,7 +5,6 @@ import android.content.Intent; ...@@ -5,7 +5,6 @@ import android.content.Intent;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.Window; import android.view.Window;
...@@ -35,7 +34,6 @@ import cn.garymb.ygomobile.ui.adapters.BaseAdapterPlus; ...@@ -35,7 +34,6 @@ import cn.garymb.ygomobile.ui.adapters.BaseAdapterPlus;
import cn.garymb.ygomobile.utils.CardUtils; import cn.garymb.ygomobile.utils.CardUtils;
import cn.garymb.ygomobile.utils.DownloadUtil; import cn.garymb.ygomobile.utils.DownloadUtil;
import cn.garymb.ygomobile.utils.FileUtils; import cn.garymb.ygomobile.utils.FileUtils;
import cn.garymb.ygomobile.utils.NetUtils;
import cn.garymb.ygomobile.utils.YGOUtil; import cn.garymb.ygomobile.utils.YGOUtil;
import ocgcore.CardManager; import ocgcore.CardManager;
import ocgcore.DataManager; import ocgcore.DataManager;
...@@ -107,7 +105,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder { ...@@ -107,7 +105,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
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, ImageLoader.Type.origin); 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; break;
case TYPE_DOWNLOAD_CARD_IMAGE_ING: case TYPE_DOWNLOAD_CARD_IMAGE_ING:
tv_loading.setText(msg.arg1 + "%"); tv_loading.setText(msg.arg1 + "%");
...@@ -263,7 +261,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder { ...@@ -263,7 +261,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, ImageLoader.Type.detail); imageLoader.bindImage(cardImage, cardInfo, ImageLoader.Type.middle);
dialog = DialogUtils.getdx(context); dialog = DialogUtils.getdx(context);
cardImage.setOnClickListener((v) -> { cardImage.setOnClickListener((v) -> {
showCardImageDetail(cardInfo.Code); showCardImageDetail(cardInfo.Code);
...@@ -418,7 +416,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder { ...@@ -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()) { if (!file.exists()) {
downloadCardImage(code, file, false); downloadCardImage(code, file, false);
......
...@@ -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, ImageLoader.Type.deck); imageLoader.bindImage(holder.cardImage, cardInfo, ImageLoader.Type.small);
} else { } else {
holder.setCardType(0); holder.setCardType(0);
holder.setRightImage(null); holder.setRightImage(null);
......
...@@ -25,7 +25,8 @@ public class CardGroupView extends FrameLayout { ...@@ -25,7 +25,8 @@ 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_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 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, ImageLoader.Type.deck); imageLoader.bindImage(mCardView, cardInfo, ImageLoader.Type.small);
} 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