| java.lang.Object | |
| ↳ | lineageos.style.StyleInterface |
Interface used to customize the System colors. It's capable of setting a global light and dark mode and custom color accents.
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| String | ACCENT_DEFAULT | Default accent name. | |||||||||
| String | CHANGE_STYLE_SETTINGS_PERMISSION | Allows an application to change system style. | |||||||||
| int | STYLE_GLOBAL_AUTO_DAYTIME | Global style: automatic (based on day time) mode | |||||||||
| int | STYLE_GLOBAL_AUTO_WALLPAPER | Global style: automatic (based on wallpaper) mode | |||||||||
| int | STYLE_GLOBAL_DARK | Global style: dark | |||||||||
| int | STYLE_GLOBAL_LIGHT | Global style: light | |||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Get the current accent package.
| |||||||||||
Get the current global style.
| |||||||||||
Get or create an instance of the
StyleInterface
| |||||||||||
Get the best color that suites a bitmap object and the appropriate global style
| |||||||||||
Get a list of trusted accents that are included in the build.
| |||||||||||
Set color accent package.
| |||||||||||
Set global style.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||||
Default accent name. It can also be used to remove any active accent
See also:
Allows an application to change system style. This is a dangerous permission, your app must request it at runtime as any other dangerous permission
Global style: automatic (based on day time) mode
See also:
Global style: automatic (based on wallpaper) mode
See also:
Get the current accent package.
| Returns | |
|---|---|
String |
The current accent package name. Defaults to {#ACCENT_DEFAULT} |
Get the current global style.
| Returns | |
|---|---|
int |
One of STYLE_GLOBAL_AUTO_WALLPAPER,
STYLE_GLOBAL_AUTO_DAYTIME,
STYLE_GLOBAL_LIGHT or
STYLE_GLOBAL_DARK
|
Get or create an instance of the StyleInterface
| Parameters | |
|---|---|
context |
Context: Used to get the service |
| Returns | |
|---|---|
StyleInterface |
StyleInterface
|
Get the best color that suites a bitmap object and the appropriate global style
| Parameters | |
|---|---|
source |
Bitmap: The object you want the suggested color to be matched with |
colors |
int: A list of colors that the selection will be made from |
| Returns | |
|---|---|
Suggestion |
A Suggestion which holds the best style + accent combination
|
Get a list of trusted accents that are included in the build. The first element (if any) is the default accent.
| Returns | |
|---|---|
List<String> |
A list of accents package names that can be used with {#setAccent}. |
See also:
Set color accent package.
You will need CHANGE_STYLE_SETTINGS_PERMISSION
to utilize this functionality.
| Parameters | |
|---|---|
pkgName |
String: The package name of the accent |
| Returns | |
|---|---|
boolean |
Whether the process failed |
Set global style.
You will need CHANGE_STYLE_SETTINGS_PERMISSION
to utilize this functionality.
| Parameters | |
|---|---|
style |
int: The style mode to set the device to.
One of STYLE_GLOBAL_AUTO_WALLPAPER,
STYLE_GLOBAL_AUTO_DAYTIME,
STYLE_GLOBAL_LIGHT or
STYLE_GLOBAL_DARK |
pkgName |
String: The package name of the calling application |
| Returns | |
|---|---|
boolean |
Whether the process failed |