private void setProfileImage(final URL url, final ActivityViewHolder holder) {
   if (!mDisplayProfileImage) return;
   if (mDisplayHiResProfileImage) {
     mProfileImageLoader.displayImage(
         holder.profile_image, getBiggerTwitterProfileImage(parseString(url)));
   } else {
     mProfileImageLoader.displayImage(holder.profile_image, parseString(url));
   }
 }
 private void setUserProfileImages(final User[] users, final ActivityViewHolder holder) {
   if (!mDisplayProfileImage) return;
   final int length = users.length;
   for (int i = 0; i < length; i++) {
     if (i > 4) {
       break;
     }
     final User user = users[i];
     final ImageView activity_profile_image;
     switch (i) {
       case 0:
         {
           activity_profile_image = holder.activity_profile_image_1;
           break;
         }
       case 1:
         {
           activity_profile_image = holder.activity_profile_image_2;
           break;
         }
       case 2:
         {
           activity_profile_image = holder.activity_profile_image_3;
           break;
         }
       case 3:
         {
           activity_profile_image = holder.activity_profile_image_4;
           break;
         }
       case 4:
         {
           activity_profile_image = holder.activity_profile_image_5;
           break;
         }
       default:
         {
           activity_profile_image = null;
         }
     }
     if (mDisplayHiResProfileImage) {
       mProfileImageLoader.displayImage(
           activity_profile_image,
           getBiggerTwitterProfileImage(parseString(user.getProfileImageURL())));
     } else {
       mProfileImageLoader.displayImage(
           activity_profile_image, parseString(user.getProfileImageURL()));
     }
   }
 }
Exemplo n.º 3
0
 @Override
 public View getView(int position, View convertView, ViewGroup parent) {
   final ImageView view =
       (ImageView)
           (convertView instanceof ImageView
               ? convertView
               : mInflater.inflate(R.layout.images_preview_item, null));
   final ImageSpec spec = getItem(position);
   mImageLoader.displayImage(spec != null ? parseURL(spec.thumbnail_link) : null, view);
   return view;
 }
  @Override
  public void bindView(View view, Context context, Cursor cursor) {
    if (mCursorClosed) return;

    final ImageView image_view = (ImageView) view.findViewById(android.R.id.icon);
    image_view.setVisibility(mDisplayProfileImage ? View.VISIBLE : View.GONE);
    if (mDisplayProfileImage && mProfileImageLoader != null) {
      final String profile_image_url_string = cursor.getString(mProfileImageUrlIdx);
      mProfileImageLoader.displayImage(parseURL(cursor.getString(mProfileImageUrlIdx)), image_view);
      if (mDisplayHiResProfileImage) {
        mProfileImageLoader.displayImage(
            parseURL(getBiggerTwitterProfileImage(profile_image_url_string, mForceSSLConnection)),
            image_view);
      } else {
        mProfileImageLoader.displayImage(
            parseURL(getNormalTwitterProfileImage(profile_image_url_string, mForceSSLConnection)),
            image_view);
      }
    }
    super.bindView(view, context, cursor);
  }