Fixes community names on CompactLayout and User posts page

Replaced the reddit specific "r/" prefix. Closes #26
This commit is contained in:
Balazs Toldi 2023-07-29 20:32:33 +02:00
parent 5e4793bdaf
commit e9ecae117d
No known key found for this signature in database
GPG Key ID: 6C7D440036F99D58
3 changed files with 3 additions and 3 deletions

View File

@ -190,7 +190,7 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment
if (holder instanceof CommentViewHolder) {
Comment comment = getItem(holder.getBindingAdapterPosition());
if (comment != null) {
String name = "r/" + comment.getCommunityName();
String name = comment.getCommunityQualifiedName();
((CommentViewHolder) holder).authorTextView.setText(name);
((CommentViewHolder) holder).authorTextView.setTextColor(mSubredditColor);

View File

@ -1155,7 +1155,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
if (mHideSubredditAndUserPrefix) {
((PostCompactBaseViewHolder) holder).nameTextView.setText(post.getSubredditName());
} else {
((PostCompactBaseViewHolder) holder).nameTextView.setText("r/" + post.getSubredditName());
((PostCompactBaseViewHolder) holder).nameTextView.setText(post.getSubredditNamePrefixed());
}
} else {
if (post.getAuthorIconUrl() == null) {

View File

@ -298,7 +298,7 @@ public class ParseComment {
String commentRawText = commentObj.getString("content");
String linkId = postObj.getString("id");
String communityName = communityObj.getString("name");
String communityQualifiedName = communityObj.getString("actor_id");
String communityQualifiedName = LemmyUtils.actorID2FullName(communityObj.getString("actor_id"));
int score = countsObj.getInt("score");
int voteType = (jsonObject.isNull("my_vote")) ? 0 : jsonObject.getInt("my_vote");