ValueType - The type of the values, which can be validatedpublic abstract class AbstractValidateableDialogPreference<ValueType> extends AbstractDialogPreference
AbstractDialogPreference.SavedState| Constructor and Description |
|---|
AbstractValidateableDialogPreference(android.content.Context context)
Creates a new dialog preference, which can be validated.
|
AbstractValidateableDialogPreference(android.content.Context context,
android.util.AttributeSet attributeSet)
Creates a new dialog preference, which can be validated.
|
AbstractValidateableDialogPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
Creates a new dialog preference, which can be validated.
|
AbstractValidateableDialogPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle,
int defaultStyleResource)
Creates a new dialog preference, which can be validated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAllValidators(<any>... validators) |
void |
addAllValidators(java.util.Collection<<any>> validators) |
void |
addValidationListener(<any> listener) |
void |
addValidator(<any> validator) |
int |
getErrorColor()
Returns the color, which is used to indicate validation errors.
|
java.lang.CharSequence |
getHelperText()
Returns the helper text of the view, which is contained by the preference's dialog.
|
int |
getHelperTextColor()
Returns the color of the helper text of the view, which is contained by the preference's
dialog.
|
protected java.util.Set<<any>> |
getValidationListeners()
Returns the listeners, which are notified when the view, which is contained by the
preference's dialog, has been validated.
|
java.util.Collection<<any>> |
getValidators() |
boolean |
isValidatedOnFocusLost() |
boolean |
isValidatedOnValueChange() |
protected void |
onPrepareDialog(MaterialDialog.Builder dialogBuilder)
The method, which is invoked on subclasses when the preference's dialog is about to be
created.
|
protected abstract void |
onPrepareValidateableDialog(MaterialDialog.Builder dialogBuilder)
The method, which is invoked on subclasses when the preference's dialog is about to be
created.
|
void |
removeAllValidators() |
void |
removeAllValidators(<any>... validators) |
void |
removeAllValidators(java.util.Collection<<any>> validators) |
void |
removeValidationListener(<any> listener) |
void |
removeValidator(<any> validator) |
void |
setErrorColor(int color)
Sets the color, which should be used to indicate validation errors.
|
void |
setHelperText(java.lang.CharSequence helperText)
Sets the helper text of the view, which is contained by the preference's dialog.
|
void |
setHelperText(int resourceId)
Sets the helper text of the view, which is contained by the preference's dialog.
|
void |
setHelperTextColor(int color)
Sets the color of the helper text of the view, which is contained by the preference's
dialog.
|
boolean |
validate(ValidateableDialog dialog) |
void |
validateOnFocusLost(boolean validateOnFocusLost) |
void |
validateOnValueChange(boolean validateOnValueChange) |
getDialog, getDialogBackground, getDialogButtonBarDividerColor, getDialogButtonTextColor, getDialogContentDividerColor, getDialogHeaderBackground, getDialogHeaderIcon, getDialogIcon, getDialogMessage, getDialogMessageColor, getDialogTitle, getDialogTitleColor, getNegativeButtonText, getPositiveButtonText, isDialogButtonBarDividerShown, isDialogContentDividerShown, isDialogHeaderShown, isDialogShown, isValueShownAsSummary, needInputMethod, onClick, onClick, onDialogClosed, onDismiss, onRestoreInstanceState, onSaveInstanceState, setDialogBackground, setDialogBackground, setDialogBackgroundColor, setDialogButtonBarDividerColor, setDialogButtonTextColor, setDialogContentDividerColor, setDialogHeaderBackground, setDialogHeaderBackground, setDialogHeaderBackgroundColor, setDialogHeaderIcon, setDialogHeaderIcon, setDialogIcon, setDialogIcon, setDialogMessage, setDialogMessage, setDialogMessageColor, setDialogTitle, setDialogTitle, setDialogTitleColor, setNegativeButtonText, setNegativeButtonText, setPositiveButtonText, setPositiveButtonText, showDialogButtonBarDivider, showDialogContentDivider, showDialogHeader, showValueAsSummarycallChangeListener, compareTo, findPreferenceInHierarchy, getContext, getDependency, getEditor, getExtras, getFragment, getIcon, getIntent, getKey, getLayoutResource, getOnPreferenceChangeListener, getOnPreferenceClickListener, getOrder, getPersistedBoolean, getPersistedFloat, getPersistedInt, getPersistedLong, getPersistedString, getPreferenceManager, getSharedPreferences, getShouldDisableView, getSummary, getTitle, getTitleRes, getView, getWidgetLayoutResource, hasKey, isEnabled, isPersistent, isSelectable, notifyChanged, notifyDependencyChange, notifyHierarchyChanged, onAttachedToActivity, onAttachedToHierarchy, onBindView, onCreateView, onDependencyChanged, onGetDefaultValue, onParentChanged, onPrepareForRemoval, onSetInitialValue, peekExtras, persistBoolean, persistFloat, persistInt, persistLong, persistString, restoreHierarchyState, saveHierarchyState, setDefaultValue, setDependency, setEnabled, setFragment, setIcon, setIcon, setIntent, setKey, setLayoutResource, setOnPreferenceChangeListener, setOnPreferenceClickListener, setOrder, setPersistent, setSelectable, setShouldDisableView, setSummary, setSummary, setTitle, setTitle, setWidgetLayoutResource, shouldCommit, shouldDisableDependents, shouldPersist, toStringpublic AbstractValidateableDialogPreference(android.content.Context context)
context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullpublic AbstractValidateableDialogPreference(android.content.Context context,
android.util.AttributeSet attributeSet)
context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullattributeSet - The attributes of the XML tag that is inflating the preference, as an instance of the
type AttributeSet or null, if no attributes are availablepublic AbstractValidateableDialogPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullattributeSet - The attributes of the XML tag that is inflating the preference, as an instance of the
type AttributeSet or null, if no attributes are availabledefaultStyle - The default style to apply to this preference. If 0, no style will be applied (beyond
what is included in the theme). This may either be an attribute resource, whose value
will be retrieved from the current theme, or an explicit style resourcepublic AbstractValidateableDialogPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle,
int defaultStyleResource)
context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullattributeSet - The attributes of the XML tag that is inflating the preference, as an instance of the
type AttributeSet or null, if no attributes are availabledefaultStyle - The default style to apply to this preference. If 0, no style will be applied (beyond
what is included in the theme). This may either be an attribute resource, whose value
will be retrieved from the current theme, or an explicit style resourcedefaultStyleResource - A resource identifier of a style resource that supplies default values for the
preference, used only if the default style is 0 or can not be found in the theme. Can
be 0 to not look for defaultsprotected abstract void onPrepareValidateableDialog(MaterialDialog.Builder dialogBuilder)
dialogBuilder - The builder, which is used to create the preference's dialog, as an instance of the
class MaterialDialog.Builderprotected final java.util.Set<<any>> getValidationListeners()
Set or an empty set, if no validators are usedpublic final java.lang.CharSequence getHelperText()
CharSequence or null, if no helper text is shownpublic final void setHelperText(java.lang.CharSequence helperText)
helperText - The helper text, which should be set, as an instance of the type CharSequence
or null, if no helper text should be shownpublic final void setHelperText(int resourceId)
resourceId - The resource ID of the string resource, which contains the helper text, which should
be set, as an Integer value. The resource ID must correspond to a valid
string resourcepublic final int getErrorColor()
Integer valuepublic final void setErrorColor(int color)
color - The color, which should be set, as an Integer valuepublic final int getHelperTextColor()
Integer valuepublic final void setHelperTextColor(int color)
color - The color, which should be set, as an Integer valuepublic final boolean validate(ValidateableDialog dialog)
public final java.util.Collection<<any>> getValidators()
public final void addValidator(<any> validator)
public final void addAllValidators(java.util.Collection<<any>> validators)
@SafeVarargs public final void addAllValidators(<any>... validators)
public final void removeValidator(<any> validator)
public final void removeAllValidators(java.util.Collection<<any>> validators)
@SafeVarargs public final void removeAllValidators(<any>... validators)
public final void removeAllValidators()
public final boolean isValidatedOnValueChange()
public final void validateOnValueChange(boolean validateOnValueChange)
public final boolean isValidatedOnFocusLost()
public final void validateOnFocusLost(boolean validateOnFocusLost)
public final void addValidationListener(<any> listener)
public final void removeValidationListener(<any> listener)
protected final void onPrepareDialog(MaterialDialog.Builder dialogBuilder)
AbstractDialogPreferenceonPrepareDialog in class AbstractDialogPreferencedialogBuilder - The builder, which is used to create the preference's dialog, as an instance of the
class MaterialDialog.Builder