diff --git a/MyTracks/AndroidManifest.xml b/MyTracks/AndroidManifest.xml index db49bb3d7..ae51af768 100755 --- a/MyTracks/AndroidManifest.xml +++ b/MyTracks/AndroidManifest.xml @@ -153,18 +153,15 @@ limitations under the License. android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|fontScale" android:exported="false" /> - + - - - diff --git a/MyTracks/res/menu/main.xml b/MyTracks/res/menu/main.xml index 12b0eeb16..21c80178c 100644 --- a/MyTracks/res/menu/main.xml +++ b/MyTracks/res/menu/main.xml @@ -1,4 +1,19 @@ + + + + + \ No newline at end of file diff --git a/MyTracks/src/com/google/android/apps/mytracks/TrackList.java b/MyTracks/src/com/google/android/apps/mytracks/TrackList.java index 8bbab51d9..b3e702e74 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/TrackList.java +++ b/MyTracks/src/com/google/android/apps/mytracks/TrackList.java @@ -38,6 +38,7 @@ import android.os.Handler; import android.util.Log; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; +import android.view.Menu; import android.view.MenuItem; import android.view.SubMenu; import android.view.View; @@ -90,7 +91,7 @@ public class TrackList extends ListActivity String saveFileFormat = getString(R.string.track_list_save_file); String shareFileFormat = getString(R.string.track_list_share_file); String fileTypes[] = getResources().getStringArray(R.array.file_types); - + menu.add(0, Constants.MENU_SEND_TO_GOOGLE, 0, R.string.track_list_send_google); SubMenu share = menu.addSubMenu(0, Constants.MENU_SHARE, 0, @@ -275,6 +276,17 @@ public class TrackList extends ListActivity super.onDestroy(); } + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.search_only, menu); + return true; + } + + /* Callback from menu/search_only.xml */ + public void onSearch(@SuppressWarnings("unused") MenuItem i) { + onSearchRequested(); + } + private void updateButtonsEnabled() { View deleteAll = findViewById(R.id.tracklist_btn_delete_all); View exportAll = findViewById(R.id.tracklist_btn_export_all); diff --git a/MyTracks/src/com/google/android/apps/mytracks/WaypointsList.java b/MyTracks/src/com/google/android/apps/mytracks/WaypointsList.java index 799131d33..1731ddc32 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/WaypointsList.java +++ b/MyTracks/src/com/google/android/apps/mytracks/WaypointsList.java @@ -38,6 +38,7 @@ import android.os.RemoteException; import android.util.Log; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; +import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnCreateContextMenuListener; @@ -197,6 +198,17 @@ public class WaypointsList extends ListActivity super.onDestroy(); } + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.search_only, menu); + return true; + } + + /* Callback from menu/search_only.xml */ + public void onSearch(@SuppressWarnings("unused") MenuItem i) { + onSearchRequested(); + } + @Override public void onClick(View v) { WaypointCreationRequest request; @@ -265,10 +277,10 @@ public class WaypointsList extends ListActivity if (columnIndex == timeIdx) { long time = cursor.getLong(timeIdx); TextView textView = (TextView) view; - + if (time == 0) { textView.setVisibility(View.GONE); - } else { + } else { textView.setText(StringUtils.formatDateTime(time)); textView.setVisibility(View.VISIBLE); }