mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 12:47:26 +01:00
Show author icon in CommentFullyCollapsedViewHolder.
This commit is contained in:
parent
db48b940d7
commit
fd0e95dbac
@ -519,6 +519,26 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
if (comment != null) {
|
||||
String authorWithPrefix = "u/" + comment.getAuthor();
|
||||
((CommentFullyCollapsedViewHolder) holder).usernameTextView.setText(authorWithPrefix);
|
||||
|
||||
if (comment.getAuthorIconUrl() == null) {
|
||||
mFragment.loadIcon(comment.getAuthor(), (authorName, iconUrl) -> {
|
||||
if (authorName.equals(comment.getAuthor())) {
|
||||
mGlide.load(iconUrl)
|
||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||
.error(mGlide.load(R.drawable.subreddit_default_icon)
|
||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
||||
.into(((CommentFullyCollapsedViewHolder) holder).authorIconImageView);
|
||||
comment.setAuthorIconUrl(iconUrl);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
mGlide.load(comment.getAuthorIconUrl())
|
||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||
.error(mGlide.load(R.drawable.subreddit_default_icon)
|
||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
||||
.into(((CommentFullyCollapsedViewHolder) holder).authorIconImageView);
|
||||
}
|
||||
|
||||
if (comment.getChildCount() > 0) {
|
||||
((CommentFullyCollapsedViewHolder) holder).childCountTextView.setVisibility(View.VISIBLE);
|
||||
((CommentFullyCollapsedViewHolder) holder).childCountTextView.setText("+" + comment.getChildCount());
|
||||
@ -1610,6 +1630,8 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
class CommentFullyCollapsedViewHolder extends RecyclerView.ViewHolder {
|
||||
@BindView(R.id.vertical_block_indentation_item_comment_fully_collapsed)
|
||||
CommentIndentationView commentIndentationView;
|
||||
@BindView(R.id.author_icon_image_view_item_comment_fully_collapsed)
|
||||
ImageView authorIconImageView;
|
||||
@BindView(R.id.user_name_text_view_item_comment_fully_collapsed)
|
||||
TextView usernameTextView;
|
||||
@BindView(R.id.child_count_text_view_item_comment_fully_collapsed)
|
||||
|
@ -14,7 +14,7 @@
|
||||
android:id="@+id/linear_layout_item_comment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="vertical"
|
||||
android:animateLayoutChanges="true">
|
||||
|
||||
|
@ -15,16 +15,24 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/author_icon_image_view_item_comment_fully_collapsed"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_vertical" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_name_text_view_item_comment_fully_collapsed"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:fontFamily="?attr/font_family"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingBottom="12dp"
|
||||
@ -34,6 +42,7 @@
|
||||
android:id="@+id/child_count_text_view_item_comment_fully_collapsed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:fontFamily="?attr/font_family"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="12dp"
|
||||
@ -45,6 +54,7 @@
|
||||
android:id="@+id/score_text_view_item_comment_fully_collapsed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:fontFamily="?attr/font_family"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingTop="12dp"
|
||||
@ -56,7 +66,7 @@
|
||||
android:id="@+id/time_text_view_item_comment_fully_collapsed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:fontFamily="?attr/font_family"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingTop="12dp"
|
||||
|
Loading…
Reference in New Issue
Block a user