问题
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