From 8d5bf2c6466c518523ed1068092c09c74d857654 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Mon, 28 Oct 2019 17:57:18 +0800 Subject: Fixed subscribe error in SubredditListingFragment. --- .../Adapter/SubredditListingRecyclerViewAdapter.java | 2 +- .../main/java/ml/docilealligator/infinityforreddit/ParsePost.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/SubredditListingRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/SubredditListingRecyclerViewAdapter.java index ccca819d..21646e8d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/SubredditListingRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/SubredditListingRecyclerViewAdapter.java @@ -121,7 +121,7 @@ public class SubredditListingRecyclerViewAdapter extends PagedListAdapter { SubredditSubscription.subscribeToSubreddit(oauthRetrofit, retrofit, - accessToken, accountName, subredditData.getName(), redditDataRoomDatabase, + accessToken, subredditData.getName(), accountName, redditDataRoomDatabase, new SubredditSubscription.SubredditSubscriptionListener() { @Override public void onSubredditSubscriptionSuccess() { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java index ef79dc90..09259c98 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java @@ -121,8 +121,8 @@ public class ParsePost { } else { String selfTextPlain = Utils.trimTrailingWhitespace( Html.fromHtml(data.getString(JSONUtils.SELFTEXT_HTML_KEY))).toString(); - if (selfTextPlain.length() > 150) { - selfTextPlain = selfTextPlain.substring(150); + if (selfTextPlain.length() > 250) { + selfTextPlain = selfTextPlain.substring(0, 250); } post.setSelfTextPlainTrimmed(selfTextPlain); } @@ -217,8 +217,8 @@ public class ParsePost { } else { String selfTextPlain = Utils.trimTrailingWhitespace( Html.fromHtml(data.getString(JSONUtils.SELFTEXT_HTML_KEY))).toString(); - if (selfTextPlain.length() > 150) { - selfTextPlain = selfTextPlain.substring(150); + if (selfTextPlain.length() > 250) { + selfTextPlain = selfTextPlain.substring(0, 250); } post.setSelfTextPlainTrimmed(selfTextPlain); } -- cgit v1.2.3