From d0430e6842af66a30786200714e32f9125e67127 Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Fri, 24 Nov 2023 22:13:51 -0500 Subject: Remove some markdown processing related to inline gifs. Remove awards related stuff. --- .../activities/ViewPostDetailActivity.java | 9 --- .../CommentsListingRecyclerViewAdapter.java | 13 ----- .../adapters/CommentsRecyclerViewAdapter.java | 24 -------- .../infinityforreddit/comment/Comment.java | 14 +---- .../infinityforreddit/comment/ParseComment.java | 23 +------- .../fragments/ViewPostDetailFragment.java | 6 -- .../infinityforreddit/post/ParsePost.java | 55 +++++++----------- .../infinityforreddit/post/Post.java | 4 +- .../infinityforreddit/utils/JSONUtils.java | 1 - .../utils/SharedPreferencesUtils.java | 2 +- .../infinityforreddit/utils/Utils.java | 65 ---------------------- app/src/main/res/layout/item_comment.xml | 12 ---- app/src/main/res/values-cs/strings.xml | 1 - app/src/main/res/values-de/strings.xml | 1 - app/src/main/res/values-el/strings.xml | 1 - app/src/main/res/values-es/strings.xml | 1 - app/src/main/res/values-fr/strings.xml | 1 - app/src/main/res/values-it/strings.xml | 1 - app/src/main/res/values-pl/strings.xml | 1 - app/src/main/res/values-pt-rBR/strings.xml | 1 - app/src/main/res/values-ro/strings.xml | 1 - app/src/main/res/values-ru/strings.xml | 1 - app/src/main/res/values-tr-rTR/strings.xml | 1 - app/src/main/res/values-uk/strings.xml | 1 - app/src/main/res/values-zh-rCN/strings.xml | 1 - app/src/main/res/values/strings.xml | 1 - app/src/main/res/xml/comment_preferences.xml | 5 -- 27 files changed, 25 insertions(+), 222 deletions(-) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java index e88f9e22..bd2d6ed4 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java @@ -421,15 +421,6 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele } } - private void awardGiven(String awardsHTML, int awardCount, int position) { - if (sectionsPagerAdapter != null) { - ViewPostDetailFragment fragment = sectionsPagerAdapter.getCurrentFragment(); - if (fragment != null) { - fragment.awardGiven(awardsHTML, awardCount, position); - } - } - } - public void deleteComment(String fullName, int position) { if (sectionsPagerAdapter != null) { ViewPostDetailFragment fragment = sectionsPagerAdapter.getCurrentFragment(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsListingRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsListingRecyclerViewAdapter.java index d947a370..f9a445dd 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsListingRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsListingRecyclerViewAdapter.java @@ -240,11 +240,6 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter mediaMetadataMap) { this.id = id; this.fullName = fullName; @@ -87,7 +86,6 @@ public class Comment implements Parcelable { this.isSubmitter = isSubmitter; this.distinguished = distinguished; this.permalink = APIUtils.API_BASE_URI + permalink; - this.awards = awards; this.depth = depth; this.collapsed = collapsed; this.hasReply = hasReply; @@ -136,7 +134,6 @@ public class Comment implements Parcelable { isSubmitter = in.readByte() != 0; distinguished = in.readString(); permalink = in.readString(); - awards = in.readString(); depth = in.readInt(); childCount = in.readInt(); collapsed = in.readByte() != 0; @@ -258,14 +255,6 @@ public class Comment implements Parcelable { return permalink; } - public String getAwards() { - return awards; - } - - public void addAwards(String newAwardsHTML) { - awards += newAwardsHTML; - } - public int getDepth() { return depth; } @@ -440,7 +429,6 @@ public class Comment implements Parcelable { parcel.writeByte((byte) (isSubmitter ? 1 : 0)); parcel.writeString(distinguished); parcel.writeString(permalink); - parcel.writeString(awards); parcel.writeInt(depth); parcel.writeInt(childCount); parcel.writeByte((byte) (collapsed ? 1 : 0)); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/comment/ParseComment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/comment/ParseComment.java index d08bebd1..e37bf304 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/comment/ParseComment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/comment/ParseComment.java @@ -272,31 +272,12 @@ public class ParseComment { String commentMarkdown = ""; if (!singleCommentData.isNull(JSONUtils.BODY_KEY)) { commentMarkdown = Utils.parseInlineRedditImages( - Utils.parseInlineGifInComments( Utils.modifyMarkdown( - Utils.trimTrailingWhitespace(singleCommentData.getString(JSONUtils.BODY_KEY))))); - if (!singleCommentData.isNull(JSONUtils.MEDIA_METADATA_KEY)) { - JSONObject mediaMetadataObject = singleCommentData.getJSONObject(JSONUtils.MEDIA_METADATA_KEY); - commentMarkdown = Utils.parseInlineEmotes(commentMarkdown, mediaMetadataObject); - } + Utils.trimTrailingWhitespace(singleCommentData.getString(JSONUtils.BODY_KEY)))); } String commentRawText = Utils.trimTrailingWhitespace( Html.fromHtml(singleCommentData.getString(JSONUtils.BODY_HTML_KEY))).toString(); String permalink = Html.fromHtml(singleCommentData.getString(JSONUtils.PERMALINK_KEY)).toString(); - StringBuilder awardingsBuilder = new StringBuilder(); - JSONArray awardingsArray = singleCommentData.getJSONArray(JSONUtils.ALL_AWARDINGS_KEY); - for (int i = 0; i < awardingsArray.length(); i++) { - JSONObject award = awardingsArray.getJSONObject(i); - int count = award.getInt(JSONUtils.COUNT_KEY); - JSONArray icons = award.getJSONArray(JSONUtils.RESIZED_ICONS_KEY); - if (icons.length() > 4) { - String iconUrl = icons.getJSONObject(3).getString(JSONUtils.URL_KEY); - awardingsBuilder.append(" ").append("x").append(count).append(" "); - } else if (icons.length() > 0) { - String iconUrl = icons.getJSONObject(icons.length() - 1).getString(JSONUtils.URL_KEY); - awardingsBuilder.append(" ").append("x").append(count).append(" "); - } - } int score = singleCommentData.getInt(JSONUtils.SCORE_KEY); int voteType; if (singleCommentData.isNull(JSONUtils.LIKES_KEY)) { @@ -324,7 +305,7 @@ public class ParseComment { return new Comment(id, fullName, author, authorFlair, authorFlairHTMLBuilder.toString(), linkAuthor, submitTime, commentMarkdown, commentRawText, linkId, subredditName, parentId, score, voteType, isSubmitter, distinguished, - permalink, awardingsBuilder.toString(), depth, collapsed, hasReply, scoreHidden, saved, edited, + permalink, depth, collapsed, hasReply, scoreHidden, saved, edited, mediaMetadataMap); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java index 902bffca..1e1c32db 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java @@ -793,12 +793,6 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic } } - public void awardGiven(String awardsHTML, int awardCount, int position) { - if (mCommentsAdapter != null) { - mCommentsAdapter.giveAward(awardsHTML, awardCount, position); - } - } - public void changeFlair(Flair flair) { Map params = new HashMap<>(); params.put(APIUtils.API_TYPE_KEY, APIUtils.API_TYPE_JSON); 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 81e95c0c..31a1f139 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java @@ -187,23 +187,6 @@ public class ParsePost { if (flair.equals("") && data.has(JSONUtils.LINK_FLAIR_TEXT_KEY) && !data.isNull(JSONUtils.LINK_FLAIR_TEXT_KEY)) { flair = data.getString(JSONUtils.LINK_FLAIR_TEXT_KEY); } - - StringBuilder awardingsBuilder = new StringBuilder(); - JSONArray awardingsArray = data.getJSONArray(JSONUtils.ALL_AWARDINGS_KEY); - int nAwards = 0; - for (int i = 0; i < awardingsArray.length(); i++) { - JSONObject award = awardingsArray.getJSONObject(i); - int count = award.getInt(JSONUtils.COUNT_KEY); - nAwards += count; - JSONArray icons = award.getJSONArray(JSONUtils.RESIZED_ICONS_KEY); - if (icons.length() > 4) { - String iconUrl = icons.getJSONObject(3).getString(JSONUtils.URL_KEY); - awardingsBuilder.append(" ").append("x").append(count).append(" "); - } else if (icons.length() > 0) { - String iconUrl = icons.getJSONObject(icons.length() - 1).getString(JSONUtils.URL_KEY); - awardingsBuilder.append(" ").append("x").append(count).append(" "); - } - } if (data.isNull(JSONUtils.LIKES_KEY)) { voteType = 0; @@ -242,7 +225,7 @@ public class ParsePost { Post post = parseData(data, permalink, id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTMLBuilder.toString(), postTime, title, previews, mediaMetadataMap, - score, voteType, nComments, upvoteRatio, flair, awardingsBuilder.toString(), nAwards, hidden, + score, voteType, nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, deleted, removed, true, distinguished, suggestedSort); post.setCrosspostParentId(crosspostParent.getId()); @@ -251,7 +234,7 @@ public class ParsePost { return parseData(data, permalink, id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTMLBuilder.toString(), postTime, title, previews, mediaMetadataMap, - score, voteType, nComments, upvoteRatio, flair, awardingsBuilder.toString(), nAwards, hidden, + score, voteType, nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, deleted, removed, false, distinguished, suggestedSort); } @@ -302,7 +285,7 @@ public class ParsePost { String authorFlair, String authorFlairHTML, long postTimeMillis, String title, ArrayList previews, Map mediaMetadataMap, int score, int voteType, int nComments, int upvoteRatio, String flair, - String awards, int nAwards, boolean hidden, boolean spoiler, boolean nsfw, + boolean hidden, boolean spoiler, boolean nsfw, boolean stickied, boolean archived, boolean locked, boolean saved, boolean deleted, boolean removed, boolean isCrosspost, String distinguished, String suggestedSort) throws JSONException { @@ -319,7 +302,7 @@ public class ParsePost { int postType = Post.TEXT_TYPE; post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTML, postTimeMillis, title, permalink, score, postType, - voteType, nComments, upvoteRatio, flair, awards, nAwards, hidden, spoiler, nsfw, + voteType, nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost, distinguished, suggestedSort); } else { if (path.endsWith(".jpg") || path.endsWith(".png") || path.endsWith(".jpeg")) { @@ -328,7 +311,7 @@ public class ParsePost { post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score, - postType, voteType, nComments, upvoteRatio, flair, awards, nAwards, hidden, + postType, voteType, nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost, distinguished, suggestedSort); if (previews.isEmpty()) { @@ -352,7 +335,7 @@ public class ParsePost { post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTML, postTimeMillis, title, permalink, score, postType, voteType, - nComments, upvoteRatio, flair, awards, nAwards, hidden, spoiler, nsfw, stickied, + nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost, distinguished, suggestedSort); post.setVideoUrl(videoUrl); @@ -362,7 +345,7 @@ public class ParsePost { int postType = Post.NO_PREVIEW_LINK_TYPE; post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score, - postType, voteType, nComments, upvoteRatio, flair, awards, nAwards, hidden, + postType, voteType, nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost, distinguished, suggestedSort); if (data.isNull(JSONUtils.SELFTEXT_KEY)) { post.setSelfText(""); @@ -426,7 +409,7 @@ public class ParsePost { post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTML, postTimeMillis, title, permalink, score, postType, voteType, - nComments, upvoteRatio, flair, awards, nAwards, hidden, spoiler, nsfw, stickied, + nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost, distinguished, suggestedSort); post.setPreviews(previews); @@ -444,7 +427,7 @@ public class ParsePost { post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTML, postTimeMillis, title, permalink, score, postType, voteType, - nComments, upvoteRatio, flair, awards, nAwards, hidden, spoiler, nsfw, stickied, + nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost, distinguished, suggestedSort); post.setPreviews(previews); post.setVideoUrl(url); @@ -460,7 +443,7 @@ public class ParsePost { post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTML, postTimeMillis, title, permalink, score, postType, voteType, - nComments, upvoteRatio, flair, awards, nAwards, hidden, spoiler, nsfw, stickied, + nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost, distinguished, suggestedSort); post.setPreviews(previews); post.setVideoUrl(videoUrl); @@ -473,7 +456,7 @@ public class ParsePost { post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score, - postType, voteType, nComments, upvoteRatio, flair, awards, nAwards, + postType, voteType, nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost, distinguished, suggestedSort); @@ -493,7 +476,7 @@ public class ParsePost { int postType = Post.GIF_TYPE; post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score, - postType, voteType, nComments, upvoteRatio, flair, awards, nAwards, + postType, voteType, nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost, distinguished, suggestedSort); @@ -509,7 +492,7 @@ public class ParsePost { post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score, - postType, voteType, nComments, upvoteRatio, flair, awards, nAwards, + postType, voteType, nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost, distinguished, suggestedSort); post.setPreviews(previews); @@ -522,7 +505,7 @@ public class ParsePost { post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score, - postType, voteType, nComments, upvoteRatio, flair, awards, nAwards, + postType, voteType, nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost, distinguished, suggestedSort); post.setPreviews(previews); @@ -535,7 +518,7 @@ public class ParsePost { post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTML, postTimeMillis, title, permalink, score, - postType, voteType, nComments, upvoteRatio, flair, awards, nAwards, + postType, voteType, nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost, distinguished, suggestedSort); @@ -547,7 +530,7 @@ public class ParsePost { post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score, - postType, voteType, nComments, upvoteRatio, flair, awards, nAwards, + postType, voteType, nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost, distinguished, suggestedSort); if (data.isNull(JSONUtils.SELFTEXT_KEY)) { @@ -591,7 +574,7 @@ public class ParsePost { post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score, - postType, voteType, nComments, upvoteRatio, flair, awards, nAwards, hidden, + postType, voteType, nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost, distinguished, suggestedSort); if (previews.isEmpty()) { @@ -611,7 +594,7 @@ public class ParsePost { post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score, - postType, voteType, nComments, upvoteRatio, flair, awards, nAwards, hidden, + postType, voteType, nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost, distinguished, suggestedSort); post.setPreviews(previews); post.setVideoUrl(url); @@ -622,7 +605,7 @@ public class ParsePost { post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score, - postType, voteType, nComments, upvoteRatio, flair, awards, nAwards, hidden, + postType, voteType, nComments, upvoteRatio, flair, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost, distinguished, suggestedSort); //Need attention if (data.isNull(JSONUtils.SELFTEXT_KEY)) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/Post.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/Post.java index 930f7225..bdf1ef27 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/Post.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/Post.java @@ -79,7 +79,7 @@ public class Post implements Parcelable { public Post(String id, String fullName, String subredditName, String subredditNamePrefixed, String author, String authorFlair, String authorFlairHTML, long postTimeMillis, String title, String permalink, int score, int postType, int voteType, int nComments, - int upvoteRatio, String flair, String awards, int nAwards, boolean hidden, boolean spoiler, + int upvoteRatio, String flair, boolean hidden, boolean spoiler, boolean nsfw, boolean stickied, boolean archived, boolean locked, boolean saved, boolean isCrosspost, String distinguished, String suggestedSort) { this.id = id; @@ -115,7 +115,7 @@ public class Post implements Parcelable { public Post(String id, String fullName, String subredditName, String subredditNamePrefixed, String author, String authorFlair, String authorFlairHTML, long postTimeMillis, String title, String url, String permalink, int score, int postType, int voteType, int nComments, - int upvoteRatio, String flair, String awards, int nAwards, boolean hidden, boolean spoiler, + int upvoteRatio, String flair, boolean hidden, boolean spoiler, boolean nsfw, boolean stickied, boolean archived, boolean locked, boolean saved, boolean isCrosspost, String distinguished, String suggestedSort) { this.id = id; 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 c43608be..79182378 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/JSONUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/JSONUtils.java @@ -109,7 +109,6 @@ public class JSONUtils { public static final String IS_FAVORITED_KEY = "is_favorited"; public static final String SUBREDDITS_KEY = "subreddits"; public static final String PATH_KEY = "path"; - public static final String ALL_AWARDINGS_KEY = "all_awardings"; public static final String RESIZED_ICONS_KEY = "resized_icons"; public static final String GFY_ITEM_KEY = "gfyItem"; public static final String MP4_URL_KEY = "mp4Url"; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java index 684d9468..de2e72d4 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java @@ -205,7 +205,6 @@ public class SharedPreferencesUtils { public static final String PINCH_TO_ZOOM_VIDEO = "pinch_to_zoom_video"; public static final String FIXED_HEIGHT_PREVIEW_IN_CARD = "fixed_height_preview_in_card"; public static final String HIDE_TEXT_POST_CONTENT = "hide_text_post_content"; - public static final String HIDE_COMMENT_AWARDS = "hide_comment_awards"; public static final String SHOW_FEWER_TOOLBAR_OPTIONS_THRESHOLD = "show_fewer_toolbar_options_threshold"; public static final String SHOW_AUTHOR_AVATAR = "show_author_avatar"; public static final String ALWAYS_SHOW_CHILD_COMMENT_COUNT = "always_show_child_comment_count"; @@ -395,4 +394,5 @@ public class SharedPreferencesUtils { public static final String DO_NOT_SHOW_REDDIT_API_INFO_AGAIN_LEGACY = "do_not_show_reddit_api_info_again"; public static final String HIDE_THE_NUMBER_OF_AWARDS_LEGACY = "hide_the_number_of_awards"; + public static final String HIDE_COMMENT_AWARDS_LEGACY = "hide_comment_awards"; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java index d6b3ed6c..2fb4cfb0 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java @@ -39,7 +39,6 @@ import com.google.android.material.tabs.TabLayout; import com.google.android.material.textfield.TextInputLayout; import org.json.JSONException; -import org.json.JSONObject; import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; @@ -86,70 +85,6 @@ public final class Utils { return regexed; } - public static String parseInlineGifInComments(String markdown) { - /*StringBuilder markdownStringBuilder = new StringBuilder(markdown); - Pattern inlineGifPattern = REGEX_PATTERNS[3]; - Matcher matcher = inlineGifPattern.matcher(markdownStringBuilder); - while (matcher.find()) { - markdownStringBuilder.replace(matcher.start(), matcher.end(), "![gif](https://i.giphy.com/media/" + markdownStringBuilder.substring(matcher.start() + "![gif](giphy|".length(), matcher.end() - 1) + "/giphy.mp4)"); - matcher = inlineGifPattern.matcher(markdownStringBuilder); - } - - Pattern inlineGifPattern2 = REGEX_PATTERNS[4]; - Matcher matcher2 = inlineGifPattern2.matcher(markdownStringBuilder); - while (matcher2.find()) { - markdownStringBuilder.replace(matcher2.start(), matcher2.end(), "![gif](https://i.giphy.com/media/" + markdownStringBuilder.substring(matcher2.start() + "![gif](giphy|".length(), matcher2.end() - "|downsized\\)".length() + 1) + "/giphy.mp4)"); - matcher2 = inlineGifPattern2.matcher(markdownStringBuilder); - } - - Pattern inlineGifPattern3 = REGEX_PATTERNS[5]; - Matcher matcher3 = inlineGifPattern3.matcher(markdownStringBuilder); - while (matcher3.find()) { - markdownStringBuilder.replace(matcher3.start(), matcher3.end(), - "![emote](https://reddit-meta-production.s3.amazonaws.com/public/fortnitebr/emotes/snoomoji_emotes/" - + markdownStringBuilder.substring( - matcher3.start() + "![emote](emote|".length(), matcher3.end() - 1).replace('|', '/') + ".gif)"); - matcher3 = inlineGifPattern3.matcher(markdownStringBuilder); - } - - return markdownStringBuilder.toString();*/ - return markdown; - } - - public static String parseInlineEmotes(String markdown, JSONObject mediaMetadataObject) throws JSONException { - /*JSONArray mediaMetadataNames = mediaMetadataObject.names(); - if (mediaMetadataNames != null) { - for (int i = 0; i < mediaMetadataNames.length(); i++) { - if (!mediaMetadataNames.isNull(i)) { - String mediaMetadataKey = mediaMetadataNames.getString(i); - if (mediaMetadataObject.isNull(mediaMetadataKey)) { - continue; - } - JSONObject item = mediaMetadataObject.getJSONObject(mediaMetadataKey); - if (item.isNull(JSONUtils.STATUS_KEY) - || !item.getString(JSONUtils.STATUS_KEY).equals("valid") - || item.isNull(JSONUtils.ID_KEY) - || item.isNull(JSONUtils.T_KEY) - || item.isNull(JSONUtils.S_KEY)) { - continue; - } - String emote_type = item.getString(JSONUtils.T_KEY); - String emote_id = item.getString(JSONUtils.ID_KEY); - - JSONObject s_key = item.getJSONObject(JSONUtils.S_KEY); - if (s_key.isNull(JSONUtils.U_KEY)) { - continue; - } - String emote_url = s_key.getString(JSONUtils.U_KEY); - - markdown = markdown.replace("![img](" + emote_id + ")", "[" + emote_type + "](" + emote_url + ") "); - } - } - } - return markdown;*/ - return markdown; - } - public static String parseInlineRedditImages(String markdown) { StringBuilder markdownStringBuilder = new StringBuilder(markdown); Pattern inlineRedditImagePattern = REGEX_PATTERNS[6]; diff --git a/app/src/main/res/layout/item_comment.xml b/app/src/main/res/layout/item_comment.xml index 6c981463..c7c499be 100644 --- a/app/src/main/res/layout/item_comment.xml +++ b/app/src/main/res/layout/item_comment.xml @@ -124,18 +124,6 @@ - - "Vlastní rodina obsahových písem" "Pevná výška karty" "Skrýt obsah textového příspěvku" - "Schovat " "Zobrazit méně možností na liště nástrojů" diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 1424031c..71953729 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -1252,7 +1252,6 @@ Antippen zum Wiederholen." "Benutzerdefinierte Inhaltschriftart-familie" "Festgestellte Höhe in Kartenansicht" "Text-Post Inhalt verstecken" - "Kommentarauszeichnungen verstecken" "Weniger Werkzeugleistenoptionen anzeigen" diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 7cc39f15..d8dc0daf 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -1141,7 +1141,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd "Προσαρμοσμένη Γραμματοσειρά Περιεχομένου" "Σταθερό Ύψος στην Κάρτα" "Απόκρυψη Περιεχομένου Κειμένου Ανάρτησης" - "Απόκρυψη Βραβείων Σχολίου" "Εμφάνιση Λιγότερων Επιλογών Γραμμής Εργαλείων Ξεκινώντας από" Επίπεδο %1$d "Εμφάνιση Άβαταρ Συντάκτη" diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index f7d1c719..141786fd 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -1261,7 +1261,6 @@ Toque para volver a intentarlo." "Familia de fuente del contenido personalizada" "Altura fija en tarjeta" "Ocultar contenido de publicación de texto" - "Ocultar premios del comentario" "Mostrar menos opciones de la barra de herramientas a partir de" diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 666d73e3..d49b466e 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -1333,7 +1333,6 @@ Cliquer pour réessayer." "Figés la Hauteur des cartes" "Masquer le Contenu de l'Article Textuel" - "Cacher les récompenses sur des commentaires" "Afficher moins d'option dans la barre d'outil à partir de" diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 7130cfdd..3dc16098 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -1145,7 +1145,6 @@ Premi per riprovare." "Famiglia di caratteri contenuto personalizzato" "Altezza fissa nella scheda" "Nascondi il contenuto del post di testo" - "Nascondi i premi dei commenti" "Mostra meno opzioni della barra degli strumenti a partire da" "Livello %1$d" "Mostra avatar dell'autore" diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 18f0a027..82a8d2f5 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -1175,7 +1175,6 @@ Brak podglądu w Ostatnich aplikacjach." "Własna czcionka zawartości" - "Ukryj nagrody komentarza" "Poziom %1$d" diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 73364184..187b8f28 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -1187,7 +1187,6 @@ Toque para tentar de novo." "Família da fonte de conteúdo customizada" "Altura fixa em cartão" "Ocultar texto do conteúdo da postagem" - "Ocultar prêmios de comentário" "Exibir menos opções na barra de ferramentas a partir de" diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 405cf27e..6b137ad3 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -1203,7 +1203,6 @@ Apasă pentru a reîncerca." "Familia de Fonturi Personalizată pentru Conținut" "Înălțime Fixată în Aspect Card" "Ascunde Conținutul Postărilor Text" - "Ascunde Premiile Comentariilor" "Arată mai Puține Opțiuni din Bara de Instrumente Începând cu" diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index dcbf0146..2a28699d 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -1221,7 +1221,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd "Пользовательское семейство шрифтов содержания" "Фиксированная высота карточки" "Скрыть содержание текстового поста" - "Скрыть награды за комментарии" "Показывать меньше параметров панели инструментов, начиная с" diff --git a/app/src/main/res/values-tr-rTR/strings.xml b/app/src/main/res/values-tr-rTR/strings.xml index 046bcbeb..8236305b 100644 --- a/app/src/main/res/values-tr-rTR/strings.xml +++ b/app/src/main/res/values-tr-rTR/strings.xml @@ -1231,7 +1231,6 @@ Tekrar denemek için tıklayın." "Özel İçerik Yazı Tipi Ailesi" "Karttaki Sabit Yükseklik" "Metin Gönderisi İçeriğini Gizle" - "Yorum Ödüllerini Gizle" "Daha Az Araç Çubuğu Seçeneği Göster" diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index c097c267..f7943ae3 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -1205,7 +1205,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd "Власне сімейство шрифтів для вмісту" "Фіксована висота карток" "Ховати текст вмісту дописів" - "Ховати нагороди коментарів" "Показувати менше параметрів панелі засобів починаючи з" diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index e97b8a3a..36b2fc7d 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -1222,7 +1222,6 @@ Reddit 视频分辨率较低。 "自定义正文字体" "卡片固定高度" "隐藏文字帖内容" - "隐藏评论奖励" "自何处开始显示更少的工具栏选项" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1b66885f..5767b9aa 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -635,7 +635,6 @@ Custom Content Font Family Fixed Height in Card Hide Text Post Content - Hide Comment Awards Show Fewer Toolbar Options Starting From Level %1$d Show Author Avatar diff --git a/app/src/main/res/xml/comment_preferences.xml b/app/src/main/res/xml/comment_preferences.xml index caf95e8f..bfd4237a 100644 --- a/app/src/main/res/xml/comment_preferences.xml +++ b/app/src/main/res/xml/comment_preferences.xml @@ -46,11 +46,6 @@ app:key="show_author_avatar" android:title="@string/settings_show_author_avatar_title" /> - -