Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ public class CommentInfoItemHolder extends InfoItemHolder {
private static final int COMMENT_DEFAULT_LINES = 2;
private final int commentHorizontalPadding;
private final int commentVerticalPadding;

private final RelativeLayout itemRoot;
private final ImageView itemThumbnailView;
private final TextView itemContentView;
private final ImageView itemThumbsUpView;
private final TextView itemLikesCountView;
private final TextView itemTitleView;

private final TextView itemEditedView;
private final ImageView itemHeartView;
private final ImageView itemPinnedView;
private final Button repliesButton;
Expand All @@ -60,6 +61,7 @@ public CommentInfoItemHolder(final InfoItemBuilder infoItemBuilder,
itemThumbsUpView = itemView.findViewById(R.id.detail_thumbs_up_img_view);
itemLikesCountView = itemView.findViewById(R.id.detail_thumbs_up_count_view);
itemTitleView = itemView.findViewById(R.id.itemTitleView);
itemEditedView = itemView.findViewById(R.id.comment_edited_text);
itemHeartView = itemView.findViewById(R.id.detail_heart_image_view);
itemPinnedView = itemView.findViewById(R.id.detail_pinned_view);
repliesButton = itemView.findViewById(R.id.replies_button);
Expand Down Expand Up @@ -101,6 +103,10 @@ public void updateFromItem(final InfoItem infoItem,

// setup the top row, with pinned icon, author name and comment date
itemPinnedView.setVisibility(item.isPinned() ? View.VISIBLE : View.GONE);

// setup the top row, with edited text, author name and comment date
itemEditedView.setVisibility(item.isEdited() ? View.VISIBLE : View.GONE);

Comment on lines +106 to +109

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// setup the top row, with edited text, author name and comment date
itemEditedView.setVisibility(item.isEdited() ? View.VISIBLE : View.GONE);
itemEditedView.setVisibility(item.isEdited() ? View.VISIBLE : View.GONE);

final String uploaderName = Localization.localizeUserName(item.getUploaderName());
itemTitleView.setText(Localization.concatenateStrings(
uploaderName,
Expand Down
16 changes: 15 additions & 1 deletion app/src/main/res/layout/list_comment_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

<org.schabi.newpipe.views.NewPipeTextView
android:id="@+id/itemTitleView"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toEndOf="@+id/detail_pinned_view"
Expand All @@ -44,6 +44,20 @@
android:textSize="@dimen/comment_item_title_text_size"
tools:text="Author Name, Lorem ipsum • 5 months ago" />

<TextView

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use org.schabi.newpipe.views.NewPipeTextView

android:id="@+id/comment_edited_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@+id/itemTitleView"
android:layout_alignBaseline="@+id/itemTitleView"
android:layout_marginStart="4dp"
android:ellipsize="end"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="@dimen/comment_item_title_text_size"
android:visibility="gone"
android:text="(edited)" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be a string resource in values/strings.xml in order to be translatable.



<org.schabi.newpipe.views.NewPipeTextView
android:id="@+id/itemCommentContentView"
android:layout_width="match_parent"
Expand Down
Loading