public class PanEditTextPreference
extends android.preference.EditTextPreference
Preference
that allows for string input geared towards Plugin Developers.
It is a subclass of DialogPreference
and shows the EditText
in a dialog. This EditText
can be modified either programmatically
via EditTextPreference.getEditText()
, or through XML by setting any EditText
attributes on the EditTextPreference.
This preference will store a string into the SharedPreferences. This has been modified to allow for a pluginIcon attribute which will allow for icons to be used in the entity.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TAG |
Constructor and Description |
---|
PanEditTextPreference(android.content.Context context) |
PanEditTextPreference(android.content.Context context,
android.util.AttributeSet attrs) |
PanEditTextPreference(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr) |
PanEditTextPreference(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr,
int defStyleRes) |
Modifier and Type | Method and Description |
---|---|
void |
checkValidDouble()
Before the preference value is saved, check to see if the
value is a valid double.
|
void |
checkValidInteger()
Before the preference value is saved, check to see if the
value is a valid integer.
|
void |
checkValidLong()
Before the preference value is saved, check to see if the
value is a valid long.
|
void |
checkValidWidth()
Before the preference value is saved, check to see if the
value is a valid width.
|
static void |
setContext(android.content.Context c)
For plugins we are REQUIRED to set the application context to the
ATAK owned Activity and not the context owned by the plugin.
|
void |
setFilters(android.text.InputFilter[] filters,
boolean emojiSupport)
Convienence method to automatically install the EmojiExclusion filter along with any other filters
that are provided.
|
void |
setValidIntegerRange(int minVal,
int maxVal)
Before the preference value is saved, check to see if the
value is valid integer and that it falls within a given range.
|
void |
setValidIntegerRange(int minVal,
int maxVal,
boolean allowEmpty)
Before the preference value is saved, check to see if the
value is valid integer and that it falls within a given range.
|
protected void |
showDialog(android.os.Bundle bundle)
Android is plain goofy when it comes to EditTextPreference.
|
getEditText, getText, onAddEditTextToDialogView, onBindDialogView, onDialogClosed, onGetDefaultValue, onRestoreInstanceState, onSaveInstanceState, onSetInitialValue, setText, shouldDisableDependents
getDialog, getDialogIcon, getDialogLayoutResource, getDialogMessage, getDialogTitle, getNegativeButtonText, getPositiveButtonText, onActivityDestroy, onClick, onClick, onCreateDialogView, onDismiss, onPrepareDialogBuilder, setDialogIcon, setDialogIcon, setDialogLayoutResource, setDialogMessage, setDialogMessage, setDialogTitle, setDialogTitle, setNegativeButtonText, setNegativeButtonText, setPositiveButtonText, setPositiveButtonText
callChangeListener, compareTo, findPreferenceInHierarchy, getContext, getDependency, getEditor, getExtras, getFragment, getIcon, getIntent, getKey, getLayoutResource, getOnPreferenceChangeListener, getOnPreferenceClickListener, getOrder, getParent, getPersistedBoolean, getPersistedFloat, getPersistedInt, getPersistedLong, getPersistedString, getPersistedStringSet, getPreferenceDataStore, getPreferenceManager, getSharedPreferences, getShouldDisableView, getSummary, getTitle, getTitleRes, getView, getWidgetLayoutResource, hasKey, isEnabled, isIconSpaceReserved, isPersistent, isRecycleEnabled, isSelectable, isSingleLineTitle, notifyChanged, notifyDependencyChange, notifyHierarchyChanged, onAttachedToActivity, onAttachedToHierarchy, onBindView, onCreateView, onDependencyChanged, onParentChanged, onPrepareForRemoval, peekExtras, persistBoolean, persistFloat, persistInt, persistLong, persistString, persistStringSet, restoreHierarchyState, saveHierarchyState, setDefaultValue, setDependency, setEnabled, setFragment, setIcon, setIcon, setIconSpaceReserved, setIntent, setKey, setLayoutResource, setOnPreferenceChangeListener, setOnPreferenceClickListener, setOrder, setPersistent, setPreferenceDataStore, setRecycleEnabled, setSelectable, setShouldDisableView, setSingleLineTitle, setSummary, setSummary, setTitle, setTitle, setWidgetLayoutResource, shouldCommit, shouldPersist, toString
public static final java.lang.String TAG
public PanEditTextPreference(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr, int defStyleRes)
public PanEditTextPreference(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr)
public PanEditTextPreference(android.content.Context context, android.util.AttributeSet attrs)
public PanEditTextPreference(android.content.Context context)
public static void setContext(android.content.Context c)
public void setFilters(android.text.InputFilter[] filters, boolean emojiSupport)
filters
- a list of filters to be applied.emojiSupport
- false if the instance does not support emoji's.protected void showDialog(android.os.Bundle bundle)
showDialog
in class android.preference.DialogPreference
public void checkValidWidth()
public void checkValidInteger()
public void checkValidDouble()
public void checkValidLong()
public void setValidIntegerRange(int minVal, int maxVal)
minVal
- the minimum value supported by the preferencemaxVal
- the maximumn value supported by rhe preferencepublic void setValidIntegerRange(int minVal, int maxVal, boolean allowEmpty)
minVal
- the minimum value supported by the preferencemaxVal
- the maximumn value supported by rhe preferenceallowForBlank
- allow for empty entry for the preference