package chat.rocket.android.layouthelper.chatroom.roomlist;

import android.support.annotation.NonNull;

import java.util.List;
import chat.rocket.core.models.Room;

public class UnreadRoomListHeader implements RoomListHeader {

  private final String title;

  public UnreadRoomListHeader(String title) {
    this.title = title;
  }

  @Override
  public String getTitle() {
    return title;
  }

  @Override
  public boolean owns(Room room) {
    return room.isAlert();
  }

  @Override
  public boolean shouldShow(@NonNull List<Room> roomList) {
    for (int i = 0, size = roomList.size(); i < size; i++) {
      if (roomList.get(i).isAlert()) {
        return true;
      }
    }

    return false;
  }

  @Override
  public ClickListener getClickListener() {
    return null;
  }
}

@@ -102,31 +102,8 @@
 l;%0A%0A
-import java.util.List;%0A
 impo
@@ -133,16 +133,46 @@
 els.Room
+Sidebar;%0Aimport java.util.List
 ;%0A%0Apubli
@@ -437,21 +437,35 @@
 wns(Room
- room
+Sidebar roomSidebar
 ) %7B%0A    
@@ -475,16 +475,23 @@
 urn room
+Sidebar
 .isAlert
@@ -561,14 +561,28 @@
 Room
-%3E room
+Sidebar%3E roomSidebar
 List
@@ -612,24 +612,31 @@
  size = room
+Sidebar
 List.size();
@@ -667,16 +667,23 @@
 if (room
+Sidebar
 List.get
@@ -734,17 +734,16 @@
 %7D%0A    %7D%0A
-%0A
     retu
@@ -835,9 +835,8 @@
 l;%0A  %7D%0A%7D
-%0A

Update UnreadRoomListHeader.java