How to make app like night mode

时间:2017-06-15 09:26:16

标签: android eclipse

How can make app which will dim screen light.

I want to make simple application which is do screen brightness very low

Dim screen brightness by programatically

2 个答案:

答案 0 :(得分:1)

  Settings.System
            .putInt(this.getContentResolver(),
                    Settings.System.SCREEN_BRIGHTNESS, newBrightnessValue);

Use This method. Pass int value at "newBrightnessValue". you can also pass 0 or 1 for low & high brightness respectivily

答案 1 :(得分:0)

The screen design is presented based on Application Theme. By default, we specify the application theme in manifest file. It uses the theme in our application

<application
        android:name=".MainApplication"
        android:allowBackup="true"
        android:theme="@style/AppTheme">

You can change Dark theme during run time

setTheme(android.R.style.Theme_Dark);

enter image description here

Also you can define your own theme in styles.xml file