티스토리 뷰

반응형

[android/java] android 밝기 조절 하기

 

#Permission

<uses-permission android:name="android.permission.WRITE_SETTINGS"
	tools:ignore="ProtectedPermissions" />

 

#Code

   private void changeScreenBrightness(float value) {
        Window window = getWindow();
        WindowManager.LayoutParams layoutParams = window.getAttributes();
        layoutParams.screenBrightness = value;
        window.setAttributes(layoutParams);
    }

#밝기조절 값 범위 : 0 ~ 1

#시스템 값 적용: -1

 

#android #밝기조절 #java #안드로이드 #screenBrightness

반응형
댓글
반응형