Example #1
0
 private void bingSong(ViewHolder holder, LabelStory story) {
   if (LabelStory.TYPE_ONLINEAUDIO.equals(story.getType())) {
     if (story.getThumbImages() != null) {
       AvatarManager.getInstance(context)
           .displaySingerAvatar(
               story.getThumbImages()[0], holder.mAnimView, R.drawable.ic_sound_pic_normal);
     }
     JSONObject jsonObject = VoiceUtiles.getContentJson(story.getContent());
     if (jsonObject != null) {
       holder.songName.setText(
           jsonObject.optString(CommandFields.Dynamic.SONG_NAME) == null
               ? context.getString(R.string.song_name, context.getString(R.string.music_unknown))
               : context.getString(
                   R.string.song_name, jsonObject.optString(CommandFields.Dynamic.SONG_NAME)));
       holder.singName.setText(
           jsonObject.optString(CommandFields.Dynamic.SINGER_NAME) == null
               ? context.getString(
                   R.string.singer_name, context.getString(R.string.music_unknown))
               : context.getString(
                   R.string.singer_name,
                   jsonObject.optString(CommandFields.Dynamic.SINGER_NAME)));
       holder.titleText.setText(jsonObject.optString(CommandFields.Dynamic.DYNAMIC_CONTENT));
     }
   } else {
     holder.titleText.setText(story.getContent());
     holder.mAnimView.setImageResource(R.drawable.ic_sound_play);
     holder.songName.setText(
         context.getString(R.string.song_name, context.getString(R.string.music_unknown)));
     holder.singName.setText(
         context.getString(R.string.singer_name, context.getString(R.string.music_unknown)));
   }
 }
Example #2
0
    @Override
    public void bindView(View contentView, LabelStory story) {
      ViewHolder holder = (ViewHolder) contentView.getTag();
      String content = story.getContent();
      if (TextUtils.isEmpty(content)) {
        holder.banknoteText.setVisibility(View.GONE);
      } else {
        holder.banknoteText.setVisibility(View.VISIBLE);
        holder.banknoteText.setText(content);
      }

      String[] images = story.getThumbImages();
      if (images != null && images.length > 0) {
        String image = images[0];
        holder.banknoteImage.setVisibility(View.VISIBLE);
        MiscUtils.showLabelStoryImage(
            avatarManager, image, holder.banknoteImage, R.drawable.pic_loading);
      } else {
        holder.banknoteImage.setVisibility(View.GONE);
      }
    }
Example #3
0
    @Override
    public void bindView(View contentView, LabelStory story) {
      ViewHolder holder = (ViewHolder) contentView.getTag();

      String content = story.getContent();
      if (!TextUtils.isEmpty(content)) {
        holder.dynamicText.setVisibility(View.VISIBLE);
        holder.dynamicText.setText(content);
      } else {
        holder.dynamicText.setVisibility(View.GONE);
      }

      String imageThumb = getImageThumb(story);
      if (!TextUtils.isEmpty(imageThumb)) {
        holder.dynamicImage.setVisibility(View.VISIBLE);
        holder.dynamicImage.setScaleType(ImageView.ScaleType.CENTER_CROP);
        MiscUtils.showLabelStoryImageThumb(
            avatarManager, imageThumb, holder.dynamicImage, R.drawable.label_null_others);
      } else {
        holder.dynamicImage.setVisibility(View.GONE);
      }
    }