コード例 #1
0
public class PoweredByYouTube extends AbstractBitmapField {

  private static final Logger log = Logger.getLogger(MediaCarouselDescriptionField.class);

  private Bitmap bitmap;

  public PoweredByYouTube() {

    getStyleManager().setStyleClass("PoweredByYouTube");
  }

  protected Bitmap getBitmap() {

    if (bitmap == null) {

      String imagePath = getStyleManager().getImagePath("youtube-logo");

      try {

        setBitmap((Bitmap) MobileImages.instance().getBitmapWithCache(imagePath, getClass()));
      } catch (Throwable t) {

        log.error("Unable to display image: " + imagePath, t);
      }
    }

    return bitmap;
  }

  private void setBitmap(Bitmap bitmap) {

    this.bitmap = bitmap;
  }
}
コード例 #2
0
  protected Bitmap getBitmap() {

    if (bitmap == null) {

      String imagePath = getStyleManager().getImagePath("youtube-logo");

      try {

        setBitmap((Bitmap) MobileImages.instance().getBitmapWithCache(imagePath, getClass()));
      } catch (Throwable t) {

        log.error("Unable to display image: " + imagePath, t);
      }
    }

    return bitmap;
  }