@Override
  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    super.onLayout(changed, left, top, right, bottom);

    // Target placement width/height. This puts the targets on the greater of the ring
    // width or the specified outer radius.
    final float placementWidth = getRingWidth();
    final float placementHeight = getRingHeight();
    float newWaveCenterX = mHorizontalInset + (mMaxTargetWidth + placementWidth) / 2;
    float newWaveCenterY = mVerticalInset + (mMaxTargetHeight + placementHeight) / 2;

    if (mInitialLayout) {
      stopAndHideWaveAnimation();
      hideTargets(false, false);
      mInitialLayout = false;
    }

    mOuterRing.setPositionX(newWaveCenterX);
    mOuterRing.setPositionY(newWaveCenterY);

    mPointCloud.setScale(mRingScaleFactor);

    mHandleDrawable.setPositionX(newWaveCenterX);
    mHandleDrawable.setPositionY(newWaveCenterY);

    updateTargetPositions(newWaveCenterX, newWaveCenterY);
    updatePointCloudPosition(newWaveCenterX, newWaveCenterY);
    updateGlowPosition(newWaveCenterX, newWaveCenterY);

    mWaveCenterX = newWaveCenterX;
    mWaveCenterY = newWaveCenterY;

    if (DEBUG) dump();
  }
  @Override
  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    super.onLayout(changed, left, top, right, bottom);
    if (changed) {
      // 下拉显示的视图宽高
      mWidth = getWidth();
      mHeight = getHeight();
      // 中间球形的半径
      mRadius = getHeight() / 6;

      if (mHeight < PULL_HEIGHT) {
        mAniStatus = AnimatorStatus.PULL_DOWN;
      }

      switch (mAniStatus) {
        case PULL_DOWN:
          if (mHeight >= PULL_HEIGHT) {
            mAniStatus = AnimatorStatus.DRAG_DOWN;
          }
          break;
        case REL_DRAG:
          break;
      }
    }
  }
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
   if (changed) {
     updateClipBounds();
   }
 }
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
   double width = right - left;
   mRadius = width * THUMB_RADIUS_CONTAINER_SIZE_RATIO;
   mInternalRadius = width * THUMB_INTERNAL_RADIUS_CONTAINER_SIZE_RATIO;
 }
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
   if (!mHasAnimation) {
     mHasAnimation = true;
     applyAnimation();
   }
 }
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
   if (handler != null) {
     handler.notifyDispSizeChanged(right - left, bottom - top);
   }
   isSurfaceCreated = true;
 }
Example #7
0
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
   float scrollScaleRatio = getScrollScaleRatio();
   invalidatePageSizes();
   invalidateScroll(scrollScaleRatio);
   commitZoom();
 }
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
   if (changed) {
     // 分别获取到ZoomImageView的宽度和高度
     width = getWidth();
     height = getHeight();
   }
 }
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
   final int len = views.size();
   for (int i = 0; i < len; i++) {
     View v = views.get(i);
     v.layout(left, top, left + v.getMeasuredWidth(), top + v.getMeasuredHeight());
   }
 }
Example #10
0
  @Override
  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    super.onLayout(changed, left, top, right, bottom);

    if (!changed) return;

    if (getWidth() == 0 || getHeight() == 0) return;

    if (rippleDrawable != null) rippleDrawable.setBounds(0, 0, getWidth(), getHeight());
  }
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
   if (changed) {
     removeCallbacks(mShowIndicatorRunnable);
     if (!isInEditMode()) {
       mIndicator.dismissComplete();
     }
     updateFromDrawableState();
   }
 }
Example #12
0
  @Override
  protected void onLayout(boolean changed, int l, int t, int r, int b) {
    super.onLayout(changed, l, t, r, b);

    /*
     * Calculate left / top for drawing in center
     */
    mLeft = (getWidth() - mMeasuredMovieWidth) / 2f;
    mTop = (getHeight() - mMeasuredMovieHeight) / 2f;

    mVisible = getVisibility() == View.VISIBLE;
  }
Example #13
0
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   screenHeight = Math.abs(bottom - top);
   screenWidth = Math.abs(right - left);
   if (pages != null) {
     calculateParticularScale();
     calculateVisibilities();
     this.postInvalidateDelayed(100);
   }
   super.onLayout(changed, left, top, right, bottom);
   layoutReady = true;
 }
Example #14
0
  @Override
  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    super.onLayout(changed, left, top, right, bottom);

    if (changed) {
      // Layout each row.
      for (int i = 0; i < mLayoutRows.size(); i++) {
        Row row = mLayoutRows.get(i);
        row.layout(left, top);
        top += row.getMeasuredHeight() + mBorderSize;
      }
    }
  }
 @Override
 public void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
   if (changed) {
     clipping =
         new Rect(
             getPaddingLeft(),
             getPaddingTop(),
             getWidth() - getPaddingRight(),
             getHeight() - getPaddingBottom());
     createDisplayText();
   }
   autoMarquee();
 }
Example #16
0
  @Override
  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    super.onLayout(changed, left, top, right, bottom);
    width = getWidth();
    height = getHeight();
    centerX = width / 2;
    centerY = height / 2;

    defaultCommonDrawableWidth = (int) (width * 0.5); // (int) Math.round(getWidth()/10.0);
    mCommonDrawable.setBounds(0, 0, defaultCommonDrawableWidth, defaultCommonDrawableWidth);
    mCompleteDrawable.setBounds(0, 0, defaultCommonDrawableWidth, defaultCommonDrawableWidth);
    radius = centerX - 10;
    oval = new RectF(centerX - radius, centerX - radius, centerX + radius, centerX + radius);
  }
Example #17
0
  @Override
  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    super.onLayout(changed, left, top, right, bottom);

    if (mUIElement != null) {
      final int paddingLeft = getPaddingLeft();
      final int paddingTop = getPaddingTop();

      final int elementLeft = paddingLeft;
      final int elementTop = paddingTop;
      final int elementRight = right - left - getPaddingRight();
      final int elementBottom = bottom - top - getPaddingBottom();

      mUIElement.layout(elementLeft, elementTop, elementRight, elementBottom);
    }
  }
Example #18
0
  @Override
  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    super.onLayout(changed, left, top, right, bottom);

    int d = Math.min(getMeasuredWidth(), getMeasuredHeight());

    dimX = d;
    // dimY = d;

    cX = d / 2;
    cY = d / 2;

    bgRadius = dimX / 2 - innerPadding;
    handleRadius = (int) (d * 0.25);
    handleInnerBoundaries = handleRadius;
    movementRadius = Math.min(cX, cY) - handleInnerBoundaries;
  }
Example #19
0
  @Override
  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    super.onLayout(changed, left, top, right, bottom);

    int w = right - left;

    if (w > 0 && changed || mForceLayout) {
      mRealRect = new Rect(mPaddingLeft, top, w - mPaddingRight, bottom);
      mIndicatorSmall = makeBitmap2(w / mSmallTicksCount, bottom - top, mLineTickSize);
      mShader = new BitmapShader(mIndicatorSmall, Shader.TileMode.REPEAT, Shader.TileMode.CLAMP);
      mIndicatorBig = makeBitmap3(mRealRect.width() / mBigTicksCount, bottom - top, mLineBigSize);
      mShader1 = new BitmapShader(mIndicatorBig, Shader.TileMode.REPEAT, Shader.TileMode.CLAMP);
      mIndicator = makeIndicator(bottom - top, mLineBigSize);
      mCorrectionX = (((float) mRealRect.width() / mBigTicksCount) % 1) * mBigTicksCount;
      mForceLayout = false;
    }
  }
Example #20
0
  @Override
  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    super.onLayout(changed, left, top, right, bottom);

    final int width = getWidth();
    final int height = getHeight();

    radius = Math.min(width, height) * 0.5f;
    centerY = radius;
    startX = radius;
    endX = width - radius;
    spotMinX = startX + borderWidth;
    spotMaxX = endX - borderWidth;
    spotSize = height - 4 * borderWidth;
    spotX = toggleOn ? spotMaxX : spotMinX;
    offLineWidth = 0;
  }
Example #21
0
  @Override
  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    super.onLayout(changed, left, top, right, bottom);
    final int width = right - left;
    final int height = bottom - top;

    // Target placement width/height. This puts the targets on the greater
    // of the ring
    // width or the specified outer radius.
    final float placementWidth = Math.max(mOuterRing.getWidth(), 2 * mOuterRadius);
    final float placementHeight = Math.max(mOuterRing.getHeight(), 2 * mOuterRadius);
    float newWaveCenterX = mHorizontalInset + Math.max(width, mMaxTargetWidth + placementWidth) / 2;
    float newWaveCenterY =
        mVerticalInset + Math.max(height, +mMaxTargetHeight + placementHeight) / 2;

    if (mInitialLayout) {
      stopAndHideWaveAnimation();
      if (mShowTargetsOnIdle) showTargets(false);
      else hideTargets(false, false);
      mInitialLayout = false;
    }

    mOuterRing.setPositionX(newWaveCenterX);
    mOuterRing.setPositionY(newWaveCenterY);

    mHandleDrawable.setPositionX(newWaveCenterX);
    mHandleDrawable.setPositionY(newWaveCenterY);

    updateTargetPositions(newWaveCenterX, newWaveCenterY);
    updatePointCloudPosition(newWaveCenterX, newWaveCenterY);
    updateGlowPosition(newWaveCenterX, newWaveCenterY);

    mWaveCenterX = newWaveCenterX;
    mWaveCenterY = newWaveCenterY;

    if (DEBUG) dump();
  }
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
 }
Example #23
0
  @Override
  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    super.onLayout(changed, left, top, right, bottom);

    calculateAspectQuotient();
  }
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
   invalidateLabelOffset();
 }