示例#1
0
 /**
  * Sets the recent squares list, notifying the listeners
  *
  * @param recentSquaresList the list to set
  */
 public static void setRecentSquaresList(ArrayList<Square> recentSquaresList) {
   InSquareProfile.recentSquaresList = recentSquaresList;
   // Notifica gli ascoltatori
   for (InSquareProfileListener ispl : listeners) {
     ispl.onRecentChanged();
     Log.d(TAG, "setRecentSquares: notifying listeners!");
   }
 }
示例#2
0
  /**
   * Adds the square passed as parameter to the list of the recent squares
   *
   * @param square The square you want to add
   */
  public static void addRecent(Square square) {
    // Aggiungi in coda
    recentSquaresList.add(square);

    // Notifica gli ascoltatori
    for (InSquareProfileListener ispl : listeners) {
      ispl.onRecentChanged();
      Log.d(TAG, "addRecent: notifying listeners!");
    }
  }
示例#3
0
  /**
   * Removes the square passed as parameter from the list of the recent squares
   *
   * @param square The square you want to remove
   */
  public static void removeRecent(String square) {
    // trova la square da rimuovere
    for (Square s : recentSquaresList) {
      if (s.getId().equals(square)) {
        recentSquaresList.remove(s);
        break;
      }
    }

    // Notifica gli ascoltatori
    for (InSquareProfileListener ispl : listeners) {
      ispl.onRecentChanged();
      Log.d(TAG, "addRecent: notifying listeners!");
    }
  }