コード例 #1
0
  @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();
  }
コード例 #2
0
  @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;
      }
    }
  }
コード例 #3
0
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
   if (changed) {
     updateClipBounds();
   }
 }
コード例 #4
0
 @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;
 }
コード例 #5
0
 @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();
   }
 }
コード例 #6
0
 @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;
 }
コード例 #7
0
ファイル: DocumentView.java プロジェクト: jzhongsun/Mupdf
 @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();
 }
コード例 #8
0
 @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();
   }
 }
コード例 #9
0
 @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());
   }
 }
コード例 #10
0
ファイル: RangeSeekBar.java プロジェクト: Sai-Teja/Carbon
  @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());
  }
コード例 #11
0
 @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();
   }
 }
コード例 #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;
  }
コード例 #13
0
ファイル: Reader.java プロジェクト: wangjun/MiMangaNu
 @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;
 }
コード例 #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;
      }
    }
  }
コード例 #15
0
 @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();
 }
コード例 #16
0
ファイル: LoadingButton.java プロジェクト: hha423/CoolHosts
  @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);
  }
コード例 #17
0
ファイル: UIElementView.java プロジェクト: gmyboy/Blog
  @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);
    }
  }
コード例 #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;
  }
コード例 #19
0
ファイル: WheelRadio.java プロジェクト: jiezzy/AndroidWheel
  @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;
    }
  }
コード例 #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;
  }
コード例 #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();
  }
コード例 #22
0
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
 }
コード例 #23
0
ファイル: ImageZoomView.java プロジェクト: wenbojx/wendroid
  @Override
  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    super.onLayout(changed, left, top, right, bottom);

    calculateAspectQuotient();
  }
コード例 #24
0
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
   invalidateLabelOffset();
 }