change color brightness in android

不问归期 提交于 2019-12-11 13:53:23

问题


I want to change brightness in color

I implemented this...

Settings.System.putInt(context.getContentResolver(),android.provider.Settings.System.SCREEN_BRIGHTNESS, 200);

this will change my device's brightness in black&white mode.

like above images, I can change brightness but how can I give color? Is there any other parameter which I don't know?


回答1:


This can be accomplished using windows of type TYPE_SYSTEM_ALERT. The idea is that even services can have a Window; so you can use a service, which makes a view and call WindowManager#addView() with a view and layout params. In your case, the view will just have a background color with an alpha value. You can experiment with different layout params to achieve the required effect.

This is also how facebook chat heads works. Check out this link to know more about the implementation details: http://www.piwai.info/chatheads-basics/ This will give you an idea on how to go about implementing this type of screen overlay.



来源:https://stackoverflow.com/questions/14127264/change-color-brightness-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!