Skip to content
This repository has been archived by the owner on Oct 13, 2022. It is now read-only.

Commit

Permalink
Removed hard coded image height
Browse files Browse the repository at this point in the history
Thanks to @makoru
  • Loading branch information
yazeed44 committed Jul 23, 2015
1 parent 9b34381 commit 05d2df7
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class ImagesThumbnailAdapter extends RecyclerView.Adapter<ImagesThumbnail
protected final AlbumEntry mAlbum;
protected final RecyclerView mRecyclerView;
protected final Picker mPickOptions;

protected final Drawable mCheckIcon;


Expand All @@ -53,6 +54,7 @@ private Drawable createCheckIcon() {
public ImageViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
final View imageLayout = LayoutInflater.from(mRecyclerView.getContext()).inflate(R.layout.element_image, viewGroup, false);


return new ImageViewHolder(imageLayout, this);
}

Expand Down Expand Up @@ -80,12 +82,8 @@ public void onClickImage(View layout, ImageView thumbnail, ImageView check) {


public void setHeight(final View convertView) {


final int height = mRecyclerView.getContext().getResources().getDimensionPixelSize(R.dimen.image_height);

final int height = mRecyclerView.getMeasuredWidth() / mRecyclerView.getResources().getInteger(R.integer.num_columns_images);
convertView.setLayoutParams(new AbsListView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, height));

}

public void displayThumbnail(final ImageViewHolder holder, final ImageEntry photo) {
Expand Down

0 comments on commit 05d2df7

Please sign in to comment.