java.lang.Object | |
↳ | net.pierrox.lightning_launcher.prefs.LLPreference |
Known Direct Subclasses |
The base class for all other preferences. It offers a set of common features shared with other specialized preferences.
Although this preference only displays a title and a summary, it can nevertheless be used to manage complex settings by using the onLLPreferenceClicked(LLPreference)
event to catch clicks. This preference holds an arbitrary value (an object).
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
LLPreference(int id, String title, String summary, Object value, Object defaultValue)
Create a new preference.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int |
getId()
Return the unique identifier.
| ||||||||||
String |
getSummary()
Return the summary, if any.
| ||||||||||
String |
getTitle()
Return the title.
| ||||||||||
boolean |
isDisabled()
Return true if the preference is currently disabled.
| ||||||||||
boolean |
isOverriding()
Return true if the value is different from the default value
| ||||||||||
boolean |
isShowingOverride()
Return true if this preference is showing the override checkbox.
| ||||||||||
boolean |
isVisible()
Return true is the preference is currently visible.
| ||||||||||
void |
reset()
Set the value of this preference with the default value.
| ||||||||||
void |
setDisabled(boolean disabled)
Disable or enable the preference (it will be grayed out and not clickable when disabled)
| ||||||||||
void |
setSummary(String summary)
Set a new summary.
| ||||||||||
void |
setTitle(String title)
Set a new title.
| ||||||||||
void |
setValue(Object value, Object defaultValue)
Set the value and optionally a default value.
| ||||||||||
void |
setVisible(boolean visible)
Show or hide this preference.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create a new preference.
id | a unique number to identify the preference, use 0 if unused. |
---|---|
title | Displayed title. |
summary | Displayed summary, use null for none. |
value | Value for the preference. |
defaultValue | Default value if displaying the override checkbox. Use null if unused. |
Return the unique identifier.
Return the summary, if any.
Return the title.
Return true if the preference is currently disabled.
Return true if the value is different from the default value
Return true if this preference is showing the override checkbox.
Return true is the preference is currently visible.
Set the value of this preference with the default value.
Disable or enable the preference (it will be grayed out and not clickable when disabled)
Set a new summary.
Set a new title.
Set the value and optionally a default value.
value | the value stored by this preference |
---|---|
defaultValue | use null if unused |
Show or hide this preference.