示例#1
0
  @Override
  @Implementation
  public boolean equals(Object o) {
    if (realObject == o) return true;
    if (o == null || realObject.getClass() != o.getClass()) return false;

    ShadowDrawable that = shadowOf((Drawable) o);

    if (intrinsicHeight != that.intrinsicHeight) return false;
    if (intrinsicWidth != that.intrinsicWidth) return false;
    if (bounds != null ? !bounds.equals(that.bounds) : that.bounds != null) return false;

    return true;
  }
示例#2
0
 public void setImageFrame(Rect imageFrame, int orientation) {
   if (mImageFrame != null && mImageFrame.equals(imageFrame)) {
     return;
   }
   if (getType() == Action.ADD_ACTION) {
     return;
   }
   Bitmap temp = MasterImage.getImage().getTemporaryThumbnailBitmap();
   if (temp != null) {
     mImage = temp;
   }
   Bitmap bitmap = MasterImage.getImage().getThumbnailBitmap();
   if (bitmap != null) {
     mImageFrame = imageFrame;
     int w = mImageFrame.width();
     int h = mImageFrame.height();
     postNewIconRenderRequest(w, h);
   }
 }
 public void setPosition(
     int x,
     int y,
     int width,
     int height,
     RendererCommon.ScalingType scalingType,
     boolean mirror) {
   final Rect layoutInPercentage =
       new Rect(x, y, Math.min(100, x + width), Math.min(100, y + height));
   synchronized (updateLayoutLock) {
     if (layoutInPercentage.equals(this.layoutInPercentage)
         && scalingType == this.scalingType
         && mirror == this.mirror) {
       return;
     }
     Logging.d(
         TAG,
         "ID: "
             + id
             + ". YuvImageRenderer.setPosition: ("
             + x
             + ", "
             + y
             + ") "
             + width
             + " x "
             + height
             + ". Scaling: "
             + scalingType
             + ". Mirror: "
             + mirror);
     this.layoutInPercentage.set(layoutInPercentage);
     this.scalingType = scalingType;
     this.mirror = mirror;
     updateLayoutProperties = true;
   }
 }
  /** Report the current cursor location in its window. */
  public void updateCursor(View view, int left, int top, int right, int bottom) {
    checkFocus();
    synchronized (mH) {
      if ((mServedView != view
              && (mServedView == null || !mServedView.checkInputConnectionProxy(view)))
          || mCurrentTextBoxAttribute == null
          || mCurMethod == null) {
        return;
      }

      mTmpCursorRect.set(left, top, right, bottom);
      if (!mCursorRect.equals(mTmpCursorRect)) {
        if (DEBUG) Log.d(TAG, "updateCursor");

        try {
          if (DEBUG) Log.v(TAG, "CURSOR CHANGE: " + mCurMethod);
          mCurMethod.updateCursor(mTmpCursorRect);
          mCursorRect.set(mTmpCursorRect);
        } catch (RemoteException e) {
          Log.w(TAG, "IME died: " + mCurId, e);
        }
      }
    }
  }