Android system brightness adjustmentAndroid system brightness adjustment is the most global, and is commonly found in the brightness setting item in the system settings. Android provides an interface for getting and setting the system brightness value ("brightness value in manual mode"), calling the corresponding API to get the current screen brightness value and set a specific value. The returned brightness value is an integer value between 0-255. In Android 2.X and later systems, the "Auto Brightness" option is added to the system brightness adjustment. "Auto Brightness" automatically changes the system brightness based on the external light source. Currently, most mobile phones can also adjust the value of "Auto Brightness" slightly. The corresponding to Auto Brightness is "Manual Brightness". When in "Manual Brightness", setting and dragging the brightness progress bar will greatly change the Android system brightness. "Manual Brightness" and "Auto Brightness" are respectively called the "Brightness Mode" of the Android system. Android does not provide a brightness value interface in "automatic brightness" mode. The above system brightness value acquisition interface actually refers to the brightness value in "manual brightness" mode. Through the manual brightness value and the system brightness mode setting interface, most of the conventional Android system brightness setting coding requirements can be met to complete the system brightness adjustment. Android current Window brightness adjustmentCommon scenario: The screen brightness becomes brighter when opening the payment interface By default, when we modify the system brightness value directly, the brightness effect can be immediately reflected in the current Window. This is because by default, the default value of screenBrightness of WindowManager.LayoutParams is WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE. This means that the Window does not have its own brightness parameters and will follow the changes in the system brightness effect. When the system brightness is adjusted, all Windows will immediately reflect the system brightness setting effect. Android APP brightness adjustmentAndroid does not directly provide a brightness adjustment method for the APP level. If you need to adjust the brightness of the APP, you can do it indirectly through the system brightness adjustment or the current screen brightness adjustment method.
|
<<: Let’s talk about how to cleverly deal with iOS keyboard problems?
If the number of Baidu Aicaigou members increases...
Author: Sun Zhenghai Qiqihar Medical College Scho...
Recently, we learned from sources close to the Nat...
On August 13, Shenzhen MTC announced that it plan...
Tencent Zhihuitui has a large number of platform ...
Many people have performed SEO optimization for t...
It's Thursday. I haven't written an artic...
Hello everyone, this is the 18th issue of the Env...
Some Huabei users have access to the central bank...
When I woke up on the weekend, a class invitation...
Bubbling, smoking, changing color...with just a b...
In recent years, the number of annual launches of...
I believe many people have experienced using mobi...
Wasn’t there the Luo Zhixiang’s multi-person Qigo...
Nowadays, many popular film and television IPs ha...