public abstract class FormAbstractFragment
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
FormAbstractFragment.FormExitListener
Listener for exiting from the form
|
static interface |
FormAbstractFragment.OnObjectSaveListener
Listener that receives an event each time a media item is saved in the form
|
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
canExitForm()
Checks if the user can exit the form (no unsaved changes)
|
protected abstract int |
getContentLayout()
Returns the form content layout
|
void |
manageExitFromForm(FormAbstractFragment.FormExitListener formExitListener)
Called whenever the user tries to exit from a form (e.g.
|
View |
onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState) |
boolean |
onMenuItemClick(MenuItem item) |
protected abstract void |
resetInputUpdatedByUserFlags()
Resets the "wasChangedByUser" flags in all the form inputs
|
protected abstract void |
saveObject()
Saves the model object somewhere.
|
protected abstract void |
setObjectValuesFromInputs()
Retrieves all values from the inputs and sets them in the model object
|
void |
setOnObjectSaveListener(FormAbstractFragment.OnObjectSaveListener onObjectSaveListener)
Setter
|
protected abstract java.lang.String |
validateObject()
Checks if the form object is correct.
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
public boolean onMenuItemClick(MenuItem item)
public void manageExitFromForm(FormAbstractFragment.FormExitListener formExitListener)
formExitListener
- the listener receiving the exit resultprotected abstract boolean canExitForm()
protected abstract void resetInputUpdatedByUserFlags()
protected abstract int getContentLayout()
protected abstract void setObjectValuesFromInputs()
protected abstract java.lang.String validateObject()
setObjectValuesFromInputs()
so that the model object already has all the fields setprotected abstract void saveObject()
setObjectValuesFromInputs()
(the model object already has all the fields set) and only if validateObject()
returns nullpublic void setOnObjectSaveListener(FormAbstractFragment.OnObjectSaveListener onObjectSaveListener)
onObjectSaveListener
- the listener that receives the save events