/** * Set the color used for styling the tab text. This will need to be called prior to calling * {@link #setViewPager(android.support.v4.view.ViewPager)} otherwise it will not get set * * @param color to use for tab text */ public void setDefaultTabTextColor(int color) { tabViewTextColors = ColorStateList.valueOf(color); }
/** * Set the border color. * * @param color the color to set. * @return the builder for chaining. */ public RoundedTransformationBuilder borderColor(int color) { mBorderColor = ColorStateList.valueOf(color); return this; }
public Builder strokeColor(int color){ mStrokeColor = ColorStateList.valueOf(color); return this; }
public Builder strokeColor(int color){ mStrokeColor = ColorStateList.valueOf(color); return this; }
public RadioButtonDrawable build(){ if(mStrokeColor == null) mStrokeColor = ColorStateList.valueOf(0xFF000000); return new RadioButtonDrawable(mWidth, mHeight, mStrokeSize, mStrokeColor, mRadius, mInnerRadius, mAnimDuration); }
public CheckBoxDrawable build(){ if(mStrokeColor == null) mStrokeColor = ColorStateList.valueOf(0xFF000000); return new CheckBoxDrawable(mWidth, mHeight, mBoxSize, mCornerRadius, mStrokeSize, mStrokeColor, mTickColor, mAnimDuration); }
@Override public void setTint(int tint) { setTintList(ColorStateList.valueOf(tint)); }
public RoundedDrawable setBorderColor(ColorStateList colors) { mBorderColor = colors != null ? colors : ColorStateList.valueOf(0); mBorderPaint.setColor(mBorderColor.getColorForState(getState(), DEFAULT_BORDER_COLOR)); return this; }
/** * Set contour color. * * @return The current IconicsDrawable for chaining. */ @NonNull public IconicsDrawable contourColor(@ColorInt int color) { return contourColor(ColorStateList.valueOf(color)); }
/** * Set the color of the drawable. * * @param color The color, usually from android.graphics.Color or 0xFF012345. * @return The current IconicsDrawable for chaining. */ @NonNull public IconicsDrawable color(@ColorInt int color) { return color(ColorStateList.valueOf(color)); }
/** * Set background contour color. * * @return The current IconicsDrawable for chaining. */ @NonNull public IconicsDrawable backgroundContourColor(@ColorInt int color) { return backgroundContourColor(ColorStateList.valueOf(color)); }
/** * Set background color. * * @return The current IconicsDrawable for chaining. */ @NonNull public IconicsDrawable backgroundColor(@ColorInt int color) { return backgroundColor(ColorStateList.valueOf(color)); }
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 void setColor(int color){ mColorStateList = ColorStateList.valueOf(color); onStateChange(getState()); }
private void setThemeColor(int colorPrimary, int colorPrimaryDark) { mToolbar.setBackgroundResource(colorPrimary); mAppBarLayout.setBackgroundResource(colorPrimary); mToolbarLayout.setContentScrimResource(colorPrimary); mRefreshLayout.setPrimaryColorsId(colorPrimary, android.R.color.white); mActionButton.setBackgroundColor(ContextCompat.getColor(this, colorPrimaryDark)); mActionButton.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(this, colorPrimaryDark))); if (Build.VERSION.SDK_INT >= 21) { getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); } }
private void setThemeColor(int colorPrimary, int colorPrimaryDark) { mToolbar.setBackgroundResource(colorPrimary); mAppBarLayout.setBackgroundResource(colorPrimary); mToolbarLayout.setContentScrimResource(colorPrimary); mRefreshLayout.setPrimaryColorsId(colorPrimary, android.R.color.white); mActionButton.setBackgroundColor(ContextCompat.getColor(this, colorPrimaryDark)); mActionButton.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(this, colorPrimaryDark))); if (Build.VERSION.SDK_INT >= 21) { getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); } }
public void setBorderColor(ColorStateList colors) { if (mBorderColor.equals(colors)) { return; } mBorderColor = (colors != null) ? colors : ColorStateList.valueOf(RoundedDrawable.DEFAULT_BORDER_COLOR); updateDrawableAttrs(); updateBackgroundDrawableAttrs(false); if (mBorderWidth > 0) { invalidate(); } }
public void setSupportProgressTint(ColorStateList tint) { Log.e("themep", " set progress tint"); if (tint != null) { if (mProgressTintInfo == null) { mProgressTintInfo = new TintInfo(); } mProgressTintInfo.mHasTintList = true; mProgressTintInfo.mTintList = ColorStateList.valueOf(ThemeUtils.getColor(mView.getContext(), tint.getDefaultColor())); Log.e("themep", "color = " + ColorStateList.valueOf(ThemeUtils.getColor(mView.getContext(), tint.getDefaultColor())).getDefaultColor()); } applySupportProgressTint(); }
@Override public void onClick(View v) { int color = ContextCompat.getColor(getApplication(), ids[index % ids.length]); mRefreshLayout.setPrimaryColors(color); mActionButton.setBackgroundColor(color); mActionButton.setBackgroundTintList(ColorStateList.valueOf(color)); mToolbarLayout.setContentScrimColor(color); index++; } };
private void setSupportIndeterminateTint(ColorStateList tint) { if (tint != null) { if (mIndeterminateTintInfo == null) { mIndeterminateTintInfo = new TintInfo(); } mIndeterminateTintInfo.mHasTintList = true; mIndeterminateTintInfo.mTintList = ColorStateList.valueOf(ThemeUtils.getColor(mView.getContext(), tint.getDefaultColor())); } applySupportIndeterminateTint(); }