public final class

BrightnessSettings

extends Object
implements Parcelable
java.lang.Object
   ↳ lineageos.profiles.BrightnessSettings

Class Overview

The BrightnessSettings class allows for overriding and setting the brightness level of the display. The range for brightness is between 0 -> 255.

Example for setting the brightness to ~25% (255 * .25):

 BrightnessSettings twentyFivePercent = new BrightnessSettings(63, true)
 profile.setBrightness(twentyFivePercent);
 

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Public Constructors
BrightnessSettings(Parcel parcel)
Unwrap BrightnessSettings from a parcel.
BrightnessSettings()
Construct a BrightnessSettings with a default value of 0.
BrightnessSettings(int value, boolean override)
Construct a BrightnessSettings with a default value and whether or not it should override user settings.
Public Methods
int describeContents()
int getValue()
Get the default value for the BrightnessSettings
boolean isOverride()
Check whether or not the BrightnessSettings overrides user settings.
void setOverride(boolean override)
Set whether or not the BrightnessSettings should override default user values
void setValue(int value)
Set the default value for the BrightnessSettings
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Public Constructors

public BrightnessSettings (Parcel parcel)

added in API level 2

Unwrap BrightnessSettings from a parcel.

public BrightnessSettings ()

added in API level 2

Construct a BrightnessSettings with a default value of 0.

public BrightnessSettings (int value, boolean override)

added in API level 2

Construct a BrightnessSettings with a default value and whether or not it should override user settings.

Parameters
value int: ex: 255 (MAX)
override boolean: whether or not the setting should override user settings

Public Methods

public int describeContents ()

added in API level 2

Returns
int

public int getValue ()

added in API level 2

Get the default value for the BrightnessSettings

Returns
int integer value corresponding with its brightness value

public boolean isOverride ()

added in API level 2

Check whether or not the BrightnessSettings overrides user settings.

Returns
boolean true if override

public void setOverride (boolean override)

added in API level 2

Set whether or not the BrightnessSettings should override default user values

Parameters
override boolean: boolean override

public void setValue (int value)

added in API level 2

Set the default value for the BrightnessSettings

Parameters
value int: ex: 255 (MAX)