Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Max Baumann <max@bmn.dev>
  • Loading branch information
Zerwin and FoseFx authored Dec 27, 2024
1 parent 79471d4 commit 5a54dda
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mod/app/src/main/java/bttv/SplitChat.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static void setBackgroundColor(int position, RecyclerView.ViewHolder view
LinearLayout linearLayout = (LinearLayout) view;
for (int j = 0; j < linearLayout.getChildCount(); j++) {
View nestedChild = linearLayout.getChildAt(j);
if (nestedChild.getId() == ResUtil.getResourceId(context, "chat_message_item", "id")) {
if (nestedChild.getId() == chatMessageItemResId) {
Log.d(TAG, "found chat_message_item: " + nestedChild.toString());
view = nestedChild;
// Increase width of linearLayout to match parent to color the whole item
Expand All @@ -77,11 +77,11 @@ public static void setBackgroundColor(int position, RecyclerView.ViewHolder view
}
}
}
boolean hasChatMessageId = view.getId() == ResUtil.getResourceId(context, "chat_message_item", "id");
boolean hasChommentRootId = view.getId() == ResUtil.getResourceId(context, "chomment_root_view", "id");
boolean hasChatMessageId = view.getId() == chatMessageItemResId;
boolean hasChommentRootId = view.getId() == chommentRootViewResId;

if (!(hasChatMessageId || hasChommentRootId)) {
Log.i(TAG, "view skipped, as it's not a chat message or chomment, " + viewHolder.toString() + " ID: " + view.getId() + " View: " + view.toString() + " Expected ID: " + ResUtil.getResourceId(context, "chat_message_item", "id") + " or " + ResUtil.getResourceId(context, "chomment_root_view", "id"));
Log.d(TAG, "view skipped, as it's not a chat message or chomment, " + viewHolder.toString() + " ID: " + view.getId() + " View: " + view.toString() + " Expected ID: " + chatMessageItemResId + " or " + chommentRootViewResId);
reset(view);
return;
}
Expand Down

0 comments on commit 5a54dda

Please # to comment.