예제 #1
0
 @Override
 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
   User listSelectedUser = (User) parent.getItemAtPosition(position);
   User newSelectedUser =
       selectedUser == listSelectedUser
           ? null
           : listSelectedUser; // Unset if is already selected user
   setChatTarget(newSelectedUser);
   channelProvider.setChatTarget(newSelectedUser);
 };
예제 #2
0
 /** Updates the users display with the data from the channelProvider. */
 public void updateChannel() {
   // We need to make sure the fragment has been attached and is shown before updating the users.
   usersAdapter.setVisibleChannel(channelProvider.getChannel().id);
   usersAdapter.setUsers(channelProvider.getChannelUsers());
   usersAdapter.notifyDataSetChanged();
 }