Esempio n. 1
0
    @SuppressLint("NewApi")
    public Shadow(EmotionView view) {
      super();

      Bitmap fullImage =
          BitmapFactory.decodeResource(
              getResources(), view.getEmoticon().getHighResolutionResourceId());
      bitmap = ImageScaler.convert(fullImage, shadowSize, shadowSize);
    }
Esempio n. 2
0
  /**
   * Sets the emoticon for this view to the given emoticon.
   *
   * @param emoticon The emoticon for this view.
   * @note this method will just return when the given emoticon is null
   */
  public void setEmoticon(Emotion emoticon) {
    if (emoticon == null) return;
    this.emoticon = emoticon;

    Bitmap fullImage =
        BitmapFactory.decodeResource(getResources(), emoticon.getLowResolutionResourceId());
    this.setImageBitmap(ImageScaler.convert(fullImage, EMOTICON_SIZE, EMOTICON_SIZE));
    this.setScaleType(ScaleType.CENTER_INSIDE);
  }