Search in sources :

Example 1 with PorterDuffColorFilter

use of android.graphics.PorterDuffColorFilter in project UltimateAndroid by cymcsg.

the class CircularImageView method setSelectorColor.

/**
	 * Sets the color of the selector to be draw over the
	 * CircularImageView. Be sure to provide some opacity.
	 * @param selectorColor The color (including alpha) to set for the selector overlay.
	 */
public void setSelectorColor(int selectorColor) {
    this.selectorFilter = new PorterDuffColorFilter(selectorColor, PorterDuff.Mode.SRC_ATOP);
    this.invalidate();
}
Also used : PorterDuffColorFilter(android.graphics.PorterDuffColorFilter)

Example 2 with PorterDuffColorFilter

use of android.graphics.PorterDuffColorFilter in project UltimateAndroid by cymcsg.

the class CircularImageView method setSelectorColor.

/**
	 * Sets the color of the selector to be draw over the
	 * CircularImageView. Be sure to provide some opacity.
	 * @param selectorColor The color (including alpha) to set for the selector overlay.
	 */
public void setSelectorColor(int selectorColor) {
    this.selectorFilter = new PorterDuffColorFilter(selectorColor, PorterDuff.Mode.SRC_ATOP);
    this.invalidate();
}
Also used : PorterDuffColorFilter(android.graphics.PorterDuffColorFilter)

Example 3 with PorterDuffColorFilter

use of android.graphics.PorterDuffColorFilter in project UltimateAndroid by cymcsg.

the class SlidingLayout method dimChildView.

private void dimChildView(View v, float mag, int fadeColor) {
    final LayoutParams lp = (LayoutParams) v.getLayoutParams();
    if (mag > 0 && fadeColor != 0) {
        final int baseAlpha = (fadeColor & 0xff000000) >>> 24;
        int imag = (int) (baseAlpha * mag);
        int color = imag << 24 | (fadeColor & 0xffffff);
        if (lp.dimPaint == null) {
            lp.dimPaint = new Paint();
        }
        lp.dimPaint.setColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.SRC_OVER));
        if (ViewCompat.getLayerType(v) != ViewCompat.LAYER_TYPE_HARDWARE) {
            ViewCompat.setLayerType(v, ViewCompat.LAYER_TYPE_HARDWARE, lp.dimPaint);
        }
        invalidateChildRegion(v);
    } else if (ViewCompat.getLayerType(v) != ViewCompat.LAYER_TYPE_NONE) {
        if (lp.dimPaint != null) {
            lp.dimPaint.setColorFilter(null);
        }
        final DisableLayerRunnable dlr = new DisableLayerRunnable(v);
        mPostedRunnables.add(dlr);
        ViewCompat.postOnAnimation(this, dlr);
    }
}
Also used : PorterDuffColorFilter(android.graphics.PorterDuffColorFilter) Paint(android.graphics.Paint) Paint(android.graphics.Paint)

Example 4 with PorterDuffColorFilter

use of android.graphics.PorterDuffColorFilter in project CircularImageView by Pkmmte.

the class CircularImageView method setSelectorColor.

/**
	 * Sets the color of the selector to be draw over the
	 * CircularImageView. Be sure to provide some opacity.
	 * @param selectorColor The color (including alpha) to set for the selector overlay.
	 */
public void setSelectorColor(int selectorColor) {
    this.selectorFilter = new PorterDuffColorFilter(selectorColor, PorterDuff.Mode.SRC_ATOP);
    this.invalidate();
}
Also used : PorterDuffColorFilter(android.graphics.PorterDuffColorFilter)

Example 5 with PorterDuffColorFilter

use of android.graphics.PorterDuffColorFilter in project CircularImageView by Pkmmte.

the class CircularImageView method setSelectorColor.

/**
	 * Sets the color of the selector to be draw over the 
	 * CircularImageView. Be sure to provide some opacity.
	 * 
	 * @param selectorColor
	 */
public void setSelectorColor(int selectorColor) {
    this.selectorFilter = new PorterDuffColorFilter(selectorColor, PorterDuff.Mode.SRC_ATOP);
    this.invalidate();
}
Also used : PorterDuffColorFilter(android.graphics.PorterDuffColorFilter)

Aggregations

PorterDuffColorFilter (android.graphics.PorterDuffColorFilter)123 Paint (android.graphics.Paint)58 Canvas (android.graphics.Canvas)30 Bitmap (android.graphics.Bitmap)20 Rect (android.graphics.Rect)15 View (android.view.View)14 TextView (android.widget.TextView)14 BitmapDrawable (android.graphics.drawable.BitmapDrawable)7 BitmapShader (android.graphics.BitmapShader)6 Matrix (android.graphics.Matrix)6 Drawable (android.graphics.drawable.Drawable)6 VectorDrawable (android.graphics.drawable.VectorDrawable)6 ImageView (android.widget.ImageView)6 ObjectAnimator (android.animation.ObjectAnimator)5 ColorFilter (android.graphics.ColorFilter)5 ListView (android.widget.ListView)5 SeekBar (android.widget.SeekBar)5 RecyclerView (android.support.v7.widget.RecyclerView)4 DisplayMetrics (android.util.DisplayMetrics)4 Test (org.junit.Test)4