-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Sébastien Vitard edited this page Jan 16, 2019
·
6 revisions
- Add the Volley library to the
build.gradlefile of the appfolder - Complete the
resetmethod of theMainActivityclass using theVolleylibrary (see documentation) - Replace the root
FrameLayoutwith aListViewin theactivity_main.xmllayout file - In the meanwhile, create a
row_main.xmllayout file & complete it to fit the example below
- Create a
MainAdapterclass inheriting fromArrayAdapter& override itsgetViewmethod - Finally, complete the
onCreate&reloadmethods of theMainActivityclass
- Create a
menu_main.xmlmenu file & complete it in order to show a+item in theMainActivity. (Note: useic_action_adddrawable) - Override the
onCreateOptionsMenu&onOptionsItemSelectedmethods of theMainActivityto inflate the menu & launch theCreateActivityfor result - Declare the
CreateActivityin theAndroidManifest.xmlfile - Complete the
fragment_detail.xmllayout file to fit the example below
- Instead of typing in an
EditTextthe date, set itseditableattribute tofalse& show aDatePickerDialogwhen clicking on it & when it is focused. Then, set the date ofEditTextwith the selected date - Complete the
onCheckOptionsItemSelectedmethod of theCreateActivityclass - Finally, override the
onActivityResultmethod of theMainActivityclass to add the newly created event & reload the adapter
- Update the
onCreatemethod of theMainActivityclass - Override the
onAttachFragmentmethod of theEditActivityclass - Override the
onCreatemethod of theDetailFragmentclass - Update the
onCreateViewmethod - Update the
onActivityResultmethod of theMainActivityclass
- Create a
values-frfolder in theresfolder, copy it thestrings.xmlfile & translate all values in FR ;) - Create a
layout-landfolder in theresfolder, copy it theactivity_detail.xmlfile & update it to obtain a horizontalLinearLayout - Override the
onSaveInstanceStatemethod of theDetailFragmentclass & update theonCreateone