org.solovyev.android.prefs
Class AbstractDialogPreference<T>

java.lang.Object
  extended by android.preference.Preference
      extended by android.preference.DialogPreference
          extended by org.solovyev.android.prefs.AbstractDialogPreference<T>
Type Parameters:
T -
All Implemented Interfaces:
android.content.DialogInterface.OnClickListener, android.content.DialogInterface.OnDismissListener, android.preference.PreferenceManager.OnActivityDestroyListener, Comparable<android.preference.Preference>
Direct Known Subclasses:
AbstractPickerDialogPreference, RangeSeekBarPreference, SeekBarPreference

public abstract class AbstractDialogPreference<T>
extends android.preference.DialogPreference

Base class for creating preferences with dialogs


Nested Class Summary
 
Nested classes/interfaces inherited from class android.preference.Preference
android.preference.Preference.BaseSavedState, android.preference.Preference.OnPreferenceChangeListener, android.preference.Preference.OnPreferenceClickListener
 
Field Summary
protected static String androidns
           
protected static String localNameSpace
           
 
Fields inherited from class android.preference.Preference
DEFAULT_ORDER
 
Constructor Summary
AbstractDialogPreference(android.content.Context context, android.util.AttributeSet attrs, String defaultStringValue, boolean needValueText, org.solovyev.common.text.Mapper<T> mapper)
           
 
Method Summary
protected abstract  android.view.View createPreferenceView(android.content.Context context)
          Creates view which is responsible for changing preference value (for example, Spinner or EditText)
protected abstract  android.widget.LinearLayout.LayoutParams getParams()
           
protected  android.view.View getPreferenceView()
           
 T getValue()
           
 String getValueText()
           
protected abstract  void initPreferenceView(android.view.View v, T value)
           
protected  void onBindDialogView(android.view.View v)
           
protected  android.widget.LinearLayout onCreateDialogView()
           
protected  void onSetInitialValue(boolean restore, Object defaultValue)
           
protected  void persistValue(T value)
           
 void setValue(T value)
           
protected  void updateValueText(String text)
           
 
Methods inherited from class android.preference.DialogPreference
getDialog, getDialogIcon, getDialogLayoutResource, getDialogMessage, getDialogTitle, getNegativeButtonText, getPositiveButtonText, onActivityDestroy, onClick, onClick, onDialogClosed, onDismiss, onPrepareDialogBuilder, onRestoreInstanceState, onSaveInstanceState, setDialogIcon, setDialogIcon, setDialogLayoutResource, setDialogMessage, setDialogMessage, setDialogTitle, setDialogTitle, setNegativeButtonText, setNegativeButtonText, setPositiveButtonText, setPositiveButtonText, showDialog
 
Methods inherited from class android.preference.Preference
callChangeListener, 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, onPrepareForRemoval, 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, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

localNameSpace

@Nonnull
protected static final String localNameSpace
See Also:
Constant Field Values

androidns

@Nonnull
protected static final String androidns
See Also:
Constant Field Values
Constructor Detail

AbstractDialogPreference

public AbstractDialogPreference(android.content.Context context,
                                android.util.AttributeSet attrs,
                                @Nullable
                                String defaultStringValue,
                                boolean needValueText,
                                @Nonnull
                                org.solovyev.common.text.Mapper<T> mapper)
Method Detail

getPreferenceView

@Nullable
protected android.view.View getPreferenceView()

getValue

@Nullable
public T getValue()

setValue

public void setValue(@Nullable
                     T value)

onCreateDialogView

@Nonnull
protected final android.widget.LinearLayout onCreateDialogView()
Overrides:
onCreateDialogView in class android.preference.DialogPreference

getParams

@Nullable
protected abstract android.widget.LinearLayout.LayoutParams getParams()

onSetInitialValue

protected void onSetInitialValue(boolean restore,
                                 Object defaultValue)
Overrides:
onSetInitialValue in class android.preference.Preference

onBindDialogView

protected void onBindDialogView(android.view.View v)
Overrides:
onBindDialogView in class android.preference.DialogPreference

createPreferenceView

@Nonnull
protected abstract android.view.View createPreferenceView(@Nonnull
                                                                  android.content.Context context)
Creates view which is responsible for changing preference value (for example, Spinner or EditText)

Parameters:
context - context
Returns:
view which changes the preference value

initPreferenceView

protected abstract void initPreferenceView(@Nonnull
                                           android.view.View v,
                                           @Nullable
                                           T value)
Parameters:
v - view to be filled with initial data (the one which has been created with createPreferenceView(android.content.Context) method)
value - current preference value

persistValue

protected void persistValue(@Nullable
                            T value)

getValueText

@Nullable
public String getValueText()

updateValueText

protected void updateValueText(@Nonnull
                               String text)


Copyright © 2014 se.solovyev. All Rights Reserved.