/* Android's elevation implementation requires this to be implemented to know where to draw the shadow. */
  @Override
  public void getOutline(Outline outline) {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
      super.getOutline(outline);
      return;
    }
    if ((!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0)
        || mBorderCornerRadii != null) {
      updatePath();

      outline.setConvexPath(mPathForBorderRadiusOutline);
    } else {
      outline.setRect(getBounds());
    }
  }
Exemple #2
0
 @Override
 public void setRect(Rect rect) {
   outline.setRect(rect);
 }
Exemple #3
0
 /**
  * Called to get the drawable to populate the Outline that defines its drawing area.
  *
  * <p>This method is called by the default {@link android.view.ViewOutlineProvider} to define the
  * outline of the View.
  *
  * <p>The default behavior defines the outline to be the bounding rectangle of 0 alpha. Subclasses
  * that wish to convey a different shape or alpha value must override this method.
  *
  * @see android.view.View#setOutlineProvider(android.view.ViewOutlineProvider)
  */
 public void getOutline(@NonNull Outline outline) {
   outline.setRect(getBounds());
   outline.setAlpha(0);
 }
Exemple #4
0
 @Override
 public void setRect(int left, int top, int right, int bottom) {
   outline.setRect(left, top, right, bottom);
 }