Exemplo n.º 1
0
 @Subscribe
 public void onBufferDetailsChanged(BufferDetailsChangedEvent event) {
   if (event.bufferId == bufferId) {
     Buffer buffer = networks.getBufferById(bufferId);
     if (buffer != null) {
       observer.setBuffer(buffer);
     }
   }
 }
Exemplo n.º 2
0
 @Subscribe
 public void onBufferOpened(BufferOpenedEvent event) {
   if (event.bufferId != -1) {
     this.bufferId = event.bufferId;
     if (networks != null) {
       observer.setBuffer(networks.getBufferById(bufferId));
       updateUsers();
       BusProvider.getInstance().post(new BufferDetailsChangedEvent(bufferId));
     }
   }
 }
Exemplo n.º 3
0
 @Subscribe
 public void onNetworksAvailable(NetworksAvailableEvent event) {
   if (event.networks != null) {
     this.networks = event.networks;
     if (bufferId != -1) {
       observer.setBuffer(networks.getBufferById(bufferId));
       updateUsers();
       BusProvider.getInstance().post(new BufferDetailsChangedEvent(bufferId));
     }
   }
 }
Exemplo n.º 4
0
 private void updateUsers() {
   Buffer buffer = networks.getBufferById(bufferId);
   if (buffer != null) {
     adapter.setUsers(buffer.getUsers());
   }
 }