Paint mPaint = new Paint();
ColorMatrix mColorMatrix = new ColorMatrix();
mColorMatrix.setSaturation(0);
mPaint.setColorFilter(new ColorMatrixColorFilter(mColorMatrix));
public class ActivityLifecycle implements Application.ActivityLifecycleCallbacks, Closeable {
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
View decorView = activity.getWindow().getDecorView();
decorView.setLayerType(View.LAYER_TYPE_HARDWARE, mPaint);
}}
网友评论