Code example for LightingColorFilter

0
   * The stateful LayerDrawable used by this button. 
   */ 
  protected class SAutoBgButtonBackgroundDrawable extends LayerDrawable {
 
    // The color filter to apply when the button is pressed 
    protected ColorFilter _pressedFilter = new LightingColorFilter(Color.LTGRAY, 1);
    // Alpha value when the button is disabled 
    protected int _disabledAlpha = 100;
    // Alpha value when the button is enabled 
    protected int _fullAlpha = 255;
 
    public SAutoBgButtonBackgroundDrawable(Drawable d) {
      super(new Drawable[] { d });
    } 
 
    @Override 
    protected boolean onStateChange(int[] states) {
      boolean enabled = false;
      boolean pressed = false;
 
      for (int state : states) {