コード例 #1
0
 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);
   }
 }
コード例 #2
0
 public void setCardSize(float viewHeight) {
   Bitmap cardSample = CardLoader.getInstance().getBitmap(getContext(), Card.TAVERN); // Fixme: ???
   cardHeight_ = viewHeight * 2 / 5;
   cardWidth_ = cardHeight_ * cardSample.getWidth() / cardSample.getHeight();
 }