예제 #1
0
 /**
  * This is called during layout when the size of this view has changed. If you were just added to
  * the view hierarchy, you're called with the old values of 0.
  *
  * @param w Current width of this view.
  * @param h Current height of this view.
  * @param oldw Old width of this view.
  * @param oldh Old height of this view.
  */
 @Override
 protected void onSizeChanged(int w, int h, int oldw, int oldh) {
   super.onSizeChanged(w, h, oldw, oldh);
   mLeftPadding = getPaddingLeft();
   mTopPadding = getPaddingTop();
   mRightPadding = getPaddingRight();
   mBottomPadding = getPaddingBottom();
 }
 @Override
 protected void onSizeChanged(int w, int h, int oldw, int oldh) {
   super.onSizeChanged(w, h, oldw, oldh);
   // Recalculate sliding panes and their details
   if (h != oldh) {
     mFirstLayout = true;
   }
 }
예제 #3
0
  @Override
  protected void onSizeChanged(final int w, final int h, final int oldw, final int oldh) {
    super.onSizeChanged(w, h, oldw, oldh);

    // set correct position of content view after view size was changed
    if (w != oldw || h != oldh) {
      mController.init();
    }
  }
예제 #4
0
 @Override
 protected void onSizeChanged(int w, int h, int oldw, int oldh) {
   // TODO Auto-generated method stub
   super.onSizeChanged(w, h, oldw, oldh);
   if (w != 0 && h != 0) {
     width = w;
     height = h;
     itemWidth = width / NUMBER_PER_PAGE;
   }
 }
예제 #5
0
 @Override
 protected void onSizeChanged(int w, int h, int oldw, int oldh) {
   super.onSizeChanged(w, h, oldw, oldh);
   // Make sure scroll position is set correctly.
   if (w != oldw) {
     // [ChrisJ] - This fixes the onConfiguration change for orientation issue..
     // maybe worth having a look why the recomputeScroll pos is screwing
     // up?
     completeScroll();
     scrollTo(getDestScrollX(mCurItem), getScrollY());
   }
 }
예제 #6
0
  @Override
  protected void onSizeChanged(int w, int h, int oldw, int oldh) {
    super.onSizeChanged(w, h, oldw, oldh);
    verticalDragRange = h;
    horizontalDragRange = w;

    switch (dragEdge) {
      case TOP:
      case BOTTOM:
        finishAnchor = finishAnchor > 0 ? finishAnchor : verticalDragRange * BACK_FACTOR;
        break;
      case LEFT:
      case RIGHT:
        finishAnchor = finishAnchor > 0 ? finishAnchor : horizontalDragRange * BACK_FACTOR;
        break;
    }
  }
예제 #7
0
  @Override
  protected void onSizeChanged(int w, int h, int oldw, int oldh) {
    if (mLogEnabled) Log.i(LOG_TAG, "OnSizeChanged()");

    if (w > 0 && h > 0 && w < 10000 && h < 10000) {

      mViewPortHandler.setChartDimens(w, h);

      if (mLogEnabled) Log.i(LOG_TAG, "Setting chart dimens, width: " + w + ", height: " + h);

      for (Runnable r : mJobs) {
        post(r);
      }

      mJobs.clear();
    }

    notifyDataSetChanged();

    super.onSizeChanged(w, h, oldw, oldh);
  }
 // ==============================================================================
 @Override
 protected void onSizeChanged(int w, int h, int oldw, int oldh) {
   super.onSizeChanged(w, h, oldw, oldh);
   viewSizeChanged();
 }
예제 #9
0
 @Override
 protected void onSizeChanged(int w, int h, int oldw, int oldh) {
   super.onSizeChanged(w, h, oldw, oldh);
   updateClippingRect();
 }
예제 #10
0
 /** {@inheritDoc} */
 @Override
 protected void onSizeChanged(int w, int h, int oldw, int oldh) {
   super.onSizeChanged(w, h, oldw, oldh);
   mForegroundBoundsChanged = true;
 }
예제 #11
0
 @Override
 protected void onSizeChanged(int w, int h, int oldw, int oldh) {
   super.onSizeChanged(w, h, oldw, oldh);
   Log.d("view", "w-->" + w);
   Log.d("view", "h-->" + h);
 }
예제 #12
0
  @Override
  protected void onSizeChanged(int w, int h, int oldw, int oldh) {
    super.onSizeChanged(w, h, oldw, oldh);
    Log.d(TAG, "Slice Count: " + mData.size());
    if (mData.size() > 0) {
      //
      // Set dimensions for text, pie chart, etc
      //
      // Account for padding
      float xpad = (float) (getPaddingLeft() + getPaddingRight());
      float ypad = (float) (getPaddingTop() + getPaddingBottom());

      // Account for the label
      if (mShowText) xpad += mTextWidth;

      float ww = (float) w - xpad;
      float hh = (float) h - ypad;

      // Figure out how big we can make the pie.
      float diameter = Math.min(ww, hh);
      mPieBounds = new RectF(0.0f, 0.0f, diameter, diameter);
      mPieBounds.offsetTo(getPaddingLeft(), getPaddingTop());
      //	        Log.d(TAG, "mPieBounds>> "+mPieBounds);

      mPointerY = mTextY - (mTextHeight / 2.0f);
      float pointerOffset = mPieBounds.centerY() - mPointerY;

      // Make adjustments based on text position
      if (mTextPos == TEXTPOS_LEFT) {
        mTextPaint.setTextAlign(Paint.Align.RIGHT);
        if (mShowText) mPieBounds.offset(mTextWidth, 0.0f);
        mTextX = mPieBounds.left;

        if (pointerOffset < 0) {
          pointerOffset = -pointerOffset;
          mCurrentItemAngle = 225;
        } else {
          mCurrentItemAngle = 135;
        }
        mPointerX = mPieBounds.centerX() - pointerOffset;
      } else {
        mTextPaint.setTextAlign(Paint.Align.LEFT);
        mTextX = mPieBounds.right;

        if (pointerOffset < 0) {
          pointerOffset = -pointerOffset;
          mCurrentItemAngle = 315;
        } else {
          mCurrentItemAngle = 45;
        }
        mPointerX = mPieBounds.centerX() + pointerOffset;
      }

      mShadowBounds =
          new RectF(
              mPieBounds.left + 10,
              mPieBounds.bottom + 10,
              mPieBounds.right - 10,
              mPieBounds.bottom + 20);

      // Lay out the child view that actually draws the pie.
      mPieView.layout(
          (int) mPieBounds.left,
          (int) mPieBounds.top,
          (int) mPieBounds.right,
          (int) mPieBounds.bottom);
      mPieView.setPivot(mPieBounds.width() / 2, mPieBounds.height() / 2);

      mPointerView.layout(0, 0, w, h);
      onDataChanged();
    }
  }