android.graphics.PorterDuff#Mode ( )源码实例Demo

下面列出了android.graphics.PorterDuff#Mode ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: android_9.0.0_r45   文件: RecordingCanvas.java
@Override
public final void drawColor(@ColorInt int color, @NonNull PorterDuff.Mode mode) {
    nDrawColor(mNativeCanvasWrapper, color, mode.nativeInt);
}
 
源代码2 项目: android_9.0.0_r45   文件: Switch.java
/**
 * Specifies the blending mode used to apply the tint specified by
 * {@link #setTrackTintList(ColorStateList)}} to the track drawable.
 * The default mode is {@link PorterDuff.Mode#SRC_IN}.
 *
 * @param tintMode the blending mode used to apply the tint, may be
 *                 {@code null} to clear tint
 * @attr ref android.R.styleable#Switch_trackTintMode
 * @see #getTrackTintMode()
 * @see Drawable#setTintMode(PorterDuff.Mode)
 */
public void setTrackTintMode(@Nullable PorterDuff.Mode tintMode) {
    mTrackTintMode = tintMode;
    mHasTrackTintMode = true;

    applyTrackTint();
}
 
源代码3 项目: android_9.0.0_r45   文件: Switch.java
/**
 * Specifies the blending mode used to apply the tint specified by
 * {@link #setThumbTintList(ColorStateList)}} to the thumb drawable.
 * The default mode is {@link PorterDuff.Mode#SRC_IN}.
 *
 * @param tintMode the blending mode used to apply the tint, may be
 *                 {@code null} to clear tint
 * @attr ref android.R.styleable#Switch_thumbTintMode
 * @see #getThumbTintMode()
 * @see Drawable#setTintMode(PorterDuff.Mode)
 */
public void setThumbTintMode(@Nullable PorterDuff.Mode tintMode) {
    mThumbTintMode = tintMode;
    mHasThumbTintMode = true;

    applyThumbTint();
}
 
源代码4 项目: android_9.0.0_r45   文件: ImageView.java
/**
 * Specifies the blending mode used to apply the tint specified by
 * {@link #setImageTintList(ColorStateList)}} to the image drawable. The default
 * mode is {@link PorterDuff.Mode#SRC_IN}.
 *
 * @param tintMode the blending mode used to apply the tint, may be
 *                 {@code null} to clear tint
 * @attr ref android.R.styleable#ImageView_tintMode
 * @see #getImageTintMode()
 * @see Drawable#setTintMode(PorterDuff.Mode)
 */
public void setImageTintMode(@Nullable PorterDuff.Mode tintMode) {
    mDrawableTintMode = tintMode;
    mHasDrawableTintMode = true;

    applyImageTint();
}
 
源代码5 项目: android_9.0.0_r45   文件: ProgressBar.java
/**
 * Specifies the blending mode used to apply the tint specified by
 * {@link #setSecondaryProgressTintList(ColorStateList)}} to the secondary
 * progress indicator. The default mode is
 * {@link PorterDuff.Mode#SRC_ATOP}.
 *
 * @param tintMode the blending mode used to apply the tint, may be
 *                 {@code null} to clear tint
 * @attr ref android.R.styleable#ProgressBar_secondaryProgressTintMode
 * @see #setSecondaryProgressTintList(ColorStateList)
 * @see Drawable#setTintMode(PorterDuff.Mode)
 */
public void setSecondaryProgressTintMode(@Nullable PorterDuff.Mode tintMode) {
    if (mProgressTintInfo == null) {
        mProgressTintInfo = new ProgressTintInfo();
    }
    mProgressTintInfo.mSecondaryProgressTintMode = tintMode;
    mProgressTintInfo.mHasSecondaryProgressTintMode = true;

    if (mProgressDrawable != null) {
        applySecondaryProgressTint();
    }
}
 
源代码6 项目: android_9.0.0_r45   文件: AbsSeekBar.java
/**
 * Specifies the blending mode used to apply the tint specified by
 * {@link #setThumbTintList(ColorStateList)}} to the thumb drawable. The
 * default mode is {@link PorterDuff.Mode#SRC_IN}.
 *
 * @param tintMode the blending mode used to apply the tint, may be
 *                 {@code null} to clear tint
 *
 * @attr ref android.R.styleable#SeekBar_thumbTintMode
 * @see #getThumbTintMode()
 * @see Drawable#setTintMode(PorterDuff.Mode)
 */
public void setThumbTintMode(@Nullable PorterDuff.Mode tintMode) {
    mThumbTintMode = tintMode;
    mHasThumbTintMode = true;

    applyThumbTint();
}
 
源代码7 项目: android_9.0.0_r45   文件: ProgressBar.java
/**
 * Specifies the blending mode used to apply the tint specified by
 * {@link #setIndeterminateTintList(ColorStateList)} to the indeterminate
 * drawable. The default mode is {@link PorterDuff.Mode#SRC_IN}.
 *
 * @param tintMode the blending mode used to apply the tint, may be
 *                 {@code null} to clear tint
 * @attr ref android.R.styleable#ProgressBar_indeterminateTintMode
 * @see #setIndeterminateTintList(ColorStateList)
 * @see Drawable#setTintMode(PorterDuff.Mode)
 */
public void setIndeterminateTintMode(@Nullable PorterDuff.Mode tintMode) {
    if (mProgressTintInfo == null) {
        mProgressTintInfo = new ProgressTintInfo();
    }
    mProgressTintInfo.mIndeterminateTintMode = tintMode;
    mProgressTintInfo.mHasIndeterminateTintMode = true;

    applyIndeterminateTint();
}
 
源代码8 项目: android_9.0.0_r45   文件: CheckedTextView.java
/**
 * Specifies the blending mode used to apply the tint specified by
 * {@link #setCheckMarkTintList(ColorStateList)} to the check mark
 * drawable. The default mode is {@link PorterDuff.Mode#SRC_IN}.
 *
 * @param tintMode the blending mode used to apply the tint, may be
 *                 {@code null} to clear tint
 * @attr ref android.R.styleable#CheckedTextView_checkMarkTintMode
 * @see #setCheckMarkTintList(ColorStateList)
 * @see Drawable#setTintMode(PorterDuff.Mode)
 */
public void setCheckMarkTintMode(@Nullable PorterDuff.Mode tintMode) {
    mCheckMarkTintMode = tintMode;
    mHasCheckMarkTintMode = true;

    applyCheckMarkTint();
}
 
源代码9 项目: android_9.0.0_r45   文件: ProgressBar.java
/**
 * @return the blending mode used to apply the tint to the progress
 *         background
 * @attr ref android.R.styleable#ProgressBar_progressBackgroundTintMode
 * @see #setProgressBackgroundTintMode(PorterDuff.Mode)
 */
@Nullable
public PorterDuff.Mode getProgressBackgroundTintMode() {
    return mProgressTintInfo != null ? mProgressTintInfo.mProgressBackgroundTintMode : null;
}
 
源代码10 项目: graphics-samples   文件: DrawableTintingFragment.java
/**
 * Returns the {@link android.graphics.PorterDuff.Mode} for the selected tint mode option.
 *
 * @return selected tint mode
 */
public PorterDuff.Mode getTintMode() {
    return MODES[mBlendSpinner.getSelectedItemPosition()];
}
 
源代码11 项目: android_9.0.0_r45   文件: MenuItem.java
/**
 * Specifies the blending mode used to apply the tint specified by
 * {@link #setIconTintList(ColorStateList)} to this item's icon. The default mode is
 * {@link PorterDuff.Mode#SRC_IN}.
 *
 * @param tintMode the blending mode used to apply the tint, may be
 *                 {@code null} to clear tint
 * @attr ref android.R.styleable#MenuItem_iconTintMode
 * @see #setIconTintList(ColorStateList)
 * @see Drawable#setTintMode(PorterDuff.Mode)
 */
public default MenuItem setIconTintMode(@Nullable PorterDuff.Mode tintMode) { return this; }
 
源代码12 项目: android_9.0.0_r45   文件: MenuItem.java
/**
 * Returns the blending mode used to apply the tint to this item's icon, if specified.
 *
 * @return the blending mode used to apply the tint to this item's icon
 * @attr ref android.R.styleable#MenuItem_iconTintMode
 * @see #setIconTintMode(PorterDuff.Mode)
 */
@Nullable
public default PorterDuff.Mode getIconTintMode() { return null; }
 
源代码13 项目: android_9.0.0_r45   文件: ProgressBar.java
/**
 * Returns the blending mode used to apply the tint to the secondary
 * progress drawable, if specified.
 *
 * @return the blending mode used to apply the tint to the secondary
 *         progress drawable
 * @attr ref android.R.styleable#ProgressBar_secondaryProgressTintMode
 * @see #setSecondaryProgressTintMode(PorterDuff.Mode)
 */
@Nullable
public PorterDuff.Mode getSecondaryProgressTintMode() {
    return mProgressTintInfo != null ? mProgressTintInfo.mSecondaryProgressTintMode : null;
}
 
源代码14 项目: android_9.0.0_r45   文件: Switch.java
/**
 * @return the blending mode used to apply the tint to the track
 *         drawable
 * @attr ref android.R.styleable#Switch_trackTintMode
 * @see #setTrackTintMode(PorterDuff.Mode)
 */
@Nullable
public PorterDuff.Mode getTrackTintMode() {
    return mTrackTintMode;
}
 
源代码15 项目: android_9.0.0_r45   文件: Switch.java
/**
 * @return the blending mode used to apply the tint to the thumb
 *         drawable
 * @attr ref android.R.styleable#Switch_thumbTintMode
 * @see #setThumbTintMode(PorterDuff.Mode)
 */
@Nullable
public PorterDuff.Mode getThumbTintMode() {
    return mThumbTintMode;
}
 
源代码16 项目: android_9.0.0_r45   文件: ImageView.java
/**
 * Sets a tinting option for the image.
 *
 * @param color Color tint to apply.
 * @param mode How to apply the color.  The standard mode is
 * {@link PorterDuff.Mode#SRC_ATOP}
 *
 * @attr ref android.R.styleable#ImageView_tint
 */
public final void setColorFilter(int color, PorterDuff.Mode mode) {
    setColorFilter(new PorterDuffColorFilter(color, mode));
}
 
源代码17 项目: android_9.0.0_r45   文件: RemoteViews.java
/**
 * @hide
 * Equivalent to calling
 * {@link Drawable#setColorFilter(int, android.graphics.PorterDuff.Mode)},
 * on the {@link Drawable} of a given view.
 * <p>
 *
 * @param viewId The id of the view that contains the target
 *            {@link Drawable}
 * @param targetBackground If true, apply these parameters to the
 *            {@link Drawable} returned by
 *            {@link android.view.View#getBackground()}. Otherwise, assume
 *            the target view is an {@link ImageView} and apply them to
 *            {@link ImageView#getDrawable()}.
 * @param colorFilter Specify a color for a
 *            {@link android.graphics.ColorFilter} for this drawable. This will be ignored if
 *            {@code mode} is {@code null}.
 * @param mode Specify a PorterDuff mode for this drawable, or null to leave
 *            unchanged.
 */
public void setDrawableTint(int viewId, boolean targetBackground,
        int colorFilter, @NonNull PorterDuff.Mode mode) {
    addAction(new SetDrawableTint(viewId, targetBackground, colorFilter, mode));
}
 
源代码18 项目: android_9.0.0_r45   文件: CompoundButton.java
/**
 * @return the blending mode used to apply the tint to the button drawable
 * @attr ref android.R.styleable#CompoundButton_buttonTintMode
 * @see #setButtonTintMode(PorterDuff.Mode)
 */
@Nullable
public PorterDuff.Mode getButtonTintMode() {
    return mButtonTintMode;
}
 
源代码19 项目: android_9.0.0_r45   文件: AbsSeekBar.java
/**
 * Returns the blending mode used to apply the tint to the thumb drawable,
 * if specified.
 *
 * @return the blending mode used to apply the tint to the thumb drawable
 * @attr ref android.R.styleable#SeekBar_thumbTintMode
 * @see #setThumbTintMode(PorterDuff.Mode)
 */
@Nullable
public PorterDuff.Mode getThumbTintMode() {
    return mThumbTintMode;
}
 
源代码20 项目: android_9.0.0_r45   文件: AbsSeekBar.java
/**
 * Returns the blending mode used to apply the tint to the tick mark drawable,
 * if specified.
 *
 * @return the blending mode used to apply the tint to the tick mark drawable
 * @attr ref android.R.styleable#SeekBar_tickMarkTintMode
 * @see #setTickMarkTintMode(PorterDuff.Mode)
 */
@Nullable
public PorterDuff.Mode getTickMarkTintMode() {
    return mTickMarkTintMode;
}
 
 方法所在类
 同类方法