public void setPreviews(PostElement holder, Post post) { holder.previews.setVisibility(View.GONE); for (int i = 0; i < holder.preview.length; i++) { holder.preview[i].setVisibility(View.GONE); } for (int i = 0; (i < post.getAttachFiles().size()) && (i < holder.preview.length); i++) { holder.previews.setVisibility(View.VISIBLE); holder.preview[i].setVisibility(View.VISIBLE); holder.preview[i].setTag(i + ""); imageLoader.DisplayImage( (Activity) context, ImageLoader.UrlType.ATTACH_FILE, ImageLoader.ImageSize.SMALL, holder.preview[i], post.getAttachFiles().get(i).getId()); } }
private void setOnClickListener() { if (post != null) { GotoUserMainAction action1 = new GotoUserMainAction(getContext(), post.getUser()); GotoStoreMainAction action2 = new GotoStoreMainAction(getContext(), post.getStore()); GotoImageSliderAction action3 = new GotoImageSliderAction(getContext(), post.getAttachFiles()); holder.profile.setOnClickListener(action1); holder.nickText.setOnClickListener(action1); holder.storeNameText.setOnClickListener(action2); holder.likeCountText.setOnClickListener(new LikeUserListListener(getContext(), post)); holder.menu.setOnClickListener(new PostHeaderQuickActionDialog()); holder.menu.setTag(holder.menu); for (int i = 0; i < previewWrapperIds.length; i++) { holder.preview[i].setOnClickListener(action3); } } }