Пример #1
0
  public void updateUserList(int userId) {
    createForm.setVisibility(8);

    // refresh the roomlist
    userList.clear();

    // server call
    if (this.clientComm != null) {
      // showRoomListMessage("con server:"+uiHelperRef.getStServerIp());
      this.userList = clientComm.getUserList(settings.getUserId());
    }

    // set up ui list
    int userCount = userList.size();
    String[] userdata_arr = new String[userCount];

    for (int i = 0; i < userCount; i++) {
      userdata_arr[i] = userList.get(i).username;
    }
    roomListView.setAdapter(
        new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, userdata_arr));
    currentMenuState = 2;
  }
Пример #2
0
 public void createRoom() {
   String roomName = inpCreateName.getText().toString();
   int roomId = this.clientComm.createRoom(settings.getUserId(), roomName);
   updateUserList(roomId);
 }
Пример #3
0
 public void joinRoom(int roomId) {
   this.clientComm.LogInToRoom(settings.getUserId(), roomId);
   // this.showRoomListMessage("joining Room: "+roomId); Replace UserList
   this.uiHelperRef.resetUserListFlag = 1;
 }