/**
* @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);
}