docs: @SuppressLint("NewApi")
      private void applyTintForDrawable(@NonNull Drawable drawable, @Nullable ColorStateList tint,
                                        boolean hasTint, @Nullable PorterDuff.Mode tintMode,
                                        boolean hasTintMode) {
  
          if (hasTint || hasTintMode) {
  
              if (hasTint) {
                  if (drawable instanceof TintableDrawable) {
                      //noinspection RedundantCast
                      ((TintableDrawable) drawable).setTintList(tint);
                  } else {
                      logDrawableTintWarning();
                      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                          drawable.setTintList(tint);
                      }
                  }
              }
  
              if (hasTintMode) {
                  if (drawable instanceof TintableDrawable) {
                      //noinspection RedundantCast
                      ((TintableDrawable) drawable).setTintMode(tintMode);
                  } else {
                      logDrawableTintWarning();
                      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                          drawable.setTintMode(tintMode);
                      }
                  }
              }
  
              // The drawable (or one of its children) may not have been
              // stateful before applying the tint, so let's try again.
              if (drawable.isStateful()) {
                  drawable.setState(getDrawableState());
              }
          }
      }