summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2012-08-10 22:03:34 +0200
committerGravatar Tom Willemsen2012-08-10 22:03:34 +0200
commitf30b4fcd3a525d2fa3c2d85fb11e8e7aa3a6a031 (patch)
tree00cdeeb15ca9de3574e9c1e80ece9c849e926eb6 /res
parent2689fd0c5010d6e97616dfbc8557d0828b3d4064 (diff)
downloaddvdroid-f30b4fcd3a525d2fa3c2d85fb11e8e7aa3a6a031.tar.gz
dvdroid-f30b4fcd3a525d2fa3c2d85fb11e8e7aa3a6a031.zip
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'.
Diffstat (limited to 'res')
-rw-r--r--res/drawable-hdpi/delete.pngbin0 -> 1611 bytes
-rw-r--r--res/drawable-hdpi/edit.pngbin0 -> 1875 bytes
-rw-r--r--res/drawable-mdpi/delete.pngbin0 -> 1358 bytes
-rw-r--r--res/drawable-mdpi/edit.pngbin0 -> 1490 bytes
-rw-r--r--res/menu/main_context_menu.xml11
-rw-r--r--res/values/strings.xml2
6 files changed, 13 insertions, 0 deletions
diff --git a/res/drawable-hdpi/delete.png b/res/drawable-hdpi/delete.png
new file mode 100644
index 0000000..ffd19d9
--- /dev/null
+++ b/res/drawable-hdpi/delete.png
Binary files differ
diff --git a/res/drawable-hdpi/edit.png b/res/drawable-hdpi/edit.png
new file mode 100644
index 0000000..3eb5190
--- /dev/null
+++ b/res/drawable-hdpi/edit.png
Binary files differ
diff --git a/res/drawable-mdpi/delete.png b/res/drawable-mdpi/delete.png
new file mode 100644
index 0000000..a8ee5f2
--- /dev/null
+++ b/res/drawable-mdpi/delete.png
Binary files differ
diff --git a/res/drawable-mdpi/edit.png b/res/drawable-mdpi/edit.png
new file mode 100644
index 0000000..4a28d03
--- /dev/null
+++ b/res/drawable-mdpi/edit.png
Binary files differ
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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+id/main_context_menu_edit"
+ android:title="@string/main_context_menu_edit"
+ android:showAsAction="ifRoom|withText"
+ android:icon="@drawable/edit" />
+ <item android:id="@+id/main_context_menu_delete"
+ android:title="@string/main_context_menu_delete"
+ android:showAsAction="ifRoom|withText"
+ android:icon="@drawable/delete" />
+</menu>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index dc3e703..0a4ee4d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -6,4 +6,6 @@
<string name="watched_entry">Watched</string>
<string name="main_menu_add">Add</string>
<string name="add_menu_save">Save</string>
+ <string name="main_context_menu_edit">Edit</string>
+ <string name="main_context_menu_delete">Delete</string>
</resources>