public void setCards(List<CardInfo> cards) { listCardNames_ = cards; Bitmap cardBm; cardsInHand_.clear(); for (CardInfo card : cards) { if ((cardHeight_ == 0) && (cardWidth_ == 0)) { cardBm = CardLoader.getInstance().getBitmap(getContext(), card.getName()); } else { // Resize Bitmap cardBm = Bitmap.createScaledBitmap( CardLoader.getInstance().getBitmap(getContext(), card.getName()), (int) cardWidth_, (int) cardHeight_, false); } cardsInHand_.put(card, cardBm); } }
public void setCardSize(float viewHeight) { Bitmap cardSample = CardLoader.getInstance().getBitmap(getContext(), Card.TAVERN); // Fixme: ??? cardHeight_ = viewHeight * 2 / 5; cardWidth_ = cardHeight_ * cardSample.getWidth() / cardSample.getHeight(); }