Skip to content

Commit 7417331

Browse files
committed
Change heart color to be red, add else clause for non hearted comments, and apply some code style suggestions.
1 parent 3874e16 commit 7417331

5 files changed

Lines changed: 10 additions & 8 deletions

File tree

app/src/main/java/org/schabi/newpipe/info_list/holder/CommentsMiniInfoItemHolder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public String transformUrl(final Matcher match, final String url) {
8282
itemDislikesCountView = itemView.findViewById(R.id.detail_thumbs_down_count_view);
8383
itemPublishedTime = itemView.findViewById(R.id.itemPublishedTime);
8484
itemContentView = itemView.findViewById(R.id.itemCommentContentView);
85-
itemHeartView = itemView.findViewById(R.id.detail_heart_img_view);
85+
itemHeartView = itemView.findViewById(R.id.detail_heart_image_view);
8686

8787
downloadThumbnailKey = infoItemBuilder.getContext().
8888
getString(R.string.download_thumbnail_key);
@@ -157,6 +157,8 @@ public void updateFromItem(final InfoItem infoItem,
157157

158158
if (item.isHeartedByUploader()) {
159159
itemHeartView.setVisibility(View.VISIBLE);
160+
} else {
161+
itemHeartView.setVisibility(View.GONE);
160162
}
161163

162164
itemView.setOnClickListener(view -> {

app/src/main/res/drawable-night/ic_heart.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<vector xmlns:android="http://schemas.android.com/apk/res/android"
22
android:width="24dp"
33
android:height="24dp"
4-
android:tint="#FFFFFF"
4+
android:tint="#FF5252"
55
android:viewportWidth="24.0"
66
android:viewportHeight="24.0">
77
<path

app/src/main/res/drawable/ic_heart.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<vector xmlns:android="http://schemas.android.com/apk/res/android"
22
android:width="24dp"
33
android:height="24dp"
4+
android:tint="#E53935"
45
android:viewportWidth="24.0"
56
android:viewportHeight="24.0">
67
<path

app/src/main/res/layout/list_comments_item.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@
7272
tools:text="12M" />
7373

7474
<ImageView
75-
android:id="@+id/detail_heart_img_view"
76-
android:layout_width="@dimen/video_item_detail_heart_image_width"
77-
android:layout_height="@dimen/video_item_detail_heart_image_height"
75+
android:id="@+id/detail_heart_image_view"
76+
android:layout_width="@dimen/video_item_detail_heart_image_size"
77+
android:layout_height="@dimen/video_item_detail_heart_image_size"
7878
android:layout_below="@id/itemCommentContentView"
7979
android:layout_marginLeft="@dimen/video_item_detail_heart_margin"
8080
android:layout_toRightOf="@+id/detail_thumbs_up_count_view"
@@ -116,7 +116,7 @@
116116
android:layout_height="wrap_content"
117117
android:layout_below="@id/itemCommentContentView"
118118
android:layout_marginLeft="12dp"
119-
android:layout_toRightOf="@id/detail_heart_img_view"
119+
android:layout_toRightOf="@id/detail_heart_image_view"
120120
android:lines="1"
121121
android:textAppearance="?android:attr/textAppearanceSmall"
122122
android:textSize="@dimen/video_item_search_upload_date_text_size"

app/src/main/res/values/dimens.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@
8181
<dimen name="video_item_detail_sub_channel_image_size">16dp</dimen>
8282
<dimen name="video_item_detail_like_image_height">18sp</dimen>
8383
<dimen name="video_item_detail_like_image_width">18sp</dimen>
84-
<dimen name="video_item_detail_heart_image_width">18sp</dimen>
85-
<dimen name="video_item_detail_heart_image_height">18sp</dimen>
84+
<dimen name="video_item_detail_heart_image_size">18sp</dimen>
8685
<dimen name="channel_avatar_size">70dp</dimen>
8786
<dimen name="sub_channel_avatar_size">35dp</dimen>
8887
<dimen name="mini_player_height">60dp</dimen>

0 commit comments

Comments
 (0)