diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentAndPostRecyclerViewAdapter.java index bdfb619f..19080f65 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentAndPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentAndPostRecyclerViewAdapter.java @@ -934,8 +934,11 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter 35_000_000) { + if (preview.getPreviewWidth() * preview.getPreviewHeight() > 10_000_000) { for (int i = previews.size() - 1; i >= 1; i--) { preview = previews.get(i); if (mImageViewWidth >= preview.getPreviewWidth()) { - if (preview.getPreviewWidth() * preview.getPreviewHeight() <= 35_000_000) { + if (preview.getPreviewWidth() * preview.getPreviewHeight() <= 10_000_000) { return preview; } } else { int height = mImageViewWidth / preview.getPreviewWidth() * preview.getPreviewHeight(); - if (mImageViewWidth * height <= 35_000_000) { + if (mImageViewWidth * height <= 10_000_000) { return preview; } } } } - if (preview.getPreviewWidth() * preview.getPreviewHeight() > 35_000_000) { + if (preview.getPreviewWidth() * preview.getPreviewHeight() > 10_000_000) { int divisor = 2; do { preview.setPreviewWidth(preview.getPreviewWidth() / divisor); preview.setPreviewHeight(preview.getPreviewHeight() / divisor); divisor *= 2; - } while (preview.getPreviewWidth() * preview.getPreviewHeight() / divisor / divisor > 35_000_000); + } while (preview.getPreviewWidth() * preview.getPreviewHeight() / divisor / divisor > 10_000_000); } return preview; 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 15faf972..8064779f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -696,8 +696,11 @@ public class PostRecyclerViewAdapter extends PagedListAdapter 35_000_000) { + if (preview.getPreviewWidth() * preview.getPreviewHeight() > 10_000_000) { for (int i = previews.size() - 1; i >= 1; i--) { preview = previews.get(i); if (mImageViewWidth >= preview.getPreviewWidth()) { - if (preview.getPreviewWidth() * preview.getPreviewHeight() <= 35_000_000) { + if (preview.getPreviewWidth() * preview.getPreviewHeight() <= 10_000_000) { return preview; } } else { int height = mImageViewWidth / preview.getPreviewWidth() * preview.getPreviewHeight(); - if (mImageViewWidth * height <= 35_000_000) { + if (mImageViewWidth * height <= 10_000_000) { return preview; } } } } - if (preview.getPreviewWidth() * preview.getPreviewHeight() > 35_000_000) { + if (preview.getPreviewWidth() * preview.getPreviewHeight() > 10_000_000) { int divisor = 2; do { preview.setPreviewWidth(preview.getPreviewWidth() / divisor); preview.setPreviewHeight(preview.getPreviewHeight() / divisor); divisor *= 2; - } while (preview.getPreviewWidth() * preview.getPreviewHeight() / divisor / divisor > 35_000_000); + } while (preview.getPreviewWidth() * preview.getPreviewHeight() / divisor / divisor > 10_000_000); } return preview; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java index c5aa3990..d6bced34 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java @@ -3,7 +3,6 @@ package ml.docilealligator.infinityforreddit.post; import android.net.Uri; import android.os.AsyncTask; import android.text.Html; -import android.util.Log; import org.json.JSONArray; import org.json.JSONException; @@ -242,9 +241,6 @@ public class ParsePost { //Video post JSONObject redditVideoObject = data.getJSONObject(JSONUtils.MEDIA_KEY).getJSONObject(JSONUtils.REDDIT_VIDEO_KEY); int postType = Post.VIDEO_TYPE; - if (!redditVideoObject.has(JSONUtils.HLS_URL_KEY)) { - Log.i("afasd", "s " + redditVideoObject); - } String videoUrl = Html.fromHtml(redditVideoObject.getString(JSONUtils.HLS_URL_KEY)).toString(); String videoDownloadUrl = redditVideoObject.getString(JSONUtils.FALLBACK_URL_KEY);