From af6b92ffa3e28ef56ececa23fa30aef21aa41e98 Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Wed, 10 Jan 2024 11:02:42 -0500 Subject: Show gifs in ViewVideoActivity if possible. --- .../adapters/HistoryPostRecyclerViewAdapter.java | 28 +++++--- .../adapters/PostDetailRecyclerViewAdapter.java | 78 ++++++++++++++++------ .../adapters/PostRecyclerViewAdapter.java | 28 +++++--- .../infinityforreddit/post/ParsePost.java | 10 +++ .../infinityforreddit/post/Post.java | 11 +++ .../infinityforreddit/utils/JSONUtils.java | 1 + 6 files changed, 119 insertions(+), 37 deletions(-) (limited to 'app/src/main/java/ml/docilealligator/infinityforreddit') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java index da1078b2..781f59e1 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java @@ -2503,14 +2503,26 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter previews = new ArrayList<>(); @Nullable private Map mediaMetadataMap; @@ -192,6 +193,7 @@ public class Post implements Parcelable { crosspostParentId = in.readString(); distinguished = in.readString(); suggestedSort = in.readString(); + mp4Variant = in.readString(); previews = in.createTypedArrayList(Preview.CREATOR); mediaMetadataMap = (Map) in.readValue(getClass().getClassLoader()); gallery = in.createTypedArrayList(Gallery.CREATOR); @@ -512,6 +514,7 @@ public class Post implements Parcelable { dest.writeString(crosspostParentId); dest.writeString(distinguished); dest.writeString(suggestedSort); + dest.writeString(mp4Variant); dest.writeTypedList(previews); dest.writeValue(mediaMetadataMap); dest.writeTypedList(gallery); @@ -581,6 +584,14 @@ public class Post implements Parcelable { this.gallery = gallery; } + public String getMp4Variant() { + return mp4Variant; + } + + public void setMp4Variant(String mp4Variant) { + this.mp4Variant = mp4Variant; + } + @Override public boolean equals(@Nullable Object obj) { if (!(obj instanceof Post)) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/JSONUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/JSONUtils.java index 6ddf5493..800e6d45 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/JSONUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/JSONUtils.java @@ -194,6 +194,7 @@ public class JSONUtils { public static final String HD_KEY = "hd"; public static final String SUGGESTED_SORT_KEY = "suggested_sort"; public static final String P_KEY = "p"; + public static final String VARIANTS_KEY = "variants"; @Nullable public static Map parseMediaMetadata(JSONObject data) { -- cgit v1.2.3