Ejemplo n.º 1
0
  /**
   * Computes the new layout disposition based on the actual resize frame
   *
   * @param mode The resize mode
   */
  private void computeNewDispositions(int mode) {
    // Fill the empty areas
    do {
      byte[][] dispositionMatrix = DispositionUtil.toMatrix(mDispositions, mCols, mRows);
      Rect rect = MERAlgorithm.getMaximalEmptyRectangle(dispositionMatrix);
      if (rect.width() == 0 && rect.height() == 0) {
        // No more empty areas
        break;
      }
      Disposition disposition = DispositionUtil.fromRect(rect);
      createFrame(getLocationFromDisposition(disposition), true);
      mDispositions.add(disposition);
    } while (true);

    // Now the view was changed and should be reported
    Collections.sort(mDispositions);
    mChanged = true;
  }
 /** {@inheritDoc} */
 @Override
 public List<Disposition> getDefaultDispositions() {
   return DispositionUtil.toDispositions(Preferences.Layout.DEFAULT_LANDSCAPE_DISPOSITION);
 }