Example #1
0
  private void createDefaultTextRegion() {
    if (mRootLayout == null) {
      throw new IllegalStateException("Root-Layout uninitialized.");
    }

    mTextRegion =
        new RegionModel(
            TEXT_REGION_ID,
            0,
            mLayoutParams.getImageHeight(),
            mRootLayout.getWidth(),
            mLayoutParams.getTextHeight());
  }
Example #2
0
  public void changeTo(int layout) {
    if (mRootLayout == null) {
      throw new IllegalStateException("Root-Layout uninitialized.");
    }

    if (mLayoutParams == null) {
      mLayoutParams = LayoutManager.getInstance().getLayoutParameters();
    }

    if (mLayoutType != layout) {
      switch (layout) {
        case LAYOUT_BOTTOM_TEXT:
          {
            mImageRegion.setTop(0);
            mTextRegion.setTop(mLayoutParams.getImageHeight());
            mLayoutType = layout;
            notifyModelChanged(true);
          }
          break;
        case LAYOUT_TOP_TEXT:
          {
            mImageRegion.setTop(mLayoutParams.getTextHeight());
            mTextRegion.setTop(0);
            mLayoutType = layout;
            notifyModelChanged(true);
          }
          break;
        default:
          {
            Log.w(TAG, "Unknown layout type: " + layout);
          }
      }
    } else {
      if (LOCAL_LOGV) {
        Log.v(TAG, "Skip changing layout.");
      }
    }
  }
Example #3
0
 private void createDefaultRootLayout() {
   mRootLayout = new RegionModel(null, 0, 0, mLayoutParams.getWidth(), mLayoutParams.getHeight());
 }