コード例 #1
0
  /** {@inheritDoc} */
  @Override
  public void draw(Canvas canvas) {
    super.draw(canvas);

    if (mForeground != null) {
      final Drawable foreground = mForeground;

      if (mForegroundBoundsChanged) {
        mForegroundBoundsChanged = false;
        final Rect selfBounds = mSelfBounds;
        final Rect overlayBounds = mOverlayBounds;

        final int w = mRight - mLeft;
        final int h = mBottom - mTop;

        if (mForegroundInPadding) {
          selfBounds.set(0, 0, w, h);
        } else {
          selfBounds.set(mPaddingLeft, mPaddingTop, w - mPaddingRight, h - mPaddingBottom);
        }

        final int layoutDirection = getLayoutDirection();
        Gravity.apply(
            mForegroundGravity,
            foreground.getIntrinsicWidth(),
            foreground.getIntrinsicHeight(),
            selfBounds,
            overlayBounds,
            layoutDirection);
        foreground.setBounds(overlayBounds);
      }

      foreground.draw(canvas);
    }
  }
コード例 #2
0
ファイル: SlidingPaneLayout.java プロジェクト: zezadas/camera
 /*
  * Enabled aggressive block sorting
  */
 @Override
 public void draw(Canvas canvas) {
     int n;
     int n2;
     super.draw(canvas);
     Drawable drawable = this.isLayoutRtlSupport() ? this.mShadowDrawableRight : this.mShadowDrawableLeft;
     if (this.getChildCount() <= 1) {
         return;
     }
     View view = this.getChildAt(1);
     if (view == null || drawable == null) {
         return;
     }
     int n3 = view.getTop();
     int n4 = view.getBottom();
     int n5 = drawable.getIntrinsicWidth();
     if (this.isLayoutRtlSupport()) {
         n = view.getRight();
         n2 = n + n5;
     } else {
         n2 = view.getLeft();
         n = n2 - n5;
     }
     drawable.setBounds(n, n3, n2, n4);
     drawable.draw(canvas);
 }
コード例 #3
0
  @Override
  public void draw(Canvas c) {
    super.draw(c);

    // draw the shadow
    if (mShadowDrawable != null) {
      final int right = mSlideableView.getRight();
      final int top;
      final int bottom;
      if (mIsSlidingUp) {
        top = mSlideableView.getTop() - mShadowHeight;
        bottom = mSlideableView.getTop();
      } else {
        top = mSlideableView.getBottom();
        bottom = mSlideableView.getBottom() + mShadowHeight;
      }
      final int left = mSlideableView.getLeft();
      mShadowDrawable.setBounds(left, top, right, bottom);
      mShadowDrawable.draw(c);
    }
  }
コード例 #4
0
 @Override
 public void draw(Canvas canvas) {
   super.draw(canvas);
   handlePaint(canvas);
 }
コード例 #5
0
 @Override
 public void draw(Canvas canvas) {
   super.draw(canvas);
   mProgressBar.draw(canvas);
   mProgressBarBottom.draw(canvas);
 }