화면 밝기 변경(change screen brightness)
각 value의 값을 변경하여 화면의 밝기를 변경할 수 있습니다.
value = 0 (최소)
value = 255 (최대)
value = -1 (시스템 설정값)
private void changeScreenBrightness(int value) {
Window window = getWindow();
WindowManager.LayoutParams layoutParams = window.getAttributes();
layoutParams.screenBrightness = value * 1.0f / 255;
window.setAttributes(layoutParams);
}
asukim1022/ChangeScreenBrightnessApp
Contribute to asukim1022/ChangeScreenBrightnessApp development by creating an account on GitHub.
github.com
728x90
반응형
'AOS' 카테고리의 다른 글
onMeasure/onLayout (0) | 2020.03.23 |
---|---|
Write access is allowed from event dispatch thread only (0) | 2020.03.15 |
changing Floating Action Button color (0) | 2020.02.26 |
Bitmap -> String 변환, String -> Bitmap 변환 (0) | 2020.02.23 |
SharedPreferences로 ArrayList 저장 (0) | 2020.02.19 |