code: static ShapeDrawable getRoundedBackground(@NonNull View view, @ColorInt int color, @Corners int corners) {
          int r = view.getResources().getDimensionPixelSize(R.dimen.com_auth0_lock_widget_corner_radius);
          float[] outerR = new float[0];
          if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
              boolean languageRTL = TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) == View.LAYOUT_DIRECTION_RTL;
              if (languageRTL) {
                  //noinspection WrongConstant
                  corners = -corners;
              }
          }
          switch (corners) {
              case ONLY_LEFT:
                  outerR = new float[]{r, r, 0, 0, 0, 0, r, r};
                  break;
              case ONLY_RIGHT:
                  outerR = new float[]{0, 0, r, r, r, r, 0, 0};
                  break;
              case ALL:
                  outerR = new float[]{r, r, r, r, r, r, r, r};
                  break;
          }
  
          RoundRectShape rr = new RoundRectShape(outerR, null, null);
          ShapeDrawable drawable = new ShapeDrawable(rr);
          drawable.getPaint().setColor(color);
          return drawable;
      }
docs: Generates a rounded drawable with the given background color and the specified corners.
  
  @param view    a valid View context
  @param color   the color to use as background.
  @param corners the rounded corners this drawable will have. Can be one of ONLY_LEFT, ONLY_RIGHT, ALL
  @return the rounded drawable.