Пример #1
0
  @Override
  public void chipSelected(int index) {

    switch (mode) {
      case SINGLE:
      case REQUIRED:
        for (int i = 0; i < getChildCount(); i++) {
          Chip chip = (Chip) getChildAt(i);
          if (i == index) {
            if (mode == Mode.REQUIRED) chip.setLocked(true);
          } else {
            chip.deselect();
            chip.setLocked(false);
          }
        }
        break;
      default:
        //
    }

    if (chipListener != null) {
      chipListener.chipSelected(index);
    }
  }
Пример #2
0
 @Override
 public void chipDeselected(int index) {
   if (chipListener != null) {
     chipListener.chipDeselected(index);
   }
 }