hah. pero bakit yung apps mo pwedi black and white ang theme ng webview
private static final float[] mNegativeColorArray = {
-1.0f, 0, 0, 0, 255, // red
0, -1.0f, 0, 0, 255, // green
0, 0, -1.0f, 0, 255, // blue
0, 0, 0, 1.0f, 0 // alpha
};
private Paint mPaint = new Paint();
sa oncreate
case 1:
mPaint.setColorFilter(null);
mwebView.setLayerType(WebView.LAYER_TYPE_HARDWARE, null);
Toast.makeText(this, "Normal ", Toast.LENGTH_SHORT).show();
break;
case 2:
ColorMatrix cm = new ColorMatrix();
cm.setSaturation(0);
ColorMatrixColorFilter filterGray = new ColorMatrixColorFilter(cm);
mPaint.setColorFilter(filterGray);
mwebView.setLayerType(WebView.LAYER_TYPE_HARDWARE, mPaint);
Toast.makeText(this, "Grey", Toast.LENGTH_SHORT).show();
break;
case 3:
ColorMatrixColorFilter filterInvert = new ColorMatrixColorFilter(
mNegativeColorArray);
mPaint.setColorFilter(filterInvert);
mwebView.setLayerType(WebView.LAYER_TYPE_HARDWARE, mPaint);
Toast.makeText(this, "Inverted", Toast.LENGTH_SHORT).show();
break;
case 4:
ColorMatrix matrix = new ColorMatrix();
matrix.set(mNegativeColorArray);
ColorMatrix matrixGray = new ColorMatrix();
matrixGray.setSaturation(0);
ColorMatrix concat = new ColorMatrix();
concat.setConcat(matrix, matrixGray);
ColorMatrixColorFilter filterInvertGray = new ColorMatrixColorFilter(concat);
mPaint.setColorFilter(filterInvertGray);
mwebView.setLayerType(WebView.LAYER_TYPE_HARDWARE, mPaint);