StateListDrawable
それらに含まれるドローアブルに適用されたカラーフィルターを無視するようです。例えば:
StateListDrawable sld = new StateListDrawable();
Drawable pressedState = Context.getResources().getDrawable(R.drawable.solid_green);
pressedState.setColorFilter(Color.RED, PorterDuff.Mode.SRC);
sld.addState(new int[] {android.R.attr.state_pressed}, pressedState);
// Other states...
ビューの背景に適用sld
すると、ビューの背景が押されたときに真っ赤になることが予想されます。pressedState
代わりに、フィルタが適用されていない場合の色である緑色に変わります。