From 3f173d44344ad21d61534d28d9555198703095bd Mon Sep 17 00:00:00 2001 From: Jimmy Shih Date: Tue, 29 Jan 2013 16:40:01 -0800 Subject: [PATCH] Add option to share a track via Google Drive. --- MyTracks/AndroidManifest.xml | 2 + MyTracks/res/layout/add_people.xml | 34 +++++ MyTracks/res/layout/add_people_item.xml | 32 +++++ MyTracks/res/menu/map.xml | 2 +- MyTracks/res/menu/track_detail.xml | 31 +++-- MyTracks/res/values/keys.xml | 7 +- MyTracks/res/values/strings.xml | 31 ++++- .../apps/mytracks/TrackDetailActivity.java | 38 ++++-- .../fragments/AddPeopleDialogFragment.java | 125 ++++++++++++++++++ .../mytracks/io/drive/SendDriveActivity.java | 3 +- .../mytracks/io/drive/SendDriveAsyncTask.java | 43 +++++- .../mytracks/io/sendtogoogle/SendRequest.java | 19 +++ .../apps/mytracks/io/sync/SyncUtils.java | 12 +- .../apps/mytracks/util/PreferencesUtils.java | 7 +- 14 files changed, 345 insertions(+), 41 deletions(-) create mode 100644 MyTracks/res/layout/add_people.xml create mode 100644 MyTracks/res/layout/add_people_item.xml create mode 100644 MyTracks/src/com/google/android/apps/mytracks/fragments/AddPeopleDialogFragment.java diff --git a/MyTracks/AndroidManifest.xml b/MyTracks/AndroidManifest.xml index bcd3f86f2..17a83d830 100755 --- a/MyTracks/AndroidManifest.xml +++ b/MyTracks/AndroidManifest.xml @@ -52,6 +52,8 @@ limitations under the License. + + diff --git a/MyTracks/res/layout/add_people.xml b/MyTracks/res/layout/add_people.xml new file mode 100644 index 000000000..744a4ed04 --- /dev/null +++ b/MyTracks/res/layout/add_people.xml @@ -0,0 +1,34 @@ + + + + + + + + \ No newline at end of file diff --git a/MyTracks/res/layout/add_people_item.xml b/MyTracks/res/layout/add_people_item.xml new file mode 100644 index 000000000..468bd3b36 --- /dev/null +++ b/MyTracks/res/layout/add_people_item.xml @@ -0,0 +1,32 @@ + + + + + + \ No newline at end of file diff --git a/MyTracks/res/menu/map.xml b/MyTracks/res/menu/map.xml index 0ee97b8e2..34ac287e8 100644 --- a/MyTracks/res/menu/map.xml +++ b/MyTracks/res/menu/map.xml @@ -17,7 +17,7 @@ limitations under the License. diff --git a/MyTracks/res/menu/track_detail.xml b/MyTracks/res/menu/track_detail.xml index 82b64f253..784eed96d 100644 --- a/MyTracks/res/menu/track_detail.xml +++ b/MyTracks/res/menu/track_detail.xml @@ -35,21 +35,28 @@ limitations under the License. android:title="@string/menu_share"> + + - + @@ -61,36 +68,36 @@ limitations under the License. \ No newline at end of file diff --git a/MyTracks/res/values/keys.xml b/MyTracks/res/values/keys.xml index 29c819b1e..2b0024241 100644 --- a/MyTracks/res/values/keys.xml +++ b/MyTracks/res/values/keys.xml @@ -30,6 +30,9 @@ limitations under the License. chartShowHeartRate chartShowPower chartShowSpeed + confirmPlayEarth + confirmShareDrive + confirmShareMap defaultActivity defaultMapPublic driveSync @@ -45,9 +48,7 @@ limitations under the License. sendToDrive sendToFusionTables sendToMaps - sensorType - showConfirmPlayDialog - showConfrimSharingDialog + sensorType splitFrequency statsShowCoordinate statsShowElevation diff --git a/MyTracks/res/values/strings.xml b/MyTracks/res/values/strings.xml index 0e41edbe3..1f41f0b1b 100644 --- a/MyTracks/res/values/strings.xml +++ b/MyTracks/res/values/strings.xml @@ -1252,6 +1252,12 @@ limitations under the License. Character limit: ~20 (1 line)"> Share + + Share via Drive + + Add people + + + Enter email addresses + + + This will upload your track to Google Drive so you can share the file with friends. The file + will be private and only those you have shared with will have access. + + - This will upload your track to Google Maps so that you can share the map url with friends. The - map will be either public or unlisted depending on your setting at Settings -> Google. For more - info on public versus unlisted, see %1$s. + This will upload your track to Google Maps so you can share the map url with friends. The map + will be either public or unlisted depending on your setting at Settings -> Google. For more info + on public versus unlisted, see %1$s.