library/src/main/java/com/telly/mrvector/Utils.java
static PorterDuffColorFilter updateTintFilter(Drawable drawable, PorterDuffColorFilter tintFilter, ColorStateList tint,
                                                PorterDuff.Mode tintMode) {
    if (tint == null || tintMode == null) {
      return null;
    }

    final int color = tint.getColorForState(drawable.getState(), Color.TRANSPARENT);

    if (tintFilter == null || !LOLLIPOP_PLUS) { // TODO worth caching them?
      return new PorterDuffColorFilter(color, tintMode);
    }

    tryInvoke(tintFilter, "setColor", INT_ARG, color);
    tryInvoke(tintFilter, "setMode", MODE_ARG, tintMode);
    return tintFilter;
  }
/**
   * Ensures the tint filter is consistent with the current tint color and
   * mode.
   */
Ensures the tint filter is consistent with the current tint color and
mode.
Ensures the tint filter is consistent with the current tint color and mode .
static PorterDuffColorFilter updateTintFilter(Drawable drawable, PorterDuffColorFilter tintFilter, ColorStateList tint,
                                                PorterDuff.Mode tintMode) {
    if (tint == null || tintMode == null) {
      return null;
    }
    final int color = tint.getColorForState(drawable.getState(), Color.TRANSPARENT);
    if (tintFilter == null || !LOLLIPOP_PLUS) { 
      return new PorterDuffColorFilter(color, tintMode);
    }
    tryInvoke(tintFilter, "setColor", INT_ARG, color);
    tryInvoke(tintFilter, "setMode", MODE_ARG, tintMode);
    return tintFilter;
  }
static PorterDuffColorFilter updateTintFilter ( Drawable drawable , PorterDuffColorFilter tintFilter , ColorStateList tint , PorterDuff . Mode tintMode ) { if ( tint == null || tintMode == null ) { return null ; } final int color = tint . getColorForState ( drawable . getState ( ) , Color . TRANSPARENT ) ; if ( tintFilter == null || ! LOLLIPOP_PLUS ) { return new PorterDuffColorFilter ( color , tintMode ) ; } tryInvoke ( tintFilter , "setColor" , INT_ARG , color ) ; tryInvoke ( tintFilter , "setMode" , MODE_ARG , tintMode ) ; return tintFilter ; }
Ensures the tint filter is consistent with the current tint color and
 mode.
Ensures the tint filter is consistent with the current tint color and mode .
// TODO worth caching them?