From f30b4fcd3a525d2fa3c2d85fb11e8e7aa3a6a031 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 10 Aug 2012 22:03:34 +0200 Subject: Add edit and delete functionality * res/values/strings.xml: Add strings for `main_context_menu_edit' and `main_context_menu_delete'. * src/ryuslash/org/dvdroid/AddDVDActivity.java (saveDVD): Renamed from `createDVD'. When ID is greater than 0 update, otherwise create. (onCreate): Get ID from the `Intent' that was used to start this activity. If ID is greater than 0, show known information in the inputs. * src/ryuslash/org/dvdroid/DVDDataSource.java: (createValues): (updateDVD): (getById): New functions. (createDVD): Use `createValues' to get the values for the database. (deleteDVD): Add overloaded function that takes a `long', make the original function use this to delete a `DVD'. * src/ryuslash/org/dvdroid/DVDroidActivity.java: Implement `ActionMode.Callback'. (onActivityResult): If REQUESTCODE is `2' reset the intent information so as not to confuse it during its next invocation. Finish action mode. (onActionItemClicked): (onCreateActionMode): (onDestroyActionMode): (onListItemClick): (onPrepareActionMode): (reloadList): (showEditDVD): New functions. (onCreate): Instantiate the ADD_DVD `Intent'. --- res/menu/main_context_menu.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 res/menu/main_context_menu.xml (limited to 'res/menu/main_context_menu.xml') diff --git a/res/menu/main_context_menu.xml b/res/menu/main_context_menu.xml new file mode 100644 index 0000000..9cdf622 --- /dev/null +++ b/res/menu/main_context_menu.xml @@ -0,0 +1,11 @@ + + + + + -- cgit v1.2.3-54-g00ecf