Ejemplo n.º 1
0
  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    super.onLayout(changed, left, top, right, bottom);
    mWidth = right - left;
    mHeight = bottom - top;

    if (mBitmap != null) {
      getProperBaseMatrix(mBaseMatrix);
      setImageMatrix(getImageViewMatrix());
    }
  }
Ejemplo n.º 2
0
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   // TODO Auto-generated method stub
   super.onLayout(changed, left, top, right, bottom);
   // CommonUtil.tolog("-----------------start ---------------");
   //
   // CommonUtil.tolog("onlayout called");
   //
   // CommonUtil.tolog("-----------------end---------------");
 }
Ejemplo n.º 3
0
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
   final Drawable drawable = getDrawable();
   if (drawable != null) {
     bitmapWidth = drawable.getIntrinsicWidth();
     bitmapHeight = drawable.getIntrinsicHeight();
     setFitScreenMatrix(bitmapWidth, bitmapHeight, baseMatrix);
     setImageMatrix(baseMatrix);
     currentMatrix.set(baseMatrix);
   }
 }
Ejemplo n.º 4
0
 @Override
 public void onLayout(boolean changed, int left, int top, int right, int bottom) {
   android.util.Log.d(TAG, "left=" + left);
   Rect re = getDrawable().getBounds();
   WEEK_LEFT_MARGIN = CELL_MARGIN_LEFT = (right - left - re.width()) / 2;
   mWeekTitle.setBounds(
       WEEK_LEFT_MARGIN,
       WEEK_TOP_MARGIN,
       WEEK_LEFT_MARGIN + mWeekTitle.getMinimumWidth(),
       WEEK_TOP_MARGIN + mWeekTitle.getMinimumHeight());
   initCells();
   super.onLayout(changed, left, top, right, bottom);
 }
  @Override
  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    super.onLayout(changed, left, top, right, bottom);
    final float density = getContext().getResources().getDisplayMetrics().density;
    mDiameter = Math.min(getMeasuredWidth(), getMeasuredHeight());
    if (mDiameter <= 0) {
      mDiameter = (int) density * DEFAULT_CIRCLE_DIAMETER;
    }
    if (getBackground() == null && mCircleBackgroundEnabled) {
      final int shadowYOffset = (int) (density * Y_OFFSET);
      final int shadowXOffset = (int) (density * X_OFFSET);
      mShadowRadius = (int) (density * SHADOW_RADIUS);

      if (elevationSupported()) {
        mBgCircle = new ShapeDrawable(new OvalShape());
        ViewCompat.setElevation(this, SHADOW_ELEVATION * density);
      } else {
        OvalShape oval = new OvalShadow(mShadowRadius, mDiameter - mShadowRadius * 2);
        mBgCircle = new ShapeDrawable(oval);
        ViewCompat.setLayerType(this, ViewCompat.LAYER_TYPE_SOFTWARE, mBgCircle.getPaint());
        mBgCircle
            .getPaint()
            .setShadowLayer(mShadowRadius, shadowXOffset, shadowYOffset, KEY_SHADOW_COLOR);
        final int padding = (int) mShadowRadius;
        // set padding so the inner image sits correctly within the shadow.
        setPadding(padding, padding, padding, padding);
      }
      mBgCircle.getPaint().setColor(mBackGroundColor);
      setBackgroundDrawable(mBgCircle);
    }
    mProgressDrawable.setBackgroundColor(mBackGroundColor);
    mProgressDrawable.setColorSchemeColors(mColors);
    mProgressDrawable.setSizeParameters(
        mDiameter,
        mDiameter,
        mInnerRadius <= 0 ? (mDiameter - mProgressStokeWidth * 2) / 4 : mInnerRadius,
        mProgressStokeWidth,
        mArrowWidth < 0 ? mProgressStokeWidth * 4 : mArrowWidth,
        mArrowHeight < 0 ? mProgressStokeWidth * 2 : mArrowHeight);
    if (isShowArrow()) {
      mProgressDrawable.showArrowOnFirstStart(true);
      mProgressDrawable.setArrowScale(1f);
      mProgressDrawable.showArrow(true);
    }
    super.setImageDrawable(null);
    super.setImageDrawable(mProgressDrawable);
    mProgressDrawable.setAlpha(255);
    mProgressDrawable.setStartEndTrim(0f, 0.75f);
  }
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
   mThisWidth = right - left;
   mThisHeight = bottom - top;
   Runnable r = mOnLayoutRunnable;
   if (r != null) {
     mOnLayoutRunnable = null;
     r.run();
   }
   if (mBitmapDisplayed.getBitmap() != null) {
     getProperBaseMatrix(mBitmapDisplayed, mBaseMatrix);
     setImageMatrix(getImageViewMatrix());
   }
 }
Ejemplo n.º 7
0
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
   if (popupWindow != null && popupWindow.isShowing()) {
     if (showFromBottom) {
       popupWindow.update(
           this,
           -popupLayout.getMeasuredWidth() + getMeasuredWidth() + AndroidUtilities.dp(14),
           getOffsetY(),
           -1,
           -1);
     } else {
       popupWindow.update(
           this,
           parentMenu.parentActionBar.getMeasuredWidth()
               - popupLayout.getMeasuredWidth()
               - getLeft()
               - parentMenu.getLeft(),
           getOffsetY(),
           -1,
           -1);
     }
   }
 }
Ejemplo n.º 8
0
 @Override
 protected void onLayout(boolean changed, int l, int t, int r, int b) {
   super.onLayout(changed, l, t, r, b);
   System.out.println("YNImageView onLayout");
 }
Ejemplo n.º 9
0
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   if (false == mFirstAnimPlay) getLocationInWindow(mLocation);
   super.onLayout(changed, left, top, right, bottom);
 }
Ejemplo n.º 10
0
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
   loadImageIfNecessary();
 }
Ejemplo n.º 11
0
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   System.out.println("onLayout->hree");
   super.onLayout(changed, left, top, right, bottom);
 }
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   super.onLayout(changed, left, top, right, bottom);
   measure();
 }
 @Override
 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
   setBitmapIfDownloaded();
   super.onLayout(changed, left, top, right, bottom);
 }