Permalink
Browse files

Some UI tweaks

Shortened titles of context menu items;
Added title for reports' context menu;
Tasks are now sorted by title
  • Loading branch information...
1 parent ab6f33a commit c108731242fc32e1411b3fee6d25eccb33a58854 @alekz committed Sep 30, 2011
Showing with 14 additions and 15 deletions.
  1. +6 −6 res/values/strings.xml
  2. +7 −8 src/com/k10v/goaltracker/ReportList.java
  3. +1 −1 src/com/k10v/goaltracker/TaskPeer.java
View
@@ -9,10 +9,10 @@
<!-- List of tasks -->
<string name="message_no_tasks">No tasks yet</string>
<string name="menu_create_task">Create Task</string>
- <string name="menu_edit_task">Edit Task</string>
- <string name="menu_delete_task">Delete Task</string>
- <string name="menu_view_task_reports">View Reports</string>
- <string name="menu_view_task_graph">View Graph</string>
+ <string name="menu_edit_task">Edit</string>
+ <string name="menu_delete_task">Delete</string>
+ <string name="menu_view_task_reports">Reports</string>
+ <string name="menu_view_task_graph">Graph</string>
<!-- Edit task -->
<string name="title_edit_task">Edit Task</string>
@@ -29,8 +29,8 @@
<!-- List of reports -->
<string name="message_no_reports">No reports yet</string>
<string name="menu_create_report">Add Report</string>
- <string name="menu_edit_report">Edit Report</string>
- <string name="menu_delete_report">Delete Report</string>
+ <string name="menu_edit_report">Edit</string>
+ <string name="menu_delete_report">Delete</string>
<!-- Delete report -->
<string name="title_edit_report">Edit Report</string>
@@ -113,12 +113,11 @@ public void onCreateContextMenu(ContextMenu menu, View v,
super.onCreateContextMenu(menu, v, menuInfo);
// TODO: Set menu title
- // AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
- // Cursor c = mTasksCursor;
- // c.moveToPosition(info.position);
- // String title =
- // c.getString(c.getColumnIndexOrThrow(TaskPeer.KEY_TITLE));
- // menu.setHeaderTitle(title);
+ AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
+ Cursor c = mReportsCursor;
+ c.moveToPosition(info.position);
+ String title = c.getString(c.getColumnIndexOrThrow(ReportPeer.KEY_DATE));
+ menu.setHeaderTitle(title);
// Add menu items
menu.add(0, MENU_ID_EDIT_REPORT, 1, R.string.menu_edit_report);
@@ -242,7 +241,7 @@ private void runEditReport(long rowId) {
/**
* Launches confirmation dialog asking is user really wants to delete the
* report, then deletes it if user confirms
- *
+ *
* @param rowId ID of the report to delete
*/
private void runDeleteReport(long rowId) {
@@ -253,7 +252,7 @@ private void runDeleteReport(long rowId) {
/**
* Actually deletes report with given ID and reloads the list of reports.
* Shouldn't be called directly, use runDeleteReport() instead.
- *
+ *
* @param rowId ID of the report to delete
*/
private void doDeleteReport(long rowId) {
@@ -90,7 +90,7 @@ public boolean deleteTask(long rowId) {
* @return Cursor over all tasks
*/
public Cursor fetchAllTasks() {
- return mDb.query(TABLE, getFields(), null, null, null, null, null);
+ return mDb.query(TABLE, getFields(), null, null, null, null, KEY_TITLE);
}
/**

0 comments on commit c108731

Please sign in to comment.