1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

実践

  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を使うことで、画面の明るさをデフォルトの明るさにする、もしくは、明るさを変えないようにできる。

参考

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?