diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-08-07 04:06:07 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-08-07 04:06:07 +0000 |
commit | 31a7c2be3ad39cdeba88515cb7343810f84db249 (patch) | |
tree | 1041b73aae07fb571ec871d2f83227373f76ee48 /app/src/main | |
parent | 7b6f9339e705c3a5803c24690195cfedbbddcd0c (diff) | |
download | infinity-for-reddit-31a7c2be3ad39cdeba88515cb7343810f84db249.tar infinity-for-reddit-31a7c2be3ad39cdeba88515cb7343810f84db249.tar.gz infinity-for-reddit-31a7c2be3ad39cdeba88515cb7343810f84db249.tar.bz2 infinity-for-reddit-31a7c2be3ad39cdeba88515cb7343810f84db249.tar.lz infinity-for-reddit-31a7c2be3ad39cdeba88515cb7343810f84db249.tar.xz infinity-for-reddit-31a7c2be3ad39cdeba88515cb7343810f84db249.tar.zst infinity-for-reddit-31a7c2be3ad39cdeba88515cb7343810f84db249.zip |
Version 5.0.0-beta4. Revert changes that limit the max height of images in PostRecyclerViewAdapter and PostDetailRecyclerViewAdapter.
Diffstat (limited to '')
2 files changed, 16 insertions, 18 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java index 98a74bb0..2fa784eb 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java @@ -126,7 +126,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler private static final int VIEW_TYPE_POST_DETAIL_NO_PREVIEW_LINK = 6; private static final int VIEW_TYPE_POST_DETAIL_GALLERY = 7; private static final int VIEW_TYPE_POST_DETAIL_TEXT_TYPE = 8; - private static final int MAX_IMAGE_HEIGHT = 2000; private AppCompatActivity mActivity; private ViewPostDetailFragment mFragment; @@ -721,8 +720,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler Post.Preview preview = getSuitablePreview(mPost.getPreviews()); if (preview != null) { - if (preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0 || preview.getPreviewHeight() > MAX_IMAGE_HEIGHT) { - int height = preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0 ? (int) (400 * mScale) : (int) (MAX_IMAGE_HEIGHT * mScale); + if (preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0) { + int height = (int) (400 * mScale); ((PostDetailImageAndGifAutoplayViewHolder) holder).mImageView.setScaleType(ImageView.ScaleType.CENTER_CROP); ((PostDetailImageAndGifAutoplayViewHolder) holder).mImageView.getLayoutParams().height = height; preview.setPreviewWidth(mImageViewWidth); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java index 184b3991..9d08d880 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -116,7 +116,6 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView private static final int VIEW_TYPE_POST_CARD_2_TEXT_TYPE = 8; private static final int VIEW_TYPE_ERROR = 9; private static final int VIEW_TYPE_LOADING = 10; - private static final int MAX_IMAGE_HEIGHT = 2000; private static final DiffUtil.ItemCallback<Post> DIFF_CALLBACK = new DiffUtil.ItemCallback<Post>() { @Override @@ -811,8 +810,8 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView Post.Preview preview = getSuitablePreview(post.getPreviews()); if (preview != null) { ((PostWithPreviewTypeViewHolder) holder).imageWrapperRelativeLayout.setVisibility(View.VISIBLE); - if (preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0 || preview.getPreviewHeight() > MAX_IMAGE_HEIGHT) { - int height = preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0 ? (int) (400 * mScale) : (int) (MAX_IMAGE_HEIGHT * mScale); + if (preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0) { + int height = (int) (400 * mScale); ((PostWithPreviewTypeViewHolder) holder).imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); ((PostWithPreviewTypeViewHolder) holder).imageView.getLayoutParams().height = height; preview.setPreviewWidth(mImageViewWidth); @@ -945,8 +944,8 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView Post.Preview preview = getSuitablePreview(post.getPreviews()); if (preview != null) { ((PostCard2WithPreviewViewHolder) holder).imageView.setVisibility(View.VISIBLE); - if (preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0 || preview.getPreviewHeight() > MAX_IMAGE_HEIGHT) { - int height = preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0 ? (int) (400 * mScale) : (int) (MAX_IMAGE_HEIGHT * mScale); + if (preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0) { + int height = (int) (400 * mScale); ((PostCard2WithPreviewViewHolder) holder).imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); ((PostCard2WithPreviewViewHolder) holder).imageView.getLayoutParams().height = height; preview.setPreviewWidth(mImageViewWidth); @@ -1340,8 +1339,8 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView Post.Preview preview = getSuitablePreview(post.getPreviews()); if (preview != null) { - if (preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0 || preview.getPreviewHeight() > MAX_IMAGE_HEIGHT) { - int height = preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0 ? (int) (400 * mScale) : (int) (MAX_IMAGE_HEIGHT * mScale); + if (preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0) { + int height = (int) (400 * mScale); ((PostGalleryViewHolder) holder).imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); ((PostGalleryViewHolder) holder).imageView.getLayoutParams().height = height; preview.setPreviewWidth(mImageViewWidth); @@ -1375,8 +1374,8 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView Post.Preview preview = getSuitablePreview(post.getPreviews()); if (preview != null) { - if (preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0 || preview.getPreviewHeight() > MAX_IMAGE_HEIGHT) { - int height = preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0 ? (int) (400 * mScale) : (int) (MAX_IMAGE_HEIGHT * mScale); + if (preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0) { + int height = (int) (400 * mScale); ((PostGalleryViewHolder) holder).imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); ((PostGalleryViewHolder) holder).imageView.getLayoutParams().height = height; preview.setPreviewWidth(mImageViewWidth); @@ -1400,8 +1399,8 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView Post.Preview preview = getSuitablePreview(post.getPreviews()); if (preview != null) { - if (preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0 || preview.getPreviewHeight() > MAX_IMAGE_HEIGHT) { - int height = preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0 ? (int) (400 * mScale) : (int) (MAX_IMAGE_HEIGHT * mScale); + if (preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0) { + int height = (int) (400 * mScale); ((PostGalleryViewHolder) holder).imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); ((PostGalleryViewHolder) holder).imageView.getLayoutParams().height = height; preview.setPreviewWidth(mImageViewWidth); @@ -1425,8 +1424,8 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView Post.Preview preview = getSuitablePreview(post.getPreviews()); if (preview != null) { - if (preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0 || preview.getPreviewHeight() > MAX_IMAGE_HEIGHT) { - int height = preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0 ? (int) (400 * mScale) : (int) (MAX_IMAGE_HEIGHT * mScale); + if (preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0) { + int height = (int) (400 * mScale); ((PostGalleryViewHolder) holder).imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); ((PostGalleryViewHolder) holder).imageView.getLayoutParams().height = height; preview.setPreviewWidth(mImageViewWidth); @@ -1460,8 +1459,8 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView Post.Preview preview = getSuitablePreview(post.getPreviews()); if (preview != null) { - if (preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0 || preview.getPreviewHeight() > MAX_IMAGE_HEIGHT) { - int height = preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0 ? (int) (400 * mScale) : (int) (MAX_IMAGE_HEIGHT * mScale); + if (preview.getPreviewWidth() <= 0 || preview.getPreviewHeight() <= 0) { + int height = (int) (400 * mScale); ((PostGalleryViewHolder) holder).imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); ((PostGalleryViewHolder) holder).imageView.getLayoutParams().height = height; preview.setPreviewWidth(mImageViewWidth); |