Android LightingColorFilter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android LightingColorFilter class.

This code example shows how to use the following methods:
    @Deprecated 
    public ActionBarDrawable(Resources res, Drawable d, int normalColor, int altColor) {
        // TODO Cyril: Remove this constructor or the similar Context-based one. 
        // They are actually the same ... 
        super(res, (d instanceof BitmapDrawable) ? ((BitmapDrawable) d).getBitmap() : null);
        mNormalCf = new LightingColorFilter(Color.BLACK, normalColor);
        mAltCf = new LightingColorFilter(Color.BLACK, altColor);
    } 
 
    /** 
     * Create a new ActionBarDrawable using the specified resource identifier. 
     *  
     * @param context The Context used to retrieve resources (Bitmap/theme) 
     * @param resId The resource identifier pointing to the icon's Bitmap 
     */ 
    public ActionBarDrawable(Context context, int resId) {
        this(context, context.getResources().getDrawable(resId));
    } 
 
    /** 
7
CodeRank
This code example shows how to use the following methods:
            c.drawBitmap(mBase, 0, 0, null);
            // 2 - Draw the pin on top of it 
            mPaint.setColorFilter(new LightingColorFilter(Color.BLACK, mCurrentPinColor));
            c.drawBitmap(mPin, 0, 0, mPaint);
            // 3 - Draw the dot on top of everything 
            mPaint.setColorFilter(new LightingColorFilter(Color.BLACK, mCurrentDotColor));
            c.drawBitmap(mDot, 0, 0, mPaint);
 
            mNeedRebuild = false;
        } 
 
        canvas.drawBitmap(mMapPin, null, getBounds(), mMapPinPaint);
    } 
 
    @Override 
    public void setAlpha(int alpha) {
        mMapPinPaint.setAlpha(alpha);
    } 
 
    @Override 
7
CodeRank
This code example shows how to use the following methods:
package greendroid.widget; 
 
import android.content.Context; 
import android.graphics.Color; 
import android.graphics.ColorFilter; 
import android.graphics.LightingColorFilter; 
import android.graphics.drawable.Drawable; 
 
public class MyQuickAction extends QuickAction { 
    private static final ColorFilter BLACK_CF = new LightingColorFilter(Color.BLACK, Color.BLACK);
 
    public MyQuickAction(Context ctx, int drawableId, int titleId) {
        super(ctx, buildDrawable(ctx, drawableId), titleId);
    } 
     
    public static Drawable buildDrawable(Context ctx, int drawableId) {
        Drawable d = ctx.getResources().getDrawable(drawableId);
        d.setColorFilter(BLACK_CF);
        return d;
    } 

6
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
        Bitmap output = Bitmap.createBitmap(destWidth, destHeight, Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(output);
        Paint paint = new Paint();
        paint.setFilterBitmap(true);
        paint.setDither(true);
        paint.setColorFilter(new LightingColorFilter(MULTIPLY_COLOR, 0));
        canvas.scale(scale, scale);
        canvas.drawBitmap(filtered, 0f, 0f, paint);
        filtered.recycle();
 
        // Clear the texture 
        mBaseTexture = null;
        return output;
    } 
 
    private static void boxBlurFilter(int[] in, int[] out, int width, int height, int startFadeX) {
        int inPos = 0;
        int maxX = width - 1;
        for (int y = 0; y < height; ++y) {
            // Evaluate the kernel for the first pixel in the row. 
6
CodeRank
This code example shows how to use the following methods:
 
public class GeckoStateListDrawable extends StateListDrawable {
    private LightingColorFilter mFilter;
 
    public void initializeFilter(int color) {
        mFilter = new LightingColorFilter(Color.WHITE, color);
    } 
 
    @Override 
    protected boolean onStateChange(int[] stateSet) {
        for (int state: stateSet) {
            if (state == android.R.attr.state_pressed || state == android.R.attr.state_focused) {
                super.onStateChange(stateSet);
                ((LayerDrawable) getCurrent()).getDrawable(0).setColorFilter(mFilter);
                return true; 
            } 
        } 
 
        return super.onStateChange(stateSet);
    } 
5
CodeRank
This code example shows how to use the following methods:
		textPaintRed.setColor(Color.RED);
 
		bitmapPaint = createBaseBitmapPaint();
 
		bitmapPaintRed = createBaseBitmapPaint();
		ColorFilter filter = new LightingColorFilter(Color.RED, 1);
		bitmapPaintRed.setColorFilter(filter);
 
		setBackgroundColor(Color.BLACK);
		getBackground().setAlpha(200);
 
	} 
 
	private Paint createTextPaint() {
		Paint textPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
		textPaint.setStyle(Style.FILL);
		textPaint.setTextAlign(Paint.Align.CENTER);
		textPaint.setTypeface(Typeface.DEFAULT_BOLD);
		return textPaint;
	} 
5
CodeRank
This code example shows how to use the following methods:setColorFilter
public class PlusYouLightingColorFilterButton extends Button {
 
    public PlusYouLightingColorFilterButton(Context context, AttributeSet attrs) {
        super(context, attrs);
 
        getBackground().setColorFilter(new LightingColorFilter(0x6d8d2d, 0));
    } 
} 
5
CodeRank
This code example shows how to use the following methods:setColorFilter
public class PlusYouLightingColorFilterImageButton extends ImageButton {
 
    public PlusYouLightingColorFilterImageButton(Context context, AttributeSet attrs) {
        super(context, attrs);
 
        getBackground().setColorFilter(new LightingColorFilter(0x6d8d2d, 0));
    } 
} 
5
CodeRank
This code example shows how to use the following methods:
            c.drawRect(0, 0, mMapPin.getWidth(), mMapPin.getHeight(), sClearerPaint);
 
            // 1 - Draw the base 
            c.drawBitmap(mBase, 0, 0, null);
            // 2 - Draw the pin on top of it 
            mPaint.setColorFilter(new LightingColorFilter(Color.BLACK, mCurrentPinColor));
            c.drawBitmap(mPin, 0, 0, mPaint);
            // 3 - Draw the dot on top of everything 
            mPaint.setColorFilter(new LightingColorFilter(Color.BLACK, mCurrentDotColor));
            c.drawBitmap(mDot, 0, 0, mPaint);
 
            mNeedRebuild = false;
        } 
 
        canvas.drawBitmap(mMapPin, null, getBounds(), mMapPinPaint);
    } 
 
    @Override 
    public void setAlpha(final int alpha) {
        mMapPinPaint.setAlpha(alpha);
5
CodeRank

Related Android LightingColorFilter Questions & Answers:

See Code Examples for Android LightingColorFilter Methods: