Introduction
Hi there! Today I am going to publish my third extension - BrightnessTools
A simple extension to set your brightness!
Documentation
Blocks | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Raises when error occurred
|
|||||||||||||
Triggered when detected any brightness or adaptive change. The param "changed" indicate what has change.
|
|||||||||||||
Returns: Boolean Check if modify system setting permission is granted. |
|||||||||||||
Returns: Number (int) Get Max brightness of user's phone. If max brightness not found, return 255. Note: Android states that the maximum value should be 255. However, different brands of phones have different settings, like some Xiaomi phones have a maximum of 4000. |
|||||||||||||
Register the listener for Changed | |||||||||||||
Show screen for controlling which apps are allowed to write/modify system settings. | |||||||||||||
|
Set the brightness of user's phone. Minimum value is 0.
|
||||||||||||
|
Set brightness to adaptive or non-adaptive. Adaptive if true, otherwise non-adaptive.
|
Download
v1.2
com.watermelonice.BrightnessTools.aix (16.3 KB)
v1.1
com.watermelonice.BrightnessTools.aix (14.0 KB)
v1.0
com.watermelonice.BrightnessTools.aix (10.7 KB)
Test AIA
TestBrightnessExt.aia (27.4 KB)
Change Log
v1.2
- As the modify settings permission might be greyed out sometimes, now it would enable that back.
- You don’t need
ActivityStarter
to grant the permission anymore. Instead, you can use theOpenWriteSettingsScreen
method.
v1.1
- Big update! Added Listener for brightness and adaptive change
- Optimized the code
Note
This extension will only be distributed in Kodular and AI2 communities. Reuploading my work is not allowed.
You need to grant WRITE_SETTINGS permission. For more please see this post. You can use either the method from Screen or use the
OpenWriteSettingsScreen
directly from my extension. Please note that only the Android version starting from 6.0 needs this permission. At the lower versions, it should be granted when the app is installed.
The intention of this extension is to change the brightness of the phone, not just the app. If you want to change the brightness of that app without permission, please refer to Requesting extension for app brightness without requiring permissions - #9 by Mohamed_Tamer