Search in sources :

Example 1 with RoomListHeader

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);
}
Also used : DirectMessageRoomListHeader(chat.rocket.android.layouthelper.chatroom.roomlist.DirectMessageRoomListHeader) ChannelRoomListHeader(chat.rocket.android.layouthelper.chatroom.roomlist.ChannelRoomListHeader) FavoriteRoomListHeader(chat.rocket.android.layouthelper.chatroom.roomlist.FavoriteRoomListHeader) UnreadRoomListHeader(chat.rocket.android.layouthelper.chatroom.roomlist.UnreadRoomListHeader) RoomListHeader(chat.rocket.android.layouthelper.chatroom.roomlist.RoomListHeader) DirectMessageRoomListHeader(chat.rocket.android.layouthelper.chatroom.roomlist.DirectMessageRoomListHeader) ArrayList(java.util.ArrayList) UnreadRoomListHeader(chat.rocket.android.layouthelper.chatroom.roomlist.UnreadRoomListHeader) FavoriteRoomListHeader(chat.rocket.android.layouthelper.chatroom.roomlist.FavoriteRoomListHeader) ChannelRoomListHeader(chat.rocket.android.layouthelper.chatroom.roomlist.ChannelRoomListHeader)

Aggregations

ChannelRoomListHeader (chat.rocket.android.layouthelper.chatroom.roomlist.ChannelRoomListHeader)1 DirectMessageRoomListHeader (chat.rocket.android.layouthelper.chatroom.roomlist.DirectMessageRoomListHeader)1 FavoriteRoomListHeader (chat.rocket.android.layouthelper.chatroom.roomlist.FavoriteRoomListHeader)1 RoomListHeader (chat.rocket.android.layouthelper.chatroom.roomlist.RoomListHeader)1 UnreadRoomListHeader (chat.rocket.android.layouthelper.chatroom.roomlist.UnreadRoomListHeader)1 ArrayList (java.util.ArrayList)1