Drawable invalidateSelf - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Drawable invalidateSelf method.

This code example shows how to use the following methods:getBounds, invalidateSelf, getPaint
			mBlueText.setText(Integer.toString(blue)); 
            redSeekBar.setProgress(red); 
            greenSeekBar.setProgress(green); 
            blueSeekBar.setProgress(blue); 
			mNewBoxBackground.getPaint().setShader(getPreviewBackground(newColor, mNewBoxBackground.getBounds())); 
			mPreviousBoxBackground.getPaint().setShader(getPreviewBackground(mPreviousColor, mPreviousBoxBackground.getBounds())); 
			mNewBoxBackground.invalidateSelf(); 
			mPreviousBoxBackground.invalidateSelf(); 
			broadcastColorChange(); 
		} 
 
	}; 
 
	/** 
	 * Returns a "glossy" background using the given color and the given bounds. Currently, 
	 * the gloss is applied vertically from top to bottom. 
	 * 
	 * @param color the color to be "glossed" 
	 * @param rect the bounds of the area to be glossed 
	 * @return a {@link android.graphics.LinearGradient} to be used for the background of a color preview 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:invalidateSelf
		mDrawable.setColorFilter( color, mode );
	} 
 
	@Override 
	public void invalidateSelf() { 
		mDrawable.invalidateSelf();
	} 
 
	@Override 
	public boolean isStateful() { 
		return mDrawable.isStateful();
	} 
 
	@Override 
	protected void onBoundsChange( Rect bounds ) {
		super.onBoundsChange( bounds );
 
		mWidth = bounds.width();
		mHeight = bounds.height();
		 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:invalidateSelf, setColor
		mColor = Color.HSVToColor(hsv);
		updatePreview(mColor);
	} 
 
	private void updatePreview(int color) {
		mPreviewDrawable.setColor(color);
		mPreviewDrawable.invalidateSelf();
	} 
 
	public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
		update(); 
	} 
 
	public void onStartTrackingTouch(SeekBar seekBar) {
	} 
 
	public void onStopTrackingTouch(SeekBar seekBar) {
	} 
 
	public void onClick(DialogInterface dialog, int which) {
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:invalidateSelf, setColor
		mColor = Color.HSVToColor(hsv);
		updatePreview(mColor);
	} 
	 
	private void updatePreview(int color) {
		mPreviewDrawable.setColor(color);
		mPreviewDrawable.invalidateSelf();
	} 
 
	public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
		update(); 
	} 
 
	public void onStartTrackingTouch(SeekBar seekBar) {
	} 
 
	public void onStopTrackingTouch(SeekBar seekBar) {
	} 
 
	@Override 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:invalidateSelf, getPaint
		path.lineTo((int) (width * 2.0F / 9.0F), (int) height);
		path.lineTo((int) width, (int) height);
		path.lineTo((int) width, 0.0F);
		path.lineTo((int) (width * 2.0F / 9.0F), 0.0F);
		path.close();
		shapeD = new ShapeDrawable(new PathShape(path, width, height));
		shapeD.getPaint().set(initPaint(bgColor, borderColor));
		shapeD.invalidateSelf();
	} 
	 
	public ShapeDrawable getShape()
	{ 
		return this.shapeD;
	} 
	public Paint initPaint(int bgColor,int borderColor)
	{ 
		Paint paint=new Paint(Paint.ANTI_ALIAS_FLAG);
		paint.setStrokeWidth(1);
		paint.setPathEffect(new CornerPathEffect(5.0f));
		paint.setColor(bgColor);
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:invalidateSelf, setColor
			itemName.setText(cname);
		} 
		price = sellingPrice;
		itemSellingPrice.setText("$"+Long.toString(sellingPrice));
		itemPurchasePrice.setText("$"+Long.toString(purchasePrice));
		itemBackground.setColor(0xff000000 + bgColor);
		itemBackground.invalidateSelf();
	} 
	 
	public long getLabelPrice(){ 
		return price;
	} 
	 
	 
	@Override 
	public void onBackPressed() { 
		 
	} 
 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:invalidateSelf, getPaint
		addState(new int[] { android.R.attr.state_enabled, android.R.attr.state_window_focused, android.R.attr.state_selected }, selected);
		addState(new int[] {}, color);
	} 
 
	public void setColor(int color) {
		mColor.getPaint().setColor(color);
		mColor.invalidateSelf();
	} 
 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:invalidateSelf, setColor
		else{ 
			String cname = name.substring(0, 7)+"...";
			itemName.setText(cname);
		} 
		itemPurchasePrice.setText("$"+Long.toString(purchasePrice));
		itemBackground.setColor(0xff000000 + bgColor);
		itemBackground.invalidateSelf();
	} 
 
	@Override 
	public void onBackPressed() { 
		dismiss();
	} 
 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Drawable invalidateSelf Questions & Answers:

invalidateSelf Method Overview
Use the current Drawable.Callback implementation to have this Drawable redrawn.
See Code Examples for other Android Drawable Methods: