BrightnessUtils

class BrightnessUtils

Functions

getBrightness
Link copied to clipboard
open fun getBrightness(): Int
获取屏幕亮度
getWindowBrightness
Link copied to clipboard
open fun getWindowBrightness(window: Window): Int
获取窗口亮度
isAutoBrightnessEnabled
Link copied to clipboard
open fun isAutoBrightnessEnabled(): Boolean
判断是否开启自动调节亮度
setAutoBrightnessEnabled
Link copied to clipboard
open fun setAutoBrightnessEnabled(enabled: Boolean): Boolean
设置是否开启自动调节亮度需添加权限 {@code }并得到授权
setBrightness
Link copied to clipboard
open fun setBrightness(@IntRange(from = 0, to = 255brightness: Int): Boolean
设置屏幕亮度需添加权限 {@code }并得到授权
setWindowBrightness
Link copied to clipboard
open fun setWindowBrightness(@NonNull() window: Window, @IntRange(from = 0, to = 255brightness: Int)
设置窗口亮度