0
0

実践

  val windowAttributes = window.attributes
  windowAttributes.screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_OFF
  window.attributes = windowAttributes

今回例で使用した、
WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_OFFは 最小値で
最大値を設定したい場合はWindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_FULLを使う。
または、数値でも指定可能で 0.0f 〜 1.0fで指定することができる。

WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONEを使うことで、画面の明るさをデフォルトの明るさにする、もしくは、明るさを変えないようにできる。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0