use of chat.rocket.android.layouthelper.chatroom.roomlist.RoomListHeader in project Rocket.Chat.Android by RocketChat.
the class SidebarMainFragment method updateRoomListMode.
private void updateRoomListMode(User user) {
final List<RoomListHeader> roomListHeaders = new ArrayList<>();
if (user != null && user.getSettings() != null && user.getSettings().getPreferences() != null && user.getSettings().getPreferences().isUnreadRoomsMode()) {
roomListHeaders.add(new UnreadRoomListHeader(getString(R.string.fragment_sidebar_main_unread_rooms_title)));
}
roomListHeaders.add(new FavoriteRoomListHeader(getString(R.string.fragment_sidebar_main_favorite_title)));
roomListHeaders.add(new ChannelRoomListHeader(getString(R.string.fragment_sidebar_main_channels_title), () -> showAddRoomDialog(AddChannelDialogFragment.create(hostname))));
roomListHeaders.add(new DirectMessageRoomListHeader(getString(R.string.fragment_sidebar_main_direct_messages_title), () -> showAddRoomDialog(AddDirectMessageDialogFragment.create(hostname))));
adapter.setRoomListHeaders(roomListHeaders);
}
Aggregations