Exemplo n.º 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);
 };
Exemplo n.º 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();
 }