List of usage examples for android.graphics.drawable GradientDrawable invalidateSelf
public void invalidateSelf()
From source file:com.forrestguice.suntimeswidget.LightMapDialog.java
private void colorizeImageView(ImageView view, int color) { if (view.getBackground() != null) { GradientDrawable d = (GradientDrawable) view.getBackground().mutate(); d.setColor(color);//from w w w. java2 s. c om d.invalidateSelf(); } }
From source file:com.forrestguice.suntimeswidget.settings.ColorChooser.java
private void updateViews() { if (edit != null) { edit.setText(String.format("#%08X", color)); edit.setVisibility((isCollapsed ? View.GONE : View.VISIBLE)); }/*from w w w .j a va 2 s . c o m*/ if (button != null) { Drawable d = button.getDrawable(); if (d != null) { GradientDrawable g = (GradientDrawable) d.mutate(); g.setColor(color); g.invalidateSelf(); } } }