Fixed displaying wrong score.

This commit is contained in:
Alex Ning 2019-09-09 11:17:58 +08:00
parent 313eb77ddc
commit 3bb5e83d2e
3 changed files with 2 additions and 5 deletions

View File

@ -521,7 +521,7 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
((CommentViewHolder) holder).commentTimeTextView.setText(comment.getCommentTime());
mMarkwon.setMarkdown(((CommentViewHolder) holder).commentMarkdownView, comment.getCommentContent());
((CommentViewHolder) holder).scoreTextView.setText(Integer.toString(comment.getScore()));
((CommentViewHolder) holder).scoreTextView.setText(Integer.toString(comment.getScore() + comment.getVoteType()));
ViewGroup.LayoutParams params = ((CommentViewHolder) holder).verticalBlock.getLayoutParams();
params.width = comment.getDepth() * 16;

View File

@ -133,7 +133,7 @@ class CommentsListingRecyclerViewAdapter extends PagedListAdapter<CommentData, R
mMarkwon.setMarkdown(((DataViewHolder) holder).commentMarkdownView, comment.getCommentContent());
((DataViewHolder) holder).scoreTextView.setText(Integer.toString(comment.getScore()));
((DataViewHolder) holder).scoreTextView.setText(Integer.toString(comment.getScore() + comment.getVoteType()));
switch (comment.getVoteType()) {
case 1:

View File

@ -1,7 +1,6 @@
package ml.docilealligator.infinityforreddit;
import android.os.AsyncTask;
import android.util.Log;
import androidx.annotation.NonNull;
@ -69,14 +68,12 @@ class SubredditSubscription {
}
subredditSubscriptionListener.onSubredditSubscriptionSuccess();
} else {
Log.i("call failed", response.message());
subredditSubscriptionListener.onSubredditSubscriptionFail();
}
}
@Override
public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) {
Log.i("call failed", t.getMessage());
subredditSubscriptionListener.onSubredditSubscriptionFail();
}
});