private void setupStandardButtonOutline() {
    Outline roundRectOutline = new Outline();
    roundRectOutline.setRoundRect(
        0, 0, standardButton.getLayoutParams().width, standardButton.getLayoutParams().height, 20);

    standardButton.setOutline(roundRectOutline);
    standardButton.setClipToOutline(true);
  }
        @Override
        public void getOutline(View view, Outline outline) {
          int outlineLeft = view.getPaddingLeft();
          int outlineTop = view.getPaddingTop();

          // Apply padding to shadow.
          outline.setRoundRect(
              outlineLeft,
              outlineTop,
              view.getWidth() - outlineLeft - view.getPaddingRight(),
              view.getHeight() - outlineTop - view.getPaddingBottom(),
              sRoundedRectCornerRadius);
        }
  @Override
  public void getOutline(@NonNull Outline outline) {
    final Rect bounds = getBounds();
    if (bounds.isEmpty()) return;

    if (mNinePatchState != null) {
      NinePatch.InsetStruct insets = mNinePatchState.getBitmap().getNinePatchInsets();
      if (insets != null) {
        final Rect outlineInsets = insets.outlineRect;
        outline.setRoundRect(
            bounds.left + outlineInsets.left,
            bounds.top + outlineInsets.top,
            bounds.right - outlineInsets.right,
            bounds.bottom - outlineInsets.bottom,
            insets.outlineRadius);
        outline.setAlpha(insets.outlineAlpha * (getAlpha() / 255.0f));
        return;
      }
    }
    super.getOutline(outline);
  }
 @Override
 public void getOutline(Outline outline) {
   outline.setRoundRect(mBoundsI, mRadius);
 }
Exemplo n.º 5
0
 @Override
 public void getOutline(@NonNull Outline outline) {
   outline.setRoundRect(getBounds(), cornerRadius);
 }
Exemplo n.º 6
0
 @TargetApi(Build.VERSION_CODES.LOLLIPOP)
 @Override
 public void getOutline(@NonNull Outline outline) {
   outline.setRoundRect(getBounds(), cornerRadius);
 }
Exemplo n.º 7
0
 @Override
 public void setRoundRect(Rect rect, float radius) {
   outline.setRoundRect(rect, radius);
 }
Exemplo n.º 8
0
 @Override
 public void setRoundRect(int left, int top, int right, int bottom, float radius) {
   outline.setRoundRect(left, top, right, bottom, radius);
 }