1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-25 01:20:34 +00:00

removed dislike button, added comment published time

This commit is contained in:
Ritvik Saraf 2018-12-08 20:32:28 +05:30
parent ccb9bceecc
commit 1a62b9a161
3 changed files with 36 additions and 45 deletions

View File

@ -21,6 +21,7 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder {
private final TextView itemContentView; private final TextView itemContentView;
private final TextView itemLikesCountView; private final TextView itemLikesCountView;
private final TextView itemDislikesCountView; private final TextView itemDislikesCountView;
private final TextView itemPublishedTime;
private static final int commentDefaultLines = 2; private static final int commentDefaultLines = 2;
private static final int commentExpandedLines = 1000; private static final int commentExpandedLines = 1000;
@ -31,6 +32,7 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder {
itemThumbnailView = itemView.findViewById(R.id.itemThumbnailView); itemThumbnailView = itemView.findViewById(R.id.itemThumbnailView);
itemLikesCountView = itemView.findViewById(R.id.detail_thumbs_up_count_view); itemLikesCountView = itemView.findViewById(R.id.detail_thumbs_up_count_view);
itemDislikesCountView = itemView.findViewById(R.id.detail_thumbs_down_count_view); itemDislikesCountView = itemView.findViewById(R.id.detail_thumbs_down_count_view);
itemPublishedTime = itemView.findViewById(R.id.itemPublishedTime);
itemContentView = itemView.findViewById(R.id.itemCommentContentView); itemContentView = itemView.findViewById(R.id.itemCommentContentView);
} }
@ -74,6 +76,7 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder {
if (null != item.getLikeCount()) { if (null != item.getLikeCount()) {
itemLikesCountView.setText(String.valueOf(item.getLikeCount())); itemLikesCountView.setText(String.valueOf(item.getLikeCount()));
} }
itemPublishedTime.setText(item.getPublishedTime());
itemView.setOnClickListener(view -> { itemView.setOnClickListener(view -> {
toggleEllipsize(item.getCommentText()); toggleEllipsize(item.getCommentText());

View File

@ -49,17 +49,6 @@
android:textSize="@dimen/video_item_search_uploader_text_size" android:textSize="@dimen/video_item_search_uploader_text_size"
tools:text="Comment Content, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blanditLorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blanditLorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blandit" /> tools:text="Comment Content, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blanditLorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blanditLorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blandit" />
<!--TextView
android:id="@+id/itemAdditionalDetails"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toEndOf="@+id/itemThumbnailView"
android:layout_toRightOf="@+id/itemThumbnailView"
android:lines="1"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="@dimen/video_item_search_upload_date_text_size"
tools:text="10M subscribers • 1000 videos" /-->
<ImageView <ImageView
android:id="@+id/detail_thumbs_up_img_view" android:id="@+id/detail_thumbs_up_img_view"
@ -77,14 +66,16 @@
android:layout_below="@id/itemCommentContentView" android:layout_below="@id/itemCommentContentView"
android:layout_marginLeft="@dimen/video_item_detail_like_margin" android:layout_marginLeft="@dimen/video_item_detail_like_margin"
android:layout_toRightOf="@id/detail_thumbs_up_img_view" android:layout_toRightOf="@id/detail_thumbs_up_img_view"
android:gravity="center_vertical"
android:lines="1" android:lines="1"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/video_item_detail_likes_text_size" android:textSize="@dimen/video_item_detail_likes_text_size"
tools:ignore="RtlHardcoded" tools:ignore="RtlHardcoded"
tools:text="12M" /> tools:text="12M" />
<ImageView
<!--we can uncomment below code if we need dislike button and count in future-->
<!--<ImageView
android:id="@+id/detail_thumbs_down_img_view" android:id="@+id/detail_thumbs_down_img_view"
android:layout_width="@dimen/video_item_detail_like_image_width" android:layout_width="@dimen/video_item_detail_like_image_width"
android:layout_height="@dimen/video_item_detail_like_image_height" android:layout_height="@dimen/video_item_detail_like_image_height"
@ -107,6 +98,18 @@
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/video_item_detail_likes_text_size" android:textSize="@dimen/video_item_detail_likes_text_size"
tools:ignore="RtlHardcoded" tools:ignore="RtlHardcoded"
tools:text="10K" /> tools:text="10K" />-->
<TextView
android:id="@+id/itemPublishedTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/itemCommentContentView"
android:layout_marginLeft="12dp"
android:layout_toRightOf="@id/detail_thumbs_up_count_view"
android:lines="1"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="@dimen/video_item_search_upload_date_text_size"
tools:text="1 year ago" />
</RelativeLayout> </RelativeLayout>

View File

@ -20,27 +20,11 @@
android:src="@drawable/buddy_channel_item" android:src="@drawable/buddy_channel_item"
tools:ignore="RtlHardcoded"/> tools:ignore="RtlHardcoded"/>
<!--TextView
android:id="@+id/itemTitleView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginBottom="2dp"
android:layout_marginTop="3dp"
android:layout_toRightOf="@+id/itemThumbnailView"
android:ellipsize="end"
android:lines="1"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="@dimen/video_item_search_title_text_size"
tools:ignore="RtlHardcoded"
tools:text="Channel Title, Lorem ipsum"/-->
<TextView <TextView
android:id="@+id/itemCommentContentView" android:id="@+id/itemCommentContentView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginBottom="@dimen/channel_item_description_to_details_margin" android:layout_marginBottom="@dimen/channel_item_description_to_details_margin"
android:layout_toRightOf="@+id/itemThumbnailView" android:layout_toRightOf="@+id/itemThumbnailView"
android:ellipsize="end" android:ellipsize="end"
@ -49,18 +33,6 @@
android:textSize="@dimen/video_item_search_uploader_text_size" android:textSize="@dimen/video_item_search_uploader_text_size"
tools:text="Channel description, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blanditLorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blanditLorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blandit" /> tools:text="Channel description, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blanditLorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blanditLorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blandit" />
<!--TextView
android:id="@+id/itemAdditionalDetails"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/itemTitleView"
android:layout_toRightOf="@+id/itemThumbnailView"
android:lines="1"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="@dimen/video_item_search_upload_date_text_size"
tools:ignore="RtlHardcoded"
tools:text="10M subscribers"/-->
<ImageView <ImageView
android:id="@+id/detail_thumbs_up_img_view" android:id="@+id/detail_thumbs_up_img_view"
android:layout_width="@dimen/video_item_detail_like_image_width" android:layout_width="@dimen/video_item_detail_like_image_width"
@ -77,14 +49,15 @@
android:layout_below="@id/itemCommentContentView" android:layout_below="@id/itemCommentContentView"
android:layout_marginLeft="@dimen/video_item_detail_like_margin" android:layout_marginLeft="@dimen/video_item_detail_like_margin"
android:layout_toRightOf="@id/detail_thumbs_up_img_view" android:layout_toRightOf="@id/detail_thumbs_up_img_view"
android:gravity="center_vertical"
android:lines="1" android:lines="1"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/video_item_detail_likes_text_size" android:textSize="@dimen/video_item_detail_likes_text_size"
tools:ignore="RtlHardcoded" tools:ignore="RtlHardcoded"
tools:text="12M" /> tools:text="12M" />
<ImageView <!--we can uncomment below code if we need dislike button and count in future-->
<!--<ImageView
android:id="@+id/detail_thumbs_down_img_view" android:id="@+id/detail_thumbs_down_img_view"
android:layout_width="@dimen/video_item_detail_like_image_width" android:layout_width="@dimen/video_item_detail_like_image_width"
android:layout_height="@dimen/video_item_detail_like_image_height" android:layout_height="@dimen/video_item_detail_like_image_height"
@ -107,6 +80,18 @@
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/video_item_detail_likes_text_size" android:textSize="@dimen/video_item_detail_likes_text_size"
tools:ignore="RtlHardcoded" tools:ignore="RtlHardcoded"
tools:text="10K" /> tools:text="10K" />-->
<TextView
android:id="@+id/itemPublishedTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/itemCommentContentView"
android:layout_marginLeft="12dp"
android:layout_toRightOf="@id/detail_thumbs_up_count_view"
android:lines="1"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="@dimen/video_item_search_upload_date_text_size"
tools:text="1 year ago" />
</RelativeLayout> </RelativeLayout>