如何使屏幕在所有应用程序中仅显示android中的白色和黑色 [英] how to make screen only display white and black color in android for all app

查看:91
本文介绍了如何使屏幕在所有应用程序中仅显示android中的白色和黑色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使应用看起来像超省电模式(galaxy s5)。它更改屏幕仅显示黑白颜色。我不知道该怎么做
有人可以提供一些建议或信息吗?
非常感谢。

I want to make app look like Ultra Power Saving Mode (galaxy s5). it change screen only display black and white color. I don't know how to make it. Can anyone give some advice or information about how to do this? Thanks a lot.

推荐答案

// Create a paint object with 0 saturation (black and white)
ColorMatrix cm = new ColorMatrix();
cm.setSaturation(0);
Paint greyscalePaint = new Paint();
greyscalePaint.setColorFilter(new ColorMatrixColorFilter(cm));
// Create a hardware layer with the greyscale paint
v.setLayerType(LAYER_TYPE_HARDWARE, greyscalePaint);

使用这些代码作为根布局。

use these code to the root layout.

这篇关于如何使屏幕在所有应用程序中仅显示android中的白色和黑色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆