public SimpleColorFilter(@ColorInt int color) { super(color, PorterDuff.Mode.SRC_ATOP); } }
public DocumentData(String text, String fontName, double size, Justification justification, int tracking, double lineHeight, double baselineShift, @ColorInt int color, @ColorInt int strokeColor, double strokeWidth, boolean strokeOverFill) { this.text = text; this.fontName = fontName; this.size = size; this.justification = justification; this.tracking = tracking; this.lineHeight = lineHeight; this.baselineShift = baselineShift; this.color = color; this.strokeColor = strokeColor; this.strokeWidth = strokeWidth; this.strokeOverFill = strokeOverFill; }
public FancyQuoteSpan(int quoteLineWidth, int quoteLineIndent, @ColorInt int quoteLineColor) { super(); lineWidth = quoteLineWidth; gapWidth = quoteLineIndent; lineColor = quoteLineColor; }
/** * Set the background color for the Slider. * This is the view containing the list. * * @param sliderBackgroundColor * @return */ public DrawerBuilder withSliderBackgroundColor(@ColorInt int sliderBackgroundColor) { this.mSliderBackgroundColor = sliderBackgroundColor; return this; }
public MorphDrawable(@ColorInt int color, float cornerRadius) { this.cornerRadius = cornerRadius; paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setColor(color); }
/** * Configure {@code intent} with the extras needed to initialize this transition. */ public static void addExtras(@NonNull Intent intent, @ColorInt int startColor, int startCornerRadius) { intent.putExtra(EXTRA_SHARED_ELEMENT_START_COLOR, startColor); intent.putExtra(EXTRA_SHARED_ELEMENT_START_CORNER_RADIUS, startCornerRadius); }
public GridItemDividerDecoration(@Dimension int dividerSize, @ColorInt int dividerColor) { this.dividerSize = dividerSize; paint = new Paint(); paint.setColor(dividerColor); paint.setStyle(Paint.Style.FILL); }
/** * Check if a color is dark (convert to XYZ & check Y component) */ public static boolean isDark(@ColorInt int color) { return androidx.core.graphics.ColorUtils.calculateLuminance(color) < 0.5; }
/** * Configure {@code intent} with the extras needed to initialize this transition. */ public static void addExtras(@NonNull Intent intent, @ColorInt int fabColor, @DrawableRes int fabIconResId) { intent.putExtra(EXTRA_FAB_COLOR, fabColor); intent.putExtra(EXTRA_FAB_ICON_RES_ID, fabIconResId); }
public void setScrimColor(@ColorInt int scrimColor) { if (this.scrimColor != scrimColor) { this.scrimColor = scrimColor; postInvalidateOnAnimation(); } }
public void setBorderColor(@ColorInt int borderColor) { if (borderColor == mBorderColor) { return; } mBorderColor = borderColor; mBorderPaint.setColor(mBorderColor); invalidate(); }
public void setCircleBackgroundColor(@ColorInt int circleBackgroundColor) { if (circleBackgroundColor == mCircleBackgroundColor) { return; } mCircleBackgroundColor = circleBackgroundColor; mCircleBackgroundPaint.setColor(circleBackgroundColor); invalidate(); }
public void setColor(@ColorInt int color) { paint.setColor(color); invalidateSelf(); }
public MorphTransform(@ColorInt int startColor, @ColorInt int endColor, int startCornerRadius, int endCornerRadius) { this.startColor = startColor; this.endColor = endColor; this.startCornerRadius = startCornerRadius; this.endCornerRadius = endCornerRadius; setDuration(DEFAULT_DURATION); setPathMotion(new GravityArcMotion()); }
public static RippleDrawable createRipple(@ColorInt int color, @FloatRange(from = 0f, to = 1f) float alpha, boolean bounded) { color = ColorUtils.modifyAlpha(color, alpha); return new RippleDrawable(ColorStateList.valueOf(color), null, bounded ? new ColorDrawable(Color.WHITE) : null); }
public FabTransform(@ColorInt int fabColor, @DrawableRes int fabIconResId) { color = fabColor; icon = fabIconResId; setPathMotion(new GravityArcMotion()); setDuration(DEFAULT_DURATION); }
/** * [r,g,b] */ @ColorInt static int jsonToColor(JsonReader reader) throws IOException { reader.beginArray(); int r = (int) (reader.nextDouble() * 255); int g = (int) (reader.nextDouble() * 255); int b = (int) (reader.nextDouble() * 255); while (reader.hasNext()) { reader.skipValue(); } reader.endArray(); return Color.argb(255, r, g, b); }