public abstract class FormMediaItemAbstractFragment extends FormAbstractFragment
FormAbstractFragment.FormExitListener, FormAbstractFragment.OnObjectSaveListener
Modifier and Type | Method and Description |
---|---|
protected boolean |
canExitForm()
Checks if the user can exit the form (no unsaved changes)
|
protected abstract java.util.List<AbstractInput<MediaItem>> |
getSpecificInputs(View view,
MediaItem initialMediaItem)
Allows to create and manage the subclass specific inputs
|
void |
onActivityCreated(Bundle savedInstanceState)
Restores saved data after a configuration change
|
View |
onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState) |
void |
onPause()
Closes all open inputs before destroying the fragment
|
void |
onSaveInstanceState(Bundle outState)
Saves data before a configuration change
|
protected void |
resetInputUpdatedByUserFlags()
Resets the "wasChangedByUser" flags in all the form inputs
|
protected void |
saveObject()
Saves the model object somewhere.
|
protected void |
setObjectValuesFromInputs()
Retrieves all values from the inputs and sets them in the model object
|
protected java.lang.String |
validateObject()
Checks if the form object is correct.
|
getContentLayout, manageExitFromForm, onMenuItemClick, setOnObjectSaveListener
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
onCreateView
in class FormAbstractFragment
public void onActivityCreated(Bundle savedInstanceState)
public void onSaveInstanceState(Bundle outState)
public void onPause()
protected boolean canExitForm()
canExitForm
in class FormAbstractFragment
protected void resetInputUpdatedByUserFlags()
resetInputUpdatedByUserFlags
in class FormAbstractFragment
protected void setObjectValuesFromInputs()
setObjectValuesFromInputs
in class FormAbstractFragment
protected java.lang.String validateObject()
FormAbstractFragment.setObjectValuesFromInputs()
so that the model object already has all the fields setvalidateObject
in class FormAbstractFragment
protected void saveObject()
FormAbstractFragment.setObjectValuesFromInputs()
(the model object already has all the fields set) and only if FormAbstractFragment.validateObject()
returns nullsaveObject
in class FormAbstractFragment
protected abstract java.util.List<AbstractInput<MediaItem>> getSpecificInputs(View view, MediaItem initialMediaItem)
view
- the fragment inflated viewinitialMediaItem
- the media item initial values (meaningful only if we are editing)