From 3a58964d6cdde4435fb257542e89fea6de501dba Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Thu, 21 Feb 2019 12:37:58 +0800 Subject: Fixed loading more comments even though there are no more comments. --- .../main/java/ml/docilealligator/infinityforreddit/ParseComment.java | 1 - .../ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'app/src/main/java/ml') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseComment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseComment.java index 33b83084..92b5f10b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseComment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseComment.java @@ -191,7 +191,6 @@ class ParseComment { commaSeparatedChildren.deleteCharAt(commaSeparatedChildren.length() - 1); parseFailed = false; } catch (JSONException e) { - parseMoreCommentBasicInfoListener.onParseMoreCommentBasicInfoFailed(); parseFailed = true; e.printStackTrace(); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java index 181700cd..51e9fd31 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java @@ -494,7 +494,9 @@ public class ViewPostDetailActivity extends AppCompatActivity { mRecyclerView.setAdapter(mAdapter); mCommentCardView.setVisibility(View.VISIBLE); - fetchMoreComment(); + if(!mCommaSeparatedChildren.equals("")) { + fetchMoreComment(); + } } else { mNoCommentWrapperLinearLayout.setVisibility(View.VISIBLE); glide.load(R.drawable.no_comment_indicator).into(mNoCommentImageView); -- cgit v1.2.3