Commit 05acd3d1 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update SidebarMainFragment.java

parent ff9f5f1c
...@@ -123,9 +123,9 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain ...@@ -123,9 +123,9 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
adapter = new RoomListAdapter(); adapter = new RoomListAdapter();
adapter.setOnItemClickListener(new RoomListAdapter.OnItemClickListener() { adapter.setOnItemClickListener(new RoomListAdapter.OnItemClickListener() {
@Override @Override
public void onItemClick(Room room) {
searchView.clearFocus(); searchView.clearFocus();
presenter.onRoomSelected(room); public void onItemClick(RoomSidebar roomSidebar) {
presenter.onRoomSelected(roomSidebar);
} }
@Override @Override
...@@ -187,13 +187,8 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain ...@@ -187,13 +187,8 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
} }
@Override @Override
public void showRoomList(@NonNull List<Room> roomList) { public void showRoomSidebarList(@NonNull List<RoomSidebar> roomSidebarList) {
adapter.setRooms(roomList); adapter.setRoomSidebarList(roomSidebarList);
}
@Override
public void showUserStatus(@NonNull User user) {
adapter.setUserStatus(user);
} }
@Override @Override
...@@ -233,12 +228,9 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain ...@@ -233,12 +228,9 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
private void updateRoomListMode(User user) { private void updateRoomListMode(User user) {
final List<RoomListHeader> roomListHeaders = new ArrayList<>(); final List<RoomListHeader> roomListHeaders = new ArrayList<>();
if (user != null && user.getSettings() != null && user.getSettings().getPreferences() != null roomListHeaders.add(new UnreadRoomListHeader(
&& user.getSettings().getPreferences().isUnreadRoomsMode()) { getString(R.string.fragment_sidebar_main_unread_rooms_title)
roomListHeaders.add(new UnreadRoomListHeader( ));
getString(R.string.fragment_sidebar_main_unread_rooms_title)
));
}
roomListHeaders.add(new FavoriteRoomListHeader( roomListHeaders.add(new FavoriteRoomListHeader(
getString(R.string.fragment_sidebar_main_favorite_title) getString(R.string.fragment_sidebar_main_favorite_title)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment