summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMason Tang <masontang@google.com>2010-07-26 15:55:36 -0700
committerMason Tang <masontang@google.com>2010-07-27 13:27:32 -0700
commit0948785d981b618447c2c067a6374725b7acefda (patch)
tree5e7452e650e0006568364bccbf6e0f8e5fd0cbf9 /src
parent4484b04707d5570a6de4a5a4b228a9bb273bbab7 (diff)
downloadandroid_packages_apps_Calendar-0948785d981b618447c2c067a6374725b7acefda.tar.gz
android_packages_apps_Calendar-0948785d981b618447c2c067a6374725b7acefda.tar.bz2
android_packages_apps_Calendar-0948785d981b618447c2c067a6374725b7acefda.zip
Added search to the action bar, clearing out events with new searches
- Search is now accessible from the menu and the action bar - When searching, the agenda view list is cleared out and "loading..." is displayed Change-Id: If8878671ff2c41075c2fd533b6cb1208d86fc6dd
Diffstat (limited to 'src')
-rw-r--r--src/com/android/calendar/AgendaWindowAdapter.java18
-rw-r--r--src/com/android/calendar/AllInOneActivity.java3
-rw-r--r--src/com/android/calendar/SearchActivity.java2
3 files changed, 5 insertions, 18 deletions
diff --git a/src/com/android/calendar/AgendaWindowAdapter.java b/src/com/android/calendar/AgendaWindowAdapter.java
index e3720d46..2999248a 100644
--- a/src/com/android/calendar/AgendaWindowAdapter.java
+++ b/src/com/android/calendar/AgendaWindowAdapter.java
@@ -492,10 +492,6 @@ public class AgendaWindowAdapter extends BaseAdapter {
}
public void refresh(Time goToTime, String searchQuery, boolean forced) {
- if (!Utils.equals(searchQuery, mSearchQuery)) {
- // When we change search terms, clean up any old state, start over
- resetInstanceFields();
- }
mSearchQuery = searchQuery;
if (DEBUGLOG) {
Log.e(TAG, "refresh " + goToTime.toString() + (forced ? " forced" : " not forced"));
@@ -567,20 +563,6 @@ public class AgendaWindowAdapter extends BaseAdapter {
}
}
- /**
- * Resets any transient state in this instance and puts it back into a state
- * where it can be treated as a newly instantiated adapter
- *
- * TODO are these all of the fields that need to be reset?
- */
- private void resetInstanceFields() {
- mEmptyCursorCount = 0;
- mNewerRequests = 0;
- mNewerRequestsProcessed = 0;
- mOlderRequests = 0;
- mOlderRequestsProcessed = 0;
- }
-
private String buildQuerySelection() {
// Respect the preference to show/hide declined events
diff --git a/src/com/android/calendar/AllInOneActivity.java b/src/com/android/calendar/AllInOneActivity.java
index 8ef8ef53..4e9bc504 100644
--- a/src/com/android/calendar/AllInOneActivity.java
+++ b/src/com/android/calendar/AllInOneActivity.java
@@ -152,6 +152,9 @@ public class AllInOneActivity extends Activity implements EventHandler,
t = new Time();
t.setToNow();
break;
+ case R.id.action_search:
+ onSearchRequested();
+ return true;
case R.id.action_create_event:
mController.sendEventRelatedEvent(this, EventType.CREATE_EVENT, -1, 0, 0, 0, 0);
return true;
diff --git a/src/com/android/calendar/SearchActivity.java b/src/com/android/calendar/SearchActivity.java
index 0ff8e787..2aefe7ee 100644
--- a/src/com/android/calendar/SearchActivity.java
+++ b/src/com/android/calendar/SearchActivity.java
@@ -202,6 +202,8 @@ public class SearchActivity extends Activity implements Navigator {
}
private void search(String searchQuery) {
+ mAgendaListView = new AgendaListView(this);
+ setContentView(mAgendaListView);
mAgendaListView.search(searchQuery, true);
}