예제 #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)));
   }
 }
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   final Activity activity = getActivity();
   mAccountManager = AccountManager.getInstance(activity);
   mSettingHelper = SettingHelper.getInstance(activity);
   mAvatarManager = AvatarManager.getInstance(activity);
   mThemeManager = ThemeManager.getInstance(activity);
   mUserTheme = getUserTheme();
   mNickname = mSettingHelper.getAccountNickname();
   mInfoAdapter = new PersonalInfoAdapter(activity, setupViewItems(activity));
 }
예제 #3
0
 public BanknoteContent(Context context) {
   avatarManager = AvatarManager.getInstance(context);
 }
예제 #4
0
 public TxtContent(Context context) {
   avatarManager = AvatarManager.getInstance(context);
 }