From 30b0348655aa468fb5248aea9f171f8ede587a3e Mon Sep 17 00:00:00 2001 From: Jimmy Shih Date: Mon, 26 Mar 2012 19:02:42 -0700 Subject: [PATCH] Add support for search widget. For API level >= 11, use the search widget. For API level < 11, use the search dialog. For API level >=14, the search button will expand the search widget. For API level < 14, the search button will invoke the search dialog. --- MyTracks/res/menu/track_list.xml | 3 +- .../apps/mytracks/TrackListActivity.java | 26 +++++++++----- .../apps/mytracks/util/Api11Adapter.java | 21 ++++++++++- .../apps/mytracks/util/Api14Adapter.java | 35 +++++++++++++++++++ .../apps/mytracks/util/Api7Adapter.java | 18 ++++++++++ .../apps/mytracks/util/ApiAdapter.java | 28 +++++++++++++++ .../apps/mytracks/util/ApiAdapterFactory.java | 5 ++- 7 files changed, 125 insertions(+), 11 deletions(-) create mode 100644 MyTracks/src/com/google/android/apps/mytracks/util/Api14Adapter.java diff --git a/MyTracks/res/menu/track_list.xml b/MyTracks/res/menu/track_list.xml index b3b6c7a59..62ef77313 100644 --- a/MyTracks/res/menu/track_list.xml +++ b/MyTracks/res/menu/track_list.xml @@ -26,9 +26,10 @@ limitations under the License. android:showAsAction="always" android:title="@string/menu_stop_recording"/> = 11) { + if (Build.VERSION.SDK_INT >= 14) { + apiAdapter = new Api14Adapter(); + return apiAdapter; + } else if (Build.VERSION.SDK_INT >= 11) { apiAdapter = new Api11Adapter(); return apiAdapter; } else if (Build.VERSION.SDK_INT >= 10) {