Ejemplo n.º 1
0
  /**
   * A publish action has been successfully completed, update connection object associated with the
   * client this action belongs to, then notify the user of success
   */
  private void publish() {

    Connection c = Connection.getInstance();
    String actionTaken = context.getString(R.string.toast_pub_success, (Object[]) additionalArgs);

    Notify.toast(context, actionTaken, Toast.LENGTH_SHORT);
  }
Ejemplo n.º 2
0
  // we keep pointer to map object and grid object
  public MessageReader(SetUp grid) {

    conn = Connection.getInstance();
    messagelist = new ArrayList<>();
    this.grid = grid;
    conn.sendMessage("JOIN#");
  }
Ejemplo n.º 3
0
  /**
   * A connection action has been successfully completed, update the connection object associated
   * with the client this action belongs to and then notify the user of success.
   */
  private void connect() {

    Connection c = Connection.getInstance();
    c.changeConnectionStatus(Connection.ConnectionStatus.CONNECTED);

    Notify.toast(context, "Connected", Toast.LENGTH_LONG);
  }
Ejemplo n.º 4
0
 /**
  * A connect action was unsuccessful, notify the user and update client history
  *
  * @param exception This argument is not used
  */
 private void connect(Throwable exception) {
   Connection c = Connection.getInstance();
   c.changeConnectionStatus(Connection.ConnectionStatus.ERROR);
 }
Ejemplo n.º 5
0
 /**
  * A disconnect action was unsuccessful, notify user and update client history
  *
  * @param exception This argument is not used
  */
 private void disconnect(Throwable exception) {
   Connection c = Connection.getInstance();
   c.changeConnectionStatus(Connection.ConnectionStatus.DISCONNECTED);
 }
Ejemplo n.º 6
0
  /**
   * A subscribe action was unsuccessful, notify user and update client history
   *
   * @param exception This argument is not used
   */
  private void subscribe(Throwable exception) {
    Connection c = Connection.getInstance();
    String action = context.getString(R.string.toast_sub_failed, (Object[]) additionalArgs);

    Notify.toast(context, action, Toast.LENGTH_SHORT);
  }
Ejemplo n.º 7
0
 /**
  * A disconnection action has been successfully completed, update the connection object associated
  * with the client this action belongs to and then notify the user of success.
  */
 private void disconnect() {
   Connection c = Connection.getInstance();
   c.changeConnectionStatus(Connection.ConnectionStatus.DISCONNECTED);
   String actionTaken = context.getString(R.string.toast_disconnected);
   Notify.toast(context, actionTaken, Toast.LENGTH_LONG);
 }