/**
* @param picId 点击状态之前的图片ID
* @param colorId 点击状态之后颜色ID
*/
public void setSelector(@NonNull View view, @DrawableRes int picId, @ColorRes int colorId) {
BitmapDrawable normalDraw = new BitmapDrawable(getResources(), BitmapFactory.decodeResource(getResources(), picId));
Drawable pressedDraw = DrawableCompat.wrap(normalDraw);
DrawableCompat.setTintList(pressedDraw, getResources().getColorStateList(colorId));
StateListDrawable stateListDrawable = new StateListDrawable();
stateListDrawable.addState(new int[]{android.R.attr.state_pressed}, pressedDraw);
BitmapDrawable bitmapDrawable = new BitmapDrawable(getResources(), BitmapFactory.decodeResource(getResources(), picId));
stateListDrawable.addState(new int[]{}, bitmapDrawable);
view.setBackgroundDrawable(stateListDrawable);
}