Fixed subscribe error in SubredditListingFragment.

This commit is contained in:
Alex Ning 2019-10-28 17:57:18 +08:00
parent 4085c0c40c
commit 8d5bf2c646
2 changed files with 5 additions and 5 deletions

View File

@ -121,7 +121,7 @@ public class SubredditListingRecyclerViewAdapter extends PagedListAdapter<Subred
((DataViewHolder) holder).subscribeButton.setVisibility(View.VISIBLE);
((DataViewHolder) holder).subscribeButton.setOnClickListener(view -> {
SubredditSubscription.subscribeToSubreddit(oauthRetrofit, retrofit,
accessToken, accountName, subredditData.getName(), redditDataRoomDatabase,
accessToken, subredditData.getName(), accountName, redditDataRoomDatabase,
new SubredditSubscription.SubredditSubscriptionListener() {
@Override
public void onSubredditSubscriptionSuccess() {

View File

@ -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);
}