[FREE] BrightnessTools - Set brightness of your phone

Introduction

Hi there! Today I am going to publish my third extension - BrightnessTools
A simple extension to set your brightness! :iphone: :bulb:

Blocks

WhenErrorOccurred

WhenChanged

MaxBrightness

blocks

component_set_get (2)

component_set_get (3)

component_set_get

component_set_get (1)

Documentation



Blocks Description
WhenErrorOccurred
Raises when error occurred

Params Type Description
error String Return a description of error

WhenChanged
Triggered when detected any brightness or adaptive change. The param "changed" indicate what has change.

Params Type Description
changed Number (int) Return what has been changed.
0 = Brightness Change,
1 = Adaptive Change
brightness Number (int) Return current brightness
adaptive boolean) Return current adaptive state

MaxBrightness 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 the maximum of 4000.
blocks
Register the listener of Changed

GetBrightness
SetBrightness

Set the brightness of user's phone. Minimum value is 0.

Params Type Description
Brightness Number (int) Set/Return the brightness depends on the given integer

GetBrightness
SetBrightness

Set brightness to adaptive or non-adaptive. Adaptive if true, otherwise non-adaptive.

Params Type Description
Adaptive Boolean Set/Return adaptive or non-adaptive

You need to grant WRITE_SETTINGS permission.
For more please see this post

Download

v1.1

com.watermelonice.BrightnessTools.aix (14.0 KB)

v1.0

com.watermelonice.BrightnessTools.aix (10.7 KB)

Change Log

v1.1
  • Big update! Added Listener for brightness and adaptive change
  • Optimized the code

If you have liken it please give me a thumbs up!

This extension will only be distributed in Kodular and AI2 community. Reuploading my work is not allowed.

23 Likes

Congrats @WatermelonIce. :+1:t2:

1 Like

Great extension :partying_face:

1 Like

Thanks guys!

1 Like

I just want to ask a question.Should we ask the permission manually or the extension will ask it automatically?

The extension won’t ask it. I didn’t include it because it might cause this problem

Therefore, use this to check if the permission granted:
image

And use this to open that settings:
image
(for only android 6+)

1 Like

Nice Extension, your extensions are nice :upside_down_face:

1 Like

Very Nice Extension !! Best !! Very Helpful !! :blush:

Great Extension

Nice extension. @WatermelonIce, I am following you works. Those are superb. Keep koding. All the best.

2 Likes

Thanks fot supporting :blush:

Great work as usual.

1 Like

Really? I don’t think I make great extension as usual :sweat_smile:

Anyway thanks :stuck_out_tongue_winking_eye:

Your extensions are useful so that makes them great.

2 Likes

Awesome work congratulations for being an extension developer :heart:

1 Like

Useful extension.
Keep it up.
I am older than these guys.
I don’t know extension development. :sweat_smile:

2 Likes

🙋🙋 Same here :grin:

3 Likes

Thanks guys!

Age doesn’t matter.

3 Likes

New big update! You can now register listener for brightness change!

2 Likes

WatermelonIce, thank you for your nice extension, but i cant grant write permisions, i dont know wy. Please help me. Have you an .AIA example?

Thank you, Jemax

1 Like