Combine save and send to google into export.
|
Before Width: | Height: | Size: 892 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 631 B |
|
Before Width: | Height: | Size: 859 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 681 B |
|
Before Width: | Height: | Size: 892 B |
|
Before Width: | Height: | Size: 1.4 KiB |
@@ -1,69 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
Copyright 2010 Google Inc.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
-->
|
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
style="@style/ScrollView" >
|
|
||||||
<TableLayout
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:padding="8dp"
|
|
||||||
android:stretchColumns="1" >
|
|
||||||
<TableRow>
|
|
||||||
<ImageView
|
|
||||||
android:contentDescription="@string/send_google_maps"
|
|
||||||
android:src="@drawable/google_maps_icon"
|
|
||||||
style="@style/ChooseUploadServiceImageView" />
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/choose_upload_service_maps"
|
|
||||||
android:text="@string/send_google_maps"
|
|
||||||
style="@style/ChooseUploadServiceCheckBox" />
|
|
||||||
</TableRow>
|
|
||||||
<TableRow android:id="@+id/choose_upload_service_maps_options" >
|
|
||||||
<RadioGroup
|
|
||||||
android:layout_column="1"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:layout_width="0dp" >
|
|
||||||
<RadioButton
|
|
||||||
android:id="@+id/choose_upload_service_new_map"
|
|
||||||
style="@style/TextMedium" />
|
|
||||||
<RadioButton
|
|
||||||
android:id="@+id/choose_upload_service_existing_map"
|
|
||||||
android:text="@string/send_google_existing_map"
|
|
||||||
style="@style/TextMedium" />
|
|
||||||
</RadioGroup>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<ImageView
|
|
||||||
android:contentDescription="@string/send_google_fusion_tables"
|
|
||||||
android:src="@drawable/google_fusion_tables_icon"
|
|
||||||
style="@style/ChooseUploadServiceImageView" />
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/choose_upload_service_fusion_tables"
|
|
||||||
style="@style/ChooseUploadServiceCheckBox" />
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<ImageView
|
|
||||||
android:contentDescription="@string/send_google_spreadsheets"
|
|
||||||
android:src="@drawable/google_spreadsheets_icon"
|
|
||||||
style="@style/ChooseUploadServiceImageView" />
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/choose_upload_service_spreadsheets"
|
|
||||||
android:text="@string/send_google_spreadsheets"
|
|
||||||
style="@style/ChooseUploadServiceCheckBox" />
|
|
||||||
</TableRow>
|
|
||||||
</TableLayout>
|
|
||||||
</ScrollView>
|
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright 2010 Google Inc.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
style="@style/ScrollView" >
|
||||||
|
<RadioGroup
|
||||||
|
android:id="@+id/export_type_options"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:padding="8dp" >
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/export_google_maps"
|
||||||
|
android:text="@string/export_google_maps"
|
||||||
|
style="@style/TextMedium" />
|
||||||
|
<RadioGroup
|
||||||
|
android:id="@+id/export_google_maps_options"
|
||||||
|
style="@style/ExportRadioGroup" >
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/export_google_maps_public"
|
||||||
|
android:text="@string/export_google_maps_public"
|
||||||
|
style="@style/TextMedium" />
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/export_google_maps_unlisted"
|
||||||
|
android:text="@string/export_google_maps_unlisted"
|
||||||
|
style="@style/TextMedium" />
|
||||||
|
</RadioGroup>
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/export_google_fusion_tables"
|
||||||
|
android:text="@string/export_google_fusion_tables"
|
||||||
|
style="@style/TextMedium" />
|
||||||
|
<RadioGroup
|
||||||
|
android:id="@+id/export_google_fusion_tables_options"
|
||||||
|
style="@style/ExportRadioGroup" >
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/export_google_fusion_tables_public"
|
||||||
|
android:text="@string/export_google_fusion_tables_public"
|
||||||
|
style="@style/TextMedium" />
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/export_google_fusion_tables_private"
|
||||||
|
android:text="@string/export_google_fusion_tables_private"
|
||||||
|
style="@style/TextMedium" />
|
||||||
|
</RadioGroup>
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/export_google_spreadsheets"
|
||||||
|
android:text="@string/export_google_spreadsheets"
|
||||||
|
style="@style/TextMedium" />
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/export_external_storage"
|
||||||
|
android:text="@string/export_external_storage"
|
||||||
|
style="@style/TextMedium" />
|
||||||
|
<RadioGroup
|
||||||
|
android:id="@+id/export_external_storage_options"
|
||||||
|
style="@style/ExportRadioGroup" >
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/export_external_storage_gpx"
|
||||||
|
style="@style/TextMedium" />
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/export_external_storage_kml"
|
||||||
|
style="@style/TextMedium" />
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/export_external_storage_csv"
|
||||||
|
style="@style/TextMedium" />
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/export_external_storage_tcx"
|
||||||
|
style="@style/TextMedium" />
|
||||||
|
</RadioGroup>
|
||||||
|
</RadioGroup>
|
||||||
|
</ScrollView>
|
||||||
@@ -42,10 +42,10 @@ limitations under the License.
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingLeft="8dp" >
|
android:paddingLeft="8dp" >
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/send_google_drive"
|
android:text="@string/export_google_drive"
|
||||||
style="@style/TextMedium" />
|
style="@style/TextMedium" />
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/send_google_drive_url"
|
android:text="@string/export_google_drive_url"
|
||||||
style="@style/TextSmall" />
|
style="@style/TextSmall" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -70,10 +70,10 @@ limitations under the License.
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingLeft="8dp" >
|
android:paddingLeft="8dp" >
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/send_google_maps"
|
android:text="@string/export_google_maps"
|
||||||
style="@style/TextMedium" />
|
style="@style/TextMedium" />
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/send_google_maps_url"
|
android:text="@string/export_google_maps_url"
|
||||||
style="@style/TextSmall" />
|
style="@style/TextSmall" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -98,10 +98,10 @@ limitations under the License.
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingLeft="8dp" >
|
android:paddingLeft="8dp" >
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/send_google_fusion_tables"
|
android:text="@string/export_google_fusion_tables"
|
||||||
style="@style/TextMedium" />
|
style="@style/TextMedium" />
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/send_google_fusion_tables_url"
|
android:text="@string/export_google_fusion_tables_url"
|
||||||
style="@style/TextSmall" />
|
style="@style/TextSmall" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -126,10 +126,10 @@ limitations under the License.
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingLeft="8dp" >
|
android:paddingLeft="8dp" >
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/send_google_spreadsheets"
|
android:text="@string/export_google_spreadsheets"
|
||||||
style="@style/TextMedium" />
|
style="@style/TextMedium" />
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/send_google_spreadsheets_url"
|
android:text="@string/export_google_spreadsheets_url"
|
||||||
style="@style/TextSmall" />
|
style="@style/TextSmall" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -70,6 +70,10 @@ Google은 이용자에 대한 위치정보의 이용∙제공사실을 위치정
|
|||||||
대표자: 염동훈\n
|
대표자: 염동훈\n
|
||||||
주소 : 서울 강남구 역삼동 737 강남파이낸스센터 22층\n
|
주소 : 서울 강남구 역삼동 737 강남파이낸스센터 22층\n
|
||||||
전화번호 : (02) 531-9000\n</string>
|
전화번호 : (02) 531-9000\n</string>
|
||||||
|
<string name="export_google_drive_url">drive.google.com</string>
|
||||||
|
<string name="export_google_fusion_tables_url">google.com/fusiontables</string>
|
||||||
|
<string name="export_google_maps_url">maps.google.com</string>
|
||||||
|
<string name="export_google_spreadsheets_url">drive.google.com</string>
|
||||||
<string name="maps_public_unlisted_url">support.google.com/maps/bin/answer.py?answer=144365</string>
|
<string name="maps_public_unlisted_url">support.google.com/maps/bin/answer.py?answer=144365</string>
|
||||||
<string name="marker_statistics_icon_url">http://maps.google.com/mapfiles/ms/micons/ylw-pushpin.png</string>
|
<string name="marker_statistics_icon_url">http://maps.google.com/mapfiles/ms/micons/ylw-pushpin.png</string>
|
||||||
<string name="marker_waypoint_icon_url">http://maps.google.com/mapfiles/ms/micons/blue-pushpin.png</string>
|
<string name="marker_waypoint_icon_url">http://maps.google.com/mapfiles/ms/micons/blue-pushpin.png</string>
|
||||||
@@ -79,10 +83,6 @@ Google은 이용자에 대한 위치정보의 이용∙제공사실을 위치정
|
|||||||
<string name="my_tracks_support_url">groups.google.com/a/googleproductforums.com/forum/#!categories/maps/mytracks</string>
|
<string name="my_tracks_support_url">groups.google.com/a/googleproductforums.com/forum/#!categories/maps/mytracks</string>
|
||||||
<string name="my_tracks_web_url">www.google.com/mobile/mytracks</string>
|
<string name="my_tracks_web_url">www.google.com/mobile/mytracks</string>
|
||||||
<string name="permission_notification_value">com.google.android.apps.mytracks.MYTRACKS_NOTIFICATIONS</string>
|
<string name="permission_notification_value">com.google.android.apps.mytracks.MYTRACKS_NOTIFICATIONS</string>
|
||||||
<string name="send_google_drive_url">drive.google.com</string>
|
|
||||||
<string name="send_google_fusion_tables_url">google.com/fusiontables</string>
|
|
||||||
<string name="send_google_maps_url">maps.google.com</string>
|
|
||||||
<string name="send_google_spreadsheets_url">drive.google.com</string>
|
|
||||||
<string name="sensor_type_value_ant">ANT</string>
|
<string name="sensor_type_value_ant">ANT</string>
|
||||||
<string name="sensor_type_value_none">NONE</string>
|
<string name="sensor_type_value_none">NONE</string>
|
||||||
<string name="sensor_type_value_polar">POLAR</string>
|
<string name="sensor_type_value_polar">POLAR</string>
|
||||||
|
|||||||
@@ -25,19 +25,17 @@ limitations under the License.
|
|||||||
<string name="chart_show_power_key">chartShowPower</string>
|
<string name="chart_show_power_key">chartShowPower</string>
|
||||||
<string name="chart_show_speed_key">chartShowSpeed</string>
|
<string name="chart_show_speed_key">chartShowSpeed</string>
|
||||||
<string name="default_activity_key">defaultActivity</string>
|
<string name="default_activity_key">defaultActivity</string>
|
||||||
<string name="default_map_public_key">defaultMapPublic</string>
|
<string name="export_external_storage_format_key">exportExternalStorageFormat</string>
|
||||||
<string name="default_table_public_key">defaultTablePublic</string>
|
<string name="export_google_fusion_tables_public_key">exportGoogleFusionTablesPublic</string>
|
||||||
|
<string name="export_google_maps_public_key">exportGoogleMapsPublic</string>
|
||||||
|
<string name="export_type_key">exportType</string>
|
||||||
<string name="map_type_key">mapType</string>
|
<string name="map_type_key">mapType</string>
|
||||||
<string name="max_recording_distance_key">maxRecordingDistance</string>
|
<string name="max_recording_distance_key">maxRecordingDistance</string>
|
||||||
<string name="metric_units_key">metricUnits</string>
|
<string name="metric_units_key">metricUnits</string>
|
||||||
<string name="min_recording_distance_key">minRecordingDistance</string>
|
<string name="min_recording_distance_key">minRecordingDistance</string>
|
||||||
<string name="min_recording_interval_key">minRecordingInterval</string>
|
<string name="min_recording_interval_key">minRecordingInterval</string>
|
||||||
<string name="min_required_accuracy_key">minRequiredAccuracy</string>
|
<string name="min_required_accuracy_key">minRequiredAccuracy</string>
|
||||||
<string name="pick_existing_map_key">pickExistingMap</string>
|
|
||||||
<string name="report_speed_key">reportSpeed</string>
|
<string name="report_speed_key">reportSpeed</string>
|
||||||
<string name="send_to_fusion_tables_key">sendToFusionTables</string>
|
|
||||||
<string name="send_to_maps_key">sendToMaps</string>
|
|
||||||
<string name="send_to_spreadsheets_key">sendToSpreadsheets</string>
|
|
||||||
<string name="sensor_type_key">sensorType</string>
|
<string name="sensor_type_key">sensorType</string>
|
||||||
<string name="share_track_key">shareTrack</string>
|
<string name="share_track_key">shareTrack</string>
|
||||||
<string name="split_frequency_key">splitFrequency</string>
|
<string name="split_frequency_key">splitFrequency</string>
|
||||||
|
|||||||
@@ -612,6 +612,59 @@ limitations under the License.
|
|||||||
Terms of Service
|
Terms of Service
|
||||||
</string>
|
</string>
|
||||||
|
|
||||||
|
<!-- Export -->
|
||||||
|
<string name="export_external_storage"
|
||||||
|
translation_description="When exporting a track, the option to export to external storage.">
|
||||||
|
External storage
|
||||||
|
</string>
|
||||||
|
<string name="export_external_storage_option"
|
||||||
|
translation_description="When exporting a track to external storage, the option to export as a
|
||||||
|
certain file format.
|
||||||
|
|
||||||
|
%1$s: file format. 'GPX', 'KML', 'CSV', or 'TCX'.">
|
||||||
|
as %1$s file
|
||||||
|
</string>
|
||||||
|
<string name="export_google_drive"
|
||||||
|
translation_description="When exporting a track, the option to export to Google Drive.">
|
||||||
|
Google Drive
|
||||||
|
</string>
|
||||||
|
<string name="export_google_fusion_tables"
|
||||||
|
translation_description="When exporting a track, the option to export to Google Fusion Tables.">
|
||||||
|
Google Fusion Tables
|
||||||
|
</string>
|
||||||
|
<string name="export_google_fusion_tables_private"
|
||||||
|
translation_description="When exporting a track to Google Fusion Tables, the option to export as
|
||||||
|
a new private table as opposed to a new public table.">
|
||||||
|
as new private table
|
||||||
|
</string>
|
||||||
|
<string name="export_google_fusion_tables_public"
|
||||||
|
translation_description="When exporting a trck to Google Fusion Tables, the option to export as
|
||||||
|
a new public table as opposed to a new private table.">
|
||||||
|
as new public table
|
||||||
|
</string>
|
||||||
|
<string name="export_google_maps"
|
||||||
|
translation_description="When exporting a track, the option to export to Google Maps.">
|
||||||
|
Google Maps
|
||||||
|
</string>
|
||||||
|
<string name="export_google_maps_public"
|
||||||
|
translation_description="When exporting a track to Google Maps, the option to export as a new
|
||||||
|
public map as opposed to a new unlisted map.">
|
||||||
|
as new public map
|
||||||
|
</string>
|
||||||
|
<string name="export_google_maps_unlisted"
|
||||||
|
translation_description="When sending a track to Google Maps, the option to export as a new
|
||||||
|
unlisted map as opposed to a new public map.">
|
||||||
|
as new unlisted map
|
||||||
|
</string>
|
||||||
|
<string name="export_google_spreadsheets"
|
||||||
|
translation_description="When exporting a track, the option to export to Google Spreadsheets.">
|
||||||
|
Google Spreadsheets
|
||||||
|
</string>
|
||||||
|
<string name="export_dialog_title"
|
||||||
|
translation_description="The dialog title when exporting a track.">
|
||||||
|
Export to…
|
||||||
|
</string>
|
||||||
|
|
||||||
<!-- External Storage -->
|
<!-- External Storage -->
|
||||||
<string name="external_storage_not_available"
|
<string name="external_storage_not_available"
|
||||||
translation_description="Error message when the external storage is not available.">
|
translation_description="Error message when the external storage is not available.">
|
||||||
@@ -1299,50 +1352,11 @@ limitations under the License.
|
|||||||
translation_description="When sending to Google, the dialog title to choose a Google account.">
|
translation_description="When sending to Google, the dialog title to choose a Google account.">
|
||||||
Choose account
|
Choose account
|
||||||
</string>
|
</string>
|
||||||
<string name="send_google_drive"
|
|
||||||
translation_description="When sending a track to Google, under the 'Send to...' dialog, the
|
|
||||||
checkbox option to send to Google Drive.">
|
|
||||||
Google Drive
|
|
||||||
</string>
|
|
||||||
<string name="send_google_error"
|
<string name="send_google_error"
|
||||||
translation_description="When sending a track to Google, a message indicating that an error has
|
translation_description="When sending a track to Google, a message indicating that an error has
|
||||||
occurred and ask the user to try again.">
|
occurred and ask the user to try again.">
|
||||||
An error has occurred. Please try again.
|
An error has occurred. Please try again.
|
||||||
</string>
|
</string>
|
||||||
<string name="send_google_existing_map"
|
|
||||||
translation_description="When sending a track to Google Maps, the radio option to use an
|
|
||||||
existing map as opposed to create a new map.">
|
|
||||||
Use existing map
|
|
||||||
</string>
|
|
||||||
<string name="send_google_fusion_tables"
|
|
||||||
translation_description="When sending a track to Google, the Google Fusion Tables name.">
|
|
||||||
Google Fusion Tables
|
|
||||||
</string>
|
|
||||||
<string name="send_google_fusion_tables_private"
|
|
||||||
translation_description="When sending a track to Google Fusion Tables, indicate a new private
|
|
||||||
table will get created.">
|
|
||||||
(new private table)
|
|
||||||
</string>
|
|
||||||
<string name="send_google_fusion_tables_public"
|
|
||||||
translation_description="When sending a track to Google Fusion Tables, indicate a new public
|
|
||||||
table will get created.">
|
|
||||||
(new public table)
|
|
||||||
</string>
|
|
||||||
<string name="send_google_maps"
|
|
||||||
translation_description="When sending a track to Google, under the 'Send to...' dialog, the
|
|
||||||
checkbox option to send to Google Maps.">
|
|
||||||
Google Maps
|
|
||||||
</string>
|
|
||||||
<string name="send_google_new_public_map"
|
|
||||||
translation_description="When sending a track to Google Maps, the radio option to create a new
|
|
||||||
public map as opposed to use an existing map.">
|
|
||||||
Create new public map
|
|
||||||
</string>
|
|
||||||
<string name="send_google_new_unlisted_map"
|
|
||||||
translation_description="When sending a track to Google Maps, the radio option to create a new
|
|
||||||
unlisted map as opposed to use an existing map.">
|
|
||||||
Create new unlisted map
|
|
||||||
</string>
|
|
||||||
<string name="send_google_no_account_message"
|
<string name="send_google_no_account_message"
|
||||||
translation_description="When sending to Google, the dialog message when no Google account is
|
translation_description="When sending to Google, the dialog message when no Google account is
|
||||||
found.">
|
found.">
|
||||||
@@ -1358,38 +1372,17 @@ limitations under the License.
|
|||||||
permission.">
|
permission.">
|
||||||
Not able to get account permission. Make sure network is available.
|
Not able to get account permission. Make sure network is available.
|
||||||
</string>
|
</string>
|
||||||
<string name="send_google_no_service_selected"
|
|
||||||
translation_description="When sending a track to Google, a message indicating that the user has
|
|
||||||
not selected any Google service and no data is sent.">
|
|
||||||
You did not select any service. The track was not sent.
|
|
||||||
</string>
|
|
||||||
<string name="send_google_progress_message"
|
<string name="send_google_progress_message"
|
||||||
translation_description="When sending a track to a Google service, the progress message.
|
translation_description="When sending a track to a Google service, the progress message.
|
||||||
|
|
||||||
%1$s: service name. 'Google Maps', 'Google Fusion Tables', or 'Google Spreadsheets'.">
|
%1$s: service name. 'Google Maps', 'Google Fusion Tables', or 'Google Spreadsheets'.">
|
||||||
Sending to %1$s…
|
Sending to %1$s…
|
||||||
</string>
|
</string>
|
||||||
<string name="send_google_send_now"
|
|
||||||
translation_description="When sending a track to Google, under the 'Send to...' dialog, the
|
|
||||||
button on the bottom to send the track to the selected Google services.">
|
|
||||||
Send now
|
|
||||||
</string>
|
|
||||||
<string name="send_google_spreadsheets"
|
|
||||||
translation_description="When sending a track to Google, under the 'Send to...' dialog, the
|
|
||||||
checkbox option to send to Google Spreadsheets.">
|
|
||||||
Google Spreadsheets
|
|
||||||
</string>
|
|
||||||
<string name="send_google_success_footer"
|
<string name="send_google_success_footer"
|
||||||
translation_description="When sending a track to Google, the additional comment on the bottom of
|
translation_description="When sending a track to Google, the additional comment on the bottom of
|
||||||
the result page.">
|
the result page.">
|
||||||
It may take a few minutes before new tracks appear.
|
It may take a few minutes before new tracks appear.
|
||||||
</string>
|
</string>
|
||||||
<string name="send_google_title"
|
|
||||||
translation_description="When sending a track to Google, the dialog title to choose the Google
|
|
||||||
services to send the track to. The user can choose Google Maps, Google Fusion Tables, and
|
|
||||||
Google Spreadsheets.">
|
|
||||||
Send to…
|
|
||||||
</string>
|
|
||||||
<string name="send_google_track_part_label"
|
<string name="send_google_track_part_label"
|
||||||
translation_description="When sending a track to Google, the label to name segments of a large
|
translation_description="When sending a track to Google, the label to name segments of a large
|
||||||
track. E.g., 'track_name (Part 1)'.
|
track. E.g., 'track_name (Part 1)'.
|
||||||
@@ -1632,51 +1625,6 @@ limitations under the License.
|
|||||||
Character limit: ~23 (1 line)">
|
Character limit: ~23 (1 line)">
|
||||||
Sync Google Drive
|
Sync Google Drive
|
||||||
</string>
|
</string>
|
||||||
<string name="settings_google_fusion_tables_public_summary_off"
|
|
||||||
translation_description="In the 'Google' settings, the summary for the 'New tables public'
|
|
||||||
checkbox when it is unchecked explaining that new tables created in Google Fusion Tables will
|
|
||||||
be private, instead of public.">
|
|
||||||
New tables created in Google Fusion Tables will be private, instead of public.
|
|
||||||
</string>
|
|
||||||
<string name="settings_google_fusion_tables_public_summary_on"
|
|
||||||
translation_description="In the 'Google' settings, the summary for the 'New tables public'
|
|
||||||
checkbox when it is checked explaining that new tables created in Google Fusion Tables will be
|
|
||||||
public, instead of private.">
|
|
||||||
New tables created in Google Fusion Tables will be public, instead of private.
|
|
||||||
</string>
|
|
||||||
<string name="settings_google_fusion_tables_public_title"
|
|
||||||
translation_description="In the 'Google' settings, the checkbox to make new tables created in
|
|
||||||
Google Fusion Tables public instead of private.
|
|
||||||
|
|
||||||
Character limit: ~23 (1 line)">
|
|
||||||
New tables public
|
|
||||||
</string>
|
|
||||||
<string name="settings_google_maps_public_summary_off"
|
|
||||||
translation_description="In the 'Google' settings, the summary for the 'New maps public'
|
|
||||||
checkbox when it is unchecked explaining that new maps created in Google Maps will be
|
|
||||||
unlisted, instead of public. See http://support.google.com/maps/bin/answer.py?answer=144365
|
|
||||||
for public versus unlisted.
|
|
||||||
|
|
||||||
%1$s url. E.g., 'support.google.com/maps/bin/answer.py?answer=144365'.">
|
|
||||||
New maps created in Google Maps will be unlisted, instead of public. See %1$s for more info.
|
|
||||||
</string>
|
|
||||||
<string name="settings_google_maps_public_summary_on"
|
|
||||||
translation_description="In the 'Google' settings, the summary for the 'New maps public'
|
|
||||||
checkbox when it is checked explaining that new maps created in Google Maps will be public,
|
|
||||||
instead of unlisted. See http://support.google.com/maps/bin/answer.py?answer=144365 for public
|
|
||||||
versus unlisted.
|
|
||||||
|
|
||||||
%1$s url. E.g., 'support.google.com/maps/bin/answer.py?answer=144365'.">
|
|
||||||
New maps created in Google Maps will be public, instead of unlisted. See %1$s for more info.
|
|
||||||
</string>
|
|
||||||
<string name="settings_google_maps_public_title"
|
|
||||||
translation_description="In the 'Google' settings, the checkbox to make new maps created in
|
|
||||||
Google Maps public instead of unlisted. See
|
|
||||||
http://support.google.com/maps/bin/answer.py?answer=144365 for public versus unlisted.
|
|
||||||
|
|
||||||
Character limit: ~23 (1 line)">
|
|
||||||
New maps public
|
|
||||||
</string>
|
|
||||||
|
|
||||||
<!-- Settings Map -->
|
<!-- Settings Map -->
|
||||||
<string name="settings_map_medium"
|
<string name="settings_map_medium"
|
||||||
|
|||||||
@@ -32,19 +32,6 @@ limitations under the License.
|
|||||||
<item name="android:layout_width">match_parent</item>
|
<item name="android:layout_width">match_parent</item>
|
||||||
<item name="android:orientation">horizontal</item>
|
<item name="android:orientation">horizontal</item>
|
||||||
</style>
|
</style>
|
||||||
<!-- choose upload service checkbox -->
|
|
||||||
<style name="ChooseUploadServiceCheckBox" parent="@style/TextMedium">
|
|
||||||
<item name="android:layout_gravity">center_vertical</item>
|
|
||||||
<item name="android:layout_marginLeft">8dp</item>
|
|
||||||
<item name="android:layout_width">0dp</item>
|
|
||||||
<item name="android:maxLines">5</item>
|
|
||||||
</style>
|
|
||||||
<!-- choose upload service image view -->
|
|
||||||
<style name="ChooseUploadServiceImageView">
|
|
||||||
<item name="android:layout_gravity">center</item>
|
|
||||||
<item name="android:layout_height">wrap_content</item>
|
|
||||||
<item name="android:layout_width">wrap_content</item>
|
|
||||||
</style>
|
|
||||||
<!-- edit category -->
|
<!-- edit category -->
|
||||||
<style name="EditCategory" parent="@style/TextMedium">
|
<style name="EditCategory" parent="@style/TextMedium">
|
||||||
<item name="android:layout_width">match_parent</item>
|
<item name="android:layout_width">match_parent</item>
|
||||||
@@ -85,6 +72,12 @@ limitations under the License.
|
|||||||
<item name="android:selectAllOnFocus">true</item>
|
<item name="android:selectAllOnFocus">true</item>
|
||||||
<item name="android:singleLine">true</item>
|
<item name="android:singleLine">true</item>
|
||||||
</style>
|
</style>
|
||||||
|
<!-- export radio group -->
|
||||||
|
<style name="ExportRadioGroup">
|
||||||
|
<item name="android:layout_height">wrap_content</item>
|
||||||
|
<item name="android:layout_marginLeft">16dp</item>
|
||||||
|
<item name="android:layout_width">match_parent</item>
|
||||||
|
</style>
|
||||||
<!-- help answer -->
|
<!-- help answer -->
|
||||||
<style name="HelpAnswer" parent="@style/TextSmall">
|
<style name="HelpAnswer" parent="@style/TextSmall">
|
||||||
<item name="android:autoLink">web</item>
|
<item name="android:autoLink">web</item>
|
||||||
|
|||||||
@@ -24,14 +24,4 @@ limitations under the License.
|
|||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="@string/drive_sync_key"
|
android:key="@string/drive_sync_key"
|
||||||
android:title="@string/settings_google_drive_sync_title" />
|
android:title="@string/settings_google_drive_sync_title" />
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="@string/default_map_public_key"
|
|
||||||
android:title="@string/settings_google_maps_public_title" />
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="@string/default_table_public_key"
|
|
||||||
android:summaryOff="@string/settings_google_fusion_tables_public_summary_off"
|
|
||||||
android:summaryOn="@string/settings_google_fusion_tables_public_summary_on"
|
|
||||||
android:title="@string/settings_google_fusion_tables_public_title" />
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
@@ -139,10 +139,10 @@ public abstract class AbstractSendToGoogleActivity extends AbstractMyTracksActiv
|
|||||||
|
|
||||||
// Check Drive permission
|
// Check Drive permission
|
||||||
boolean needDrivePermission = sendRequest.isSendDrive();
|
boolean needDrivePermission = sendRequest.isSendDrive();
|
||||||
if (!needDrivePermission) {
|
if (!needDrivePermission && sendRequest.isSendFusionTables()) {
|
||||||
boolean defaultTablePublic = PreferencesUtils.getBoolean(
|
needDrivePermission = PreferencesUtils.getBoolean(this,
|
||||||
this, R.string.default_table_public_key, PreferencesUtils.DEFAULT_TABLE_PUBLIC_DEFAULT);
|
R.string.export_google_fusion_tables_public_key,
|
||||||
needDrivePermission = defaultTablePublic && sendRequest.isSendFusionTables();
|
PreferencesUtils.EXPORT_GOOGLE_FUSION_TABLES_PUBLIC_DEFAULT);
|
||||||
}
|
}
|
||||||
if (!needDrivePermission) {
|
if (!needDrivePermission) {
|
||||||
needDrivePermission = sendRequest.isSendSpreadsheets();
|
needDrivePermission = sendRequest.isSendSpreadsheets();
|
||||||
|
|||||||
@@ -22,13 +22,16 @@ import com.google.android.apps.mytracks.content.TrackDataHub;
|
|||||||
import com.google.android.apps.mytracks.content.Waypoint;
|
import com.google.android.apps.mytracks.content.Waypoint;
|
||||||
import com.google.android.apps.mytracks.content.WaypointCreationRequest;
|
import com.google.android.apps.mytracks.content.WaypointCreationRequest;
|
||||||
import com.google.android.apps.mytracks.fragments.ChartFragment;
|
import com.google.android.apps.mytracks.fragments.ChartFragment;
|
||||||
import com.google.android.apps.mytracks.fragments.ChooseUploadServiceDialogFragment;
|
|
||||||
import com.google.android.apps.mytracks.fragments.ChooseUploadServiceDialogFragment.ChooseUploadServiceCaller;
|
|
||||||
import com.google.android.apps.mytracks.fragments.DeleteTrackDialogFragment;
|
import com.google.android.apps.mytracks.fragments.DeleteTrackDialogFragment;
|
||||||
import com.google.android.apps.mytracks.fragments.DeleteTrackDialogFragment.DeleteTrackCaller;
|
import com.google.android.apps.mytracks.fragments.DeleteTrackDialogFragment.DeleteTrackCaller;
|
||||||
|
import com.google.android.apps.mytracks.fragments.ExportDialogFragment;
|
||||||
|
import com.google.android.apps.mytracks.fragments.ExportDialogFragment.ExportCaller;
|
||||||
|
import com.google.android.apps.mytracks.fragments.ExportDialogFragment.ExportType;
|
||||||
import com.google.android.apps.mytracks.fragments.FrequencyDialogFragment;
|
import com.google.android.apps.mytracks.fragments.FrequencyDialogFragment;
|
||||||
import com.google.android.apps.mytracks.fragments.MyTracksMapFragment;
|
import com.google.android.apps.mytracks.fragments.MyTracksMapFragment;
|
||||||
import com.google.android.apps.mytracks.fragments.StatsFragment;
|
import com.google.android.apps.mytracks.fragments.StatsFragment;
|
||||||
|
import com.google.android.apps.mytracks.io.file.SaveActivity;
|
||||||
|
import com.google.android.apps.mytracks.io.file.TrackFileFormat;
|
||||||
import com.google.android.apps.mytracks.io.sendtogoogle.SendRequest;
|
import com.google.android.apps.mytracks.io.sendtogoogle.SendRequest;
|
||||||
import com.google.android.apps.mytracks.services.TrackRecordingServiceConnection;
|
import com.google.android.apps.mytracks.services.TrackRecordingServiceConnection;
|
||||||
import com.google.android.apps.mytracks.settings.SettingsActivity;
|
import com.google.android.apps.mytracks.settings.SettingsActivity;
|
||||||
@@ -45,6 +48,7 @@ import android.content.Intent;
|
|||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Parcelable;
|
||||||
import android.support.v4.app.TaskStackBuilder;
|
import android.support.v4.app.TaskStackBuilder;
|
||||||
import android.support.v4.view.ViewPager;
|
import android.support.v4.view.ViewPager;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
@@ -55,6 +59,8 @@ import android.view.View.OnClickListener;
|
|||||||
import android.widget.TabHost;
|
import android.widget.TabHost;
|
||||||
import android.widget.TabHost.TabSpec;
|
import android.widget.TabHost.TabSpec;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An activity to show the track detail.
|
* An activity to show the track detail.
|
||||||
*
|
*
|
||||||
@@ -62,7 +68,7 @@ import android.widget.TabHost.TabSpec;
|
|||||||
* @author Rodrigo Damazio
|
* @author Rodrigo Damazio
|
||||||
*/
|
*/
|
||||||
public class TrackDetailActivity extends AbstractSendToGoogleActivity
|
public class TrackDetailActivity extends AbstractSendToGoogleActivity
|
||||||
implements ChooseUploadServiceCaller, DeleteTrackCaller {
|
implements ExportCaller, DeleteTrackCaller {
|
||||||
|
|
||||||
public static final String EXTRA_TRACK_ID = "track_id";
|
public static final String EXTRA_TRACK_ID = "track_id";
|
||||||
public static final String EXTRA_MARKER_ID = "marker_id";
|
public static final String EXTRA_MARKER_ID = "marker_id";
|
||||||
@@ -352,9 +358,9 @@ public class TrackDetailActivity extends AbstractSendToGoogleActivity
|
|||||||
.show(getSupportFragmentManager(), FrequencyDialogFragment.FREQUENCY_DIALOG_TAG);
|
.show(getSupportFragmentManager(), FrequencyDialogFragment.FREQUENCY_DIALOG_TAG);
|
||||||
return true;
|
return true;
|
||||||
case R.id.track_detail_export:
|
case R.id.track_detail_export:
|
||||||
AnalyticsUtils.sendPageViews(this, "/action/send_google");
|
AnalyticsUtils.sendPageViews(this, "/export");
|
||||||
new ChooseUploadServiceDialogFragment().show(getSupportFragmentManager(),
|
new ExportDialogFragment().show(getSupportFragmentManager(),
|
||||||
ChooseUploadServiceDialogFragment.CHOOSE_UPLOAD_SERVICE_DIALOG_TAG);
|
ExportDialogFragment.EXPORT_DIALOG_TAG);
|
||||||
return true;
|
return true;
|
||||||
case R.id.track_detail_edit:
|
case R.id.track_detail_edit:
|
||||||
intent = IntentUtils.newIntent(this, TrackEditActivity.class)
|
intent = IntentUtils.newIntent(this, TrackEditActivity.class)
|
||||||
@@ -398,23 +404,33 @@ public class TrackDetailActivity extends AbstractSendToGoogleActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChooseUploadServiceDone(boolean sendMaps, boolean sendFusionTables,
|
public void onExportDone(ExportType exportType, TrackFileFormat trackFileFormat) {
|
||||||
boolean sendSpreadsheets, boolean mapsExistingMap) {
|
String pageView;
|
||||||
SendRequest sendRequest = new SendRequest(trackId);
|
if (exportType == ExportType.EXTERNAL_STORAGE) {
|
||||||
sendRequest.setSendMaps(sendMaps);
|
pageView = "/export/external_storage_" + trackFileFormat.name().toLowerCase(Locale.US);
|
||||||
sendRequest.setSendFusionTables(sendFusionTables);
|
AnalyticsUtils.sendPageViews(this, pageView);
|
||||||
sendRequest.setSendSpreadsheets(sendSpreadsheets);
|
Intent intent = IntentUtils.newIntent(this, SaveActivity.class)
|
||||||
sendRequest.setMapsExistingMap(mapsExistingMap);
|
.putExtra(SaveActivity.EXTRA_TRACK_IDS, new long[] { trackId })
|
||||||
if (sendMaps) {
|
.putExtra(SaveActivity.EXTRA_TRACK_FILE_FORMAT, (Parcelable) trackFileFormat);
|
||||||
AnalyticsUtils.sendPageViews(this, "/send/maps");
|
startActivity(intent);
|
||||||
|
} else {
|
||||||
|
SendRequest sendRequest = new SendRequest(trackId);
|
||||||
|
switch (exportType) {
|
||||||
|
case GOOGLE_MAPS:
|
||||||
|
pageView = "/export/maps";
|
||||||
|
sendRequest.setSendMaps(true);
|
||||||
|
break;
|
||||||
|
case GOOGLE_FUSION_TABLES:
|
||||||
|
pageView = "/export/fusion_tables";
|
||||||
|
sendRequest.setSendFusionTables(true);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
pageView = "/export/spreadsheets";
|
||||||
|
sendRequest.setSendSpreadsheets(true);
|
||||||
|
}
|
||||||
|
AnalyticsUtils.sendPageViews(this, pageView);
|
||||||
|
sendToGoogle(sendRequest);
|
||||||
}
|
}
|
||||||
if (sendFusionTables) {
|
|
||||||
AnalyticsUtils.sendPageViews(this, "/send/fusion_tables");
|
|
||||||
}
|
|
||||||
if (sendSpreadsheets) {
|
|
||||||
AnalyticsUtils.sendPageViews(this, "/send/spreadsheets");
|
|
||||||
}
|
|
||||||
sendToGoogle(sendRequest);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,166 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2012 Google Inc.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
||||||
* use this file except in compliance with the License. You may obtain a copy of
|
|
||||||
* the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations under
|
|
||||||
* the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.google.android.apps.mytracks.fragments;
|
|
||||||
|
|
||||||
import com.google.android.apps.mytracks.util.PreferencesUtils;
|
|
||||||
import com.google.android.maps.mytracks.R;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.v4.app.DialogFragment;
|
|
||||||
import android.support.v4.app.FragmentActivity;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.CompoundButton;
|
|
||||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
|
||||||
import android.widget.RadioButton;
|
|
||||||
import android.widget.TableRow;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A DialogFragment to choose upload service.
|
|
||||||
*
|
|
||||||
* @author Jimmy Shih
|
|
||||||
*/
|
|
||||||
public class ChooseUploadServiceDialogFragment extends DialogFragment {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Interface for caller of this dialog fragment.
|
|
||||||
*
|
|
||||||
* @author Jimmy Shih
|
|
||||||
*/
|
|
||||||
public interface ChooseUploadServiceCaller {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when choose upload service is done.
|
|
||||||
*/
|
|
||||||
public void onChooseUploadServiceDone(boolean sendMaps, boolean sendFusionTables,
|
|
||||||
boolean sendSpreadsheets, boolean mapsExistingMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static final String CHOOSE_UPLOAD_SERVICE_DIALOG_TAG = "chooseUploadService";
|
|
||||||
|
|
||||||
private ChooseUploadServiceCaller caller;
|
|
||||||
private FragmentActivity fragmentActivity;
|
|
||||||
|
|
||||||
private CheckBox mapsCheckBox;
|
|
||||||
private CheckBox fusionTablesCheckBox;
|
|
||||||
private CheckBox spreadsheetsCheckBox;
|
|
||||||
|
|
||||||
private TableRow mapsOptionTableRow;
|
|
||||||
private RadioButton existingMapRadioButton;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAttach(Activity activity) {
|
|
||||||
super.onAttach(activity);
|
|
||||||
try {
|
|
||||||
caller = (ChooseUploadServiceCaller) activity;
|
|
||||||
} catch (ClassCastException e) {
|
|
||||||
throw new ClassCastException(activity.toString() + " must implement "
|
|
||||||
+ ChooseUploadServiceCaller.class.getSimpleName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
|
||||||
fragmentActivity = getActivity();
|
|
||||||
|
|
||||||
View view = fragmentActivity.getLayoutInflater().inflate(R.layout.choose_upload_service, null);
|
|
||||||
|
|
||||||
mapsCheckBox = (CheckBox) view.findViewById(R.id.choose_upload_service_maps);
|
|
||||||
fusionTablesCheckBox = (CheckBox) view.findViewById(R.id.choose_upload_service_fusion_tables);
|
|
||||||
spreadsheetsCheckBox = (CheckBox) view.findViewById(R.id.choose_upload_service_spreadsheets);
|
|
||||||
|
|
||||||
mapsCheckBox.setChecked(PreferencesUtils.getBoolean(
|
|
||||||
fragmentActivity, R.string.send_to_maps_key, PreferencesUtils.SEND_TO_MAPS_DEFAULT));
|
|
||||||
fusionTablesCheckBox.setChecked(PreferencesUtils.getBoolean(
|
|
||||||
fragmentActivity, R.string.send_to_fusion_tables_key,
|
|
||||||
PreferencesUtils.SEND_TO_FUSION_TABLES_DEFAULT));
|
|
||||||
|
|
||||||
spreadsheetsCheckBox.setChecked(PreferencesUtils.getBoolean(
|
|
||||||
fragmentActivity, R.string.send_to_spreadsheets_key,
|
|
||||||
PreferencesUtils.SEND_TO_SPREADSHEETS_DEFAULT));
|
|
||||||
|
|
||||||
mapsCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
|
||||||
public void onCheckedChanged(CompoundButton button, boolean checked) {
|
|
||||||
updateMapsOption();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mapsOptionTableRow = (TableRow) view.findViewById(R.id.choose_upload_service_maps_options);
|
|
||||||
|
|
||||||
RadioButton newMapRadioButton = (RadioButton) view.findViewById(
|
|
||||||
R.id.choose_upload_service_new_map);
|
|
||||||
boolean defaultMapPublic = PreferencesUtils.getBoolean(
|
|
||||||
fragmentActivity, R.string.default_map_public_key, PreferencesUtils.DEFAULT_MAP_PUBLIC_DEFAULT);
|
|
||||||
newMapRadioButton.setText(defaultMapPublic ? R.string.send_google_new_public_map
|
|
||||||
: R.string.send_google_new_unlisted_map);
|
|
||||||
|
|
||||||
existingMapRadioButton = (RadioButton) view.findViewById(
|
|
||||||
R.id.choose_upload_service_existing_map);
|
|
||||||
|
|
||||||
updateMapsOption();
|
|
||||||
if (PreferencesUtils.getBoolean(
|
|
||||||
fragmentActivity, R.string.pick_existing_map_key, PreferencesUtils.PICK_EXISTING_MAP_DEFAULT)) {
|
|
||||||
existingMapRadioButton.setChecked(true);
|
|
||||||
} else {
|
|
||||||
newMapRadioButton.setChecked(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update fusion table
|
|
||||||
boolean defaultTablePublic = PreferencesUtils.getBoolean(
|
|
||||||
fragmentActivity, R.string.default_table_public_key, PreferencesUtils.DEFAULT_TABLE_PUBLIC_DEFAULT);
|
|
||||||
String text = getString(R.string.send_google_fusion_tables) + "\n"
|
|
||||||
+ getString(defaultTablePublic ? R.string.send_google_fusion_tables_public
|
|
||||||
: R.string.send_google_fusion_tables_private);
|
|
||||||
fusionTablesCheckBox.setText(text);
|
|
||||||
|
|
||||||
return new AlertDialog.Builder(fragmentActivity).setNegativeButton(R.string.generic_cancel, null)
|
|
||||||
.setPositiveButton(R.string.send_google_send_now, new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
|
||||||
PreferencesUtils.setBoolean(
|
|
||||||
fragmentActivity, R.string.pick_existing_map_key, existingMapRadioButton.isChecked());
|
|
||||||
PreferencesUtils.setBoolean(
|
|
||||||
fragmentActivity, R.string.send_to_maps_key, mapsCheckBox.isChecked());
|
|
||||||
PreferencesUtils.setBoolean(
|
|
||||||
fragmentActivity, R.string.send_to_fusion_tables_key, fusionTablesCheckBox.isChecked());
|
|
||||||
PreferencesUtils.setBoolean(
|
|
||||||
fragmentActivity, R.string.send_to_spreadsheets_key, spreadsheetsCheckBox.isChecked());
|
|
||||||
if (mapsCheckBox.isChecked() || fusionTablesCheckBox.isChecked()
|
|
||||||
|| spreadsheetsCheckBox.isChecked()) {
|
|
||||||
caller.onChooseUploadServiceDone(mapsCheckBox.isChecked(),
|
|
||||||
fusionTablesCheckBox.isChecked(), spreadsheetsCheckBox.isChecked(),
|
|
||||||
existingMapRadioButton.isChecked());
|
|
||||||
} else {
|
|
||||||
Toast.makeText(fragmentActivity, R.string.send_google_no_service_selected, Toast.LENGTH_LONG)
|
|
||||||
.show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).setTitle(R.string.send_google_title).setView(view).create();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Updates map option.
|
|
||||||
*/
|
|
||||||
private void updateMapsOption() {
|
|
||||||
mapsOptionTableRow.setVisibility(mapsCheckBox.isChecked() ? View.VISIBLE : View.GONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,246 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012 Google Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
|
* use this file except in compliance with the License. You may obtain a copy of
|
||||||
|
* the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
* License for the specific language governing permissions and limitations under
|
||||||
|
* the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.google.android.apps.mytracks.fragments;
|
||||||
|
|
||||||
|
import com.google.android.apps.mytracks.io.file.TrackFileFormat;
|
||||||
|
import com.google.android.apps.mytracks.util.PreferencesUtils;
|
||||||
|
import com.google.android.maps.mytracks.R;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v4.app.DialogFragment;
|
||||||
|
import android.support.v4.app.FragmentActivity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.RadioButton;
|
||||||
|
import android.widget.RadioGroup;
|
||||||
|
import android.widget.RadioGroup.OnCheckedChangeListener;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A DialogFragment to export a track.
|
||||||
|
*
|
||||||
|
* @author Jimmy Shih
|
||||||
|
*/
|
||||||
|
public class ExportDialogFragment extends DialogFragment {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Export types.
|
||||||
|
*
|
||||||
|
* @author Jimmy Shih
|
||||||
|
*/
|
||||||
|
public enum ExportType {
|
||||||
|
GOOGLE_MAPS, GOOGLE_FUSION_TABLES, GOOGLE_SPREADSHEET, EXTERNAL_STORAGE
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface for caller of this dialog fragment.
|
||||||
|
*
|
||||||
|
* @author Jimmy Shih
|
||||||
|
*/
|
||||||
|
public interface ExportCaller {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when export is done.
|
||||||
|
*/
|
||||||
|
public void onExportDone(ExportType exportType, TrackFileFormat trackFileFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String EXPORT_DIALOG_TAG = "export";
|
||||||
|
|
||||||
|
private ExportCaller caller;
|
||||||
|
private RadioGroup exportTypeOptions;
|
||||||
|
private RadioGroup exportGoogleMapsOptions;
|
||||||
|
private RadioGroup exportGoogleFusionTablesOptions;
|
||||||
|
private RadioGroup exportExternalStorageOptions;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAttach(Activity activity) {
|
||||||
|
super.onAttach(activity);
|
||||||
|
try {
|
||||||
|
caller = (ExportCaller) activity;
|
||||||
|
} catch (ClassCastException e) {
|
||||||
|
throw new ClassCastException(
|
||||||
|
activity.toString() + " must implement " + ExportCaller.class.getSimpleName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||||
|
FragmentActivity fragmentActivity = getActivity();
|
||||||
|
|
||||||
|
View view = fragmentActivity.getLayoutInflater().inflate(R.layout.export, null);
|
||||||
|
|
||||||
|
exportTypeOptions = (RadioGroup) view.findViewById(R.id.export_type_options);
|
||||||
|
exportGoogleMapsOptions = (RadioGroup) view.findViewById(R.id.export_google_maps_options);
|
||||||
|
exportGoogleFusionTablesOptions = (RadioGroup) view.findViewById(
|
||||||
|
R.id.export_google_fusion_tables_options);
|
||||||
|
exportExternalStorageOptions = (RadioGroup) view.findViewById(
|
||||||
|
R.id.export_external_storage_options);
|
||||||
|
|
||||||
|
exportTypeOptions.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
||||||
|
exportGoogleMapsOptions.setVisibility(
|
||||||
|
checkedId == R.id.export_google_maps ? View.VISIBLE : View.GONE);
|
||||||
|
exportGoogleFusionTablesOptions.setVisibility(
|
||||||
|
checkedId == R.id.export_google_fusion_tables ? View.VISIBLE : View.GONE);
|
||||||
|
exportExternalStorageOptions.setVisibility(
|
||||||
|
checkedId == R.id.export_external_storage ? View.VISIBLE : View.GONE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ExportType exportType = ExportType.valueOf(PreferencesUtils.getString(
|
||||||
|
fragmentActivity, R.string.export_type_key, PreferencesUtils.EXPORT_TYPE_DEFAULT));
|
||||||
|
exportTypeOptions.check(getExportTypeId(exportType));
|
||||||
|
|
||||||
|
boolean exportGoogleMapsPublic = PreferencesUtils.getBoolean(fragmentActivity,
|
||||||
|
R.string.export_google_maps_public_key, PreferencesUtils.EXPORT_GOOGLE_MAPS_PUBLIC_DEFAULT);
|
||||||
|
exportGoogleMapsOptions.check(
|
||||||
|
exportGoogleMapsPublic ? R.id.export_google_maps_public : R.id.export_google_maps_unlisted);
|
||||||
|
|
||||||
|
boolean exportGoogleFusionTablesPublic = PreferencesUtils.getBoolean(fragmentActivity,
|
||||||
|
R.string.export_google_fusion_tables_public_key,
|
||||||
|
PreferencesUtils.EXPORT_GOOGLE_FUSION_TABLES_PUBLIC_DEFAULT);
|
||||||
|
exportGoogleFusionTablesOptions.check(
|
||||||
|
exportGoogleFusionTablesPublic ? R.id.export_google_fusion_tables_public
|
||||||
|
: R.id.export_google_fusion_tables_private);
|
||||||
|
|
||||||
|
setExternalStorageOption(
|
||||||
|
(RadioButton) view.findViewById(R.id.export_external_storage_gpx), TrackFileFormat.GPX);
|
||||||
|
setExternalStorageOption(
|
||||||
|
(RadioButton) view.findViewById(R.id.export_external_storage_kml), TrackFileFormat.KML);
|
||||||
|
setExternalStorageOption(
|
||||||
|
(RadioButton) view.findViewById(R.id.export_external_storage_csv), TrackFileFormat.CSV);
|
||||||
|
setExternalStorageOption(
|
||||||
|
(RadioButton) view.findViewById(R.id.export_external_storage_tcx), TrackFileFormat.TCX);
|
||||||
|
TrackFileFormat trackFileFormat = TrackFileFormat.valueOf(PreferencesUtils.getString(
|
||||||
|
fragmentActivity, R.string.export_external_storage_format_key,
|
||||||
|
PreferencesUtils.EXPORT_EXTERNAL_STORAGE_FORMAT_DEFAULT));
|
||||||
|
exportExternalStorageOptions.check(getExternalStorageFormatId(trackFileFormat));
|
||||||
|
|
||||||
|
return new AlertDialog.Builder(fragmentActivity).setNegativeButton(
|
||||||
|
R.string.generic_cancel, null)
|
||||||
|
.setPositiveButton(R.string.menu_export, new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
FragmentActivity context = getActivity();
|
||||||
|
int id = exportTypeOptions.getCheckedRadioButtonId();
|
||||||
|
ExportType type = getExportType(id);
|
||||||
|
TrackFileFormat format = null;
|
||||||
|
|
||||||
|
PreferencesUtils.setString(context, R.string.export_type_key, type.name());
|
||||||
|
if (id == R.id.export_google_maps) {
|
||||||
|
PreferencesUtils.setBoolean(context, R.string.export_google_maps_public_key,
|
||||||
|
exportGoogleMapsOptions.getCheckedRadioButtonId()
|
||||||
|
== R.id.export_google_maps_public);
|
||||||
|
} else if (id == R.id.export_google_fusion_tables) {
|
||||||
|
PreferencesUtils.setBoolean(context, R.string.export_google_fusion_tables_public_key,
|
||||||
|
exportGoogleFusionTablesOptions.getCheckedRadioButtonId()
|
||||||
|
== R.id.export_google_fusion_tables_public);
|
||||||
|
} else if (id == R.id.export_external_storage) {
|
||||||
|
format = getTrackFileFormat(exportExternalStorageOptions.getCheckedRadioButtonId());
|
||||||
|
PreferencesUtils.setString(
|
||||||
|
context, R.string.export_external_storage_format_key, format.name());
|
||||||
|
}
|
||||||
|
caller.onExportDone(type, format);
|
||||||
|
}
|
||||||
|
}).setTitle(R.string.export_dialog_title).setView(view).create();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets an external storage option.
|
||||||
|
*
|
||||||
|
* @param radioButton the radio button
|
||||||
|
* @param trackFileFormat the track file format
|
||||||
|
*/
|
||||||
|
private void setExternalStorageOption(RadioButton radioButton, TrackFileFormat trackFileFormat) {
|
||||||
|
radioButton.setText(getString(R.string.export_external_storage_option, trackFileFormat.name()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the external storage format id from a track file format.
|
||||||
|
*
|
||||||
|
* @param trackFileFormat the track file format
|
||||||
|
*/
|
||||||
|
private int getExternalStorageFormatId(TrackFileFormat trackFileFormat) {
|
||||||
|
switch (trackFileFormat) {
|
||||||
|
case GPX:
|
||||||
|
return R.id.export_external_storage_gpx;
|
||||||
|
case KML:
|
||||||
|
return R.id.export_external_storage_kml;
|
||||||
|
case CSV:
|
||||||
|
return R.id.export_external_storage_csv;
|
||||||
|
default:
|
||||||
|
return R.id.export_external_storage_tcx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the track file format from an external storage format id.
|
||||||
|
*
|
||||||
|
* @param externalStorageFormatId the external storage format id
|
||||||
|
*/
|
||||||
|
private TrackFileFormat getTrackFileFormat(int externalStorageFormatId) {
|
||||||
|
switch (externalStorageFormatId) {
|
||||||
|
case R.id.export_external_storage_gpx:
|
||||||
|
return TrackFileFormat.GPX;
|
||||||
|
case R.id.export_external_storage_kml:
|
||||||
|
return TrackFileFormat.KML;
|
||||||
|
case R.id.export_external_storage_csv:
|
||||||
|
return TrackFileFormat.CSV;
|
||||||
|
default:
|
||||||
|
return TrackFileFormat.TCX;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the export type id from an export type.
|
||||||
|
*
|
||||||
|
* @param exportType the export type
|
||||||
|
*/
|
||||||
|
private int getExportTypeId(ExportType exportType) {
|
||||||
|
switch (exportType) {
|
||||||
|
case GOOGLE_MAPS:
|
||||||
|
return R.id.export_google_maps;
|
||||||
|
case GOOGLE_FUSION_TABLES:
|
||||||
|
return R.id.export_google_fusion_tables;
|
||||||
|
case GOOGLE_SPREADSHEET:
|
||||||
|
return R.id.export_google_spreadsheets;
|
||||||
|
default:
|
||||||
|
return R.id.export_external_storage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the export type from an export type id.
|
||||||
|
*
|
||||||
|
* @param exportTypeId the export type id
|
||||||
|
*/
|
||||||
|
private ExportType getExportType(int exportTypeId) {
|
||||||
|
switch (exportTypeId) {
|
||||||
|
case R.id.export_google_maps:
|
||||||
|
return ExportType.GOOGLE_MAPS;
|
||||||
|
case R.id.export_google_fusion_tables:
|
||||||
|
return ExportType.GOOGLE_FUSION_TABLES;
|
||||||
|
case R.id.export_google_spreadsheets:
|
||||||
|
return ExportType.GOOGLE_SPREADSHEET;
|
||||||
|
default:
|
||||||
|
return ExportType.EXTERNAL_STORAGE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -44,7 +44,7 @@ public class SendDriveActivity extends AbstractSendActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getServiceName() {
|
protected String getServiceName() {
|
||||||
return getString(R.string.send_google_drive);
|
return getString(R.string.export_google_drive);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class SendFusionTablesActivity extends AbstractSendActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getServiceName() {
|
protected String getServiceName() {
|
||||||
return getString(R.string.send_google_fusion_tables);
|
return getString(R.string.export_google_fusion_tables);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -202,8 +202,8 @@ public class SendFusionTablesAsyncTask extends AbstractSendAsyncTask {
|
|||||||
|
|
||||||
private boolean setPermission(String tableId) throws IOException, GoogleAuthException {
|
private boolean setPermission(String tableId) throws IOException, GoogleAuthException {
|
||||||
boolean defaultTablePublic = PreferencesUtils.getBoolean(context,
|
boolean defaultTablePublic = PreferencesUtils.getBoolean(context,
|
||||||
R.string.default_table_public_key,
|
R.string.export_google_fusion_tables_public_key,
|
||||||
PreferencesUtils.DEFAULT_TABLE_PUBLIC_DEFAULT);
|
PreferencesUtils.EXPORT_GOOGLE_FUSION_TABLES_PUBLIC_DEFAULT);
|
||||||
if (!defaultTablePublic) {
|
if (!defaultTablePublic) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class SendMapsActivity extends AbstractSendActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getServiceName() {
|
protected String getServiceName() {
|
||||||
return getString(R.string.send_google_maps);
|
return getString(R.string.export_google_maps);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -222,8 +222,9 @@ public class SendMapsAsyncTask extends AbstractSendAsyncTask {
|
|||||||
mapId = chooseMapId;
|
mapId = chooseMapId;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
boolean defaultMapPublic = PreferencesUtils.getBoolean(
|
boolean defaultMapPublic = PreferencesUtils.getBoolean(context,
|
||||||
context, R.string.default_map_public_key, PreferencesUtils.DEFAULT_MAP_PUBLIC_DEFAULT);
|
R.string.export_google_maps_public_key,
|
||||||
|
PreferencesUtils.EXPORT_GOOGLE_MAPS_PUBLIC_DEFAULT);
|
||||||
try {
|
try {
|
||||||
String description = track.getCategory() + "\n" + track.getDescription() + "\n"
|
String description = track.getCategory() + "\n" + track.getDescription() + "\n"
|
||||||
+ context.getString(R.string.send_google_by_my_tracks, "", "");
|
+ context.getString(R.string.send_google_by_my_tracks, "", "");
|
||||||
|
|||||||
@@ -81,8 +81,9 @@ public class UploadResultActivity extends FragmentActivity implements ChooseActi
|
|||||||
}
|
}
|
||||||
if (shareUrl == null && sendRequest.isSendFusionTables()
|
if (shareUrl == null && sendRequest.isSendFusionTables()
|
||||||
&& sendRequest.isFusionTablesSuccess()) {
|
&& sendRequest.isFusionTablesSuccess()) {
|
||||||
boolean defaultTablePublic = PreferencesUtils.getBoolean(
|
boolean defaultTablePublic = PreferencesUtils.getBoolean(this,
|
||||||
this, R.string.default_table_public_key, PreferencesUtils.DEFAULT_TABLE_PUBLIC_DEFAULT);
|
R.string.export_google_fusion_tables_public_key,
|
||||||
|
PreferencesUtils.EXPORT_GOOGLE_FUSION_TABLES_PUBLIC_DEFAULT);
|
||||||
if (defaultTablePublic) {
|
if (defaultTablePublic) {
|
||||||
shareUrl = SendFusionTablesUtils.getMapUrl(track);
|
shareUrl = SendFusionTablesUtils.getMapUrl(track);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class SendSpreadsheetsActivity extends AbstractSendActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getServiceName() {
|
protected String getServiceName() {
|
||||||
return getString(R.string.send_google_spreadsheets);
|
return getString(R.string.export_google_spreadsheets);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -115,15 +115,6 @@ public class GoogleSettingsActivity extends AbstractSettingsActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
CheckBoxPreference defaultMapPublicPreference = (CheckBoxPreference) findPreference(
|
|
||||||
getString(R.string.default_map_public_key));
|
|
||||||
defaultMapPublicPreference.setSummaryOn(getString(
|
|
||||||
R.string.settings_google_maps_public_summary_on,
|
|
||||||
getString(R.string.maps_public_unlisted_url)));
|
|
||||||
defaultMapPublicPreference.setSummaryOff(getString(
|
|
||||||
R.string.settings_google_maps_public_summary_off,
|
|
||||||
getString(R.string.maps_public_unlisted_url)));
|
|
||||||
|
|
||||||
updateUiByAccountName(PreferencesUtils.getString(
|
updateUiByAccountName(PreferencesUtils.getString(
|
||||||
this, R.string.google_account_key, PreferencesUtils.GOOGLE_ACCOUNT_DEFAULT));
|
this, R.string.google_account_key, PreferencesUtils.GOOGLE_ACCOUNT_DEFAULT));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
package com.google.android.apps.mytracks.util;
|
package com.google.android.apps.mytracks.util;
|
||||||
|
|
||||||
import com.google.android.apps.mytracks.Constants;
|
import com.google.android.apps.mytracks.Constants;
|
||||||
|
import com.google.android.apps.mytracks.fragments.ExportDialogFragment.ExportType;
|
||||||
|
import com.google.android.apps.mytracks.io.file.TrackFileFormat;
|
||||||
import com.google.android.gms.location.DetectedActivity;
|
import com.google.android.gms.location.DetectedActivity;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
@@ -59,12 +61,15 @@ public class PreferencesUtils {
|
|||||||
public static final boolean CONFIRM_SHARE_MAPS_DEFAULT = true;
|
public static final boolean CONFIRM_SHARE_MAPS_DEFAULT = true;
|
||||||
|
|
||||||
public static final String DEFAULT_ACTIVITY_DEFAULT = "";
|
public static final String DEFAULT_ACTIVITY_DEFAULT = "";
|
||||||
public static final boolean DEFAULT_MAP_PUBLIC_DEFAULT = false;
|
|
||||||
public static final boolean DEFAULT_TABLE_PUBLIC_DEFAULT = false;
|
|
||||||
public static final String DRIVE_DELETED_LIST_DEFAULT = "";
|
public static final String DRIVE_DELETED_LIST_DEFAULT = "";
|
||||||
public static final long DRIVE_LARGEST_CHANGE_ID_DEFAULT = -1L;
|
public static final long DRIVE_LARGEST_CHANGE_ID_DEFAULT = -1L;
|
||||||
public static final boolean DRIVE_SYNC_DEFAULT = false;
|
public static final boolean DRIVE_SYNC_DEFAULT = false;
|
||||||
|
|
||||||
|
public static final String EXPORT_EXTERNAL_STORAGE_FORMAT_DEFAULT = TrackFileFormat.KML.name();
|
||||||
|
public static final boolean EXPORT_GOOGLE_FUSION_TABLES_PUBLIC_DEFAULT = false;
|
||||||
|
public static final boolean EXPORT_GOOGLE_MAPS_PUBLIC_DEFAULT = false;
|
||||||
|
public static final String EXPORT_TYPE_DEFAULT = ExportType.GOOGLE_MAPS.name();
|
||||||
|
|
||||||
// Value for split_frequency_key and voice_frequency_key
|
// Value for split_frequency_key and voice_frequency_key
|
||||||
public static final int FREQUENCY_OFF = 0;
|
public static final int FREQUENCY_OFF = 0;
|
||||||
|
|
||||||
@@ -86,16 +91,11 @@ public class PreferencesUtils {
|
|||||||
public static final int MIN_REQUIRED_ACCURACY_EXCELLENT = 10;
|
public static final int MIN_REQUIRED_ACCURACY_EXCELLENT = 10;
|
||||||
public static final int MIN_REQUIRED_ACCURACY_POOR = 5000;
|
public static final int MIN_REQUIRED_ACCURACY_POOR = 5000;
|
||||||
|
|
||||||
public static final boolean PICK_EXISTING_MAP_DEFAULT = false;
|
|
||||||
public static final long RECORDING_TRACK_ID_DEFAULT = -1L;
|
public static final long RECORDING_TRACK_ID_DEFAULT = -1L;
|
||||||
public static final boolean RECORDING_TRACK_PAUSED_DEFAULT = true;
|
public static final boolean RECORDING_TRACK_PAUSED_DEFAULT = true;
|
||||||
public static final boolean REPORT_SPEED_DEFAULT = true;
|
public static final boolean REPORT_SPEED_DEFAULT = true;
|
||||||
public static final long SELECTED_TRACK_ID_DEFAULT = -1L;
|
public static final long SELECTED_TRACK_ID_DEFAULT = -1L;
|
||||||
|
|
||||||
public static final boolean SEND_TO_FUSION_TABLES_DEFAULT = false;
|
|
||||||
public static final boolean SEND_TO_MAPS_DEFAULT = false;
|
|
||||||
public static final boolean SEND_TO_SPREADSHEETS_DEFAULT = false;
|
|
||||||
|
|
||||||
public static final String SENSOR_TYPE_DEFAULT = "NONE";
|
public static final String SENSOR_TYPE_DEFAULT = "NONE";
|
||||||
public static final String SHARE_TRACK_DEFAULT = "DRIVE";
|
public static final String SHARE_TRACK_DEFAULT = "DRIVE";
|
||||||
public static final int SPLIT_FREQUENCY_DEFAULT = 0;
|
public static final int SPLIT_FREQUENCY_DEFAULT = 0;
|
||||||
|
|||||||
@@ -22,9 +22,6 @@ import com.google.android.maps.mytracks.R;
|
|||||||
import android.app.Instrumentation;
|
import android.app.Instrumentation;
|
||||||
import android.test.ActivityInstrumentationTestCase2;
|
import android.test.ActivityInstrumentationTestCase2;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.widget.CheckBox;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests creating a track with markers, and editing and sending send a track.
|
* Tests creating a track with markers, and editing and sending send a track.
|
||||||
@@ -48,41 +45,6 @@ public class CreateTrackTest extends ActivityInstrumentationTestCase2<TrackListA
|
|||||||
EndToEndTestUtils.setupForAllTest(instrumentation, activityMyTracks);
|
EndToEndTestUtils.setupForAllTest(instrumentation, activityMyTracks);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Does not check any service and try to send to google.
|
|
||||||
*/
|
|
||||||
public void testCreateAndSendTrack_notSend() {
|
|
||||||
EndToEndTestUtils.createTrackIfEmpty(1, false);
|
|
||||||
instrumentation.waitForIdleSync();
|
|
||||||
EndToEndTestUtils.findMenuItem(activityMyTracks.getString(R.string.menu_export), true);
|
|
||||||
EndToEndTestUtils.SOLO.waitForText(activityMyTracks.getString(R.string.send_google_title));
|
|
||||||
EndToEndTestUtils.rotateCurrentActivity();
|
|
||||||
instrumentation.waitForIdleSync();
|
|
||||||
|
|
||||||
ArrayList<CheckBox> checkBoxs = EndToEndTestUtils.SOLO.getCurrentCheckBoxes();
|
|
||||||
for (int i = 0; i < checkBoxs.size(); i++) {
|
|
||||||
if (checkBoxs.get(i).isChecked()) {
|
|
||||||
EndToEndTestUtils.SOLO.clickOnCheckBox(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (checkBoxs.size() < 3) {
|
|
||||||
EndToEndTestUtils.SOLO.scrollDown();
|
|
||||||
checkBoxs = EndToEndTestUtils.SOLO.getCurrentCheckBoxes();
|
|
||||||
for (int i = 0; i < checkBoxs.size(); i++) {
|
|
||||||
if (checkBoxs.get(i).isChecked()) {
|
|
||||||
EndToEndTestUtils.SOLO.clickOnCheckBox(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
instrumentation.waitForIdleSync();
|
|
||||||
EndToEndTestUtils.SOLO.clickOnText(activityMyTracks.getString(R.string.send_google_send_now));
|
|
||||||
assertTrue(EndToEndTestUtils.SOLO.waitForText(activityMyTracks
|
|
||||||
.getString(R.string.send_google_no_service_selected)));
|
|
||||||
// Stop here for do not really send.
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests editing a track.
|
* Tests editing a track.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ public class SendToGoogleTest extends ActivityInstrumentationTestCase2<TrackList
|
|||||||
*/
|
*/
|
||||||
private boolean sendToGoogle() {
|
private boolean sendToGoogle() {
|
||||||
EndToEndTestUtils.findMenuItem(activityMyTracks.getString(R.string.menu_export), true);
|
EndToEndTestUtils.findMenuItem(activityMyTracks.getString(R.string.menu_export), true);
|
||||||
EndToEndTestUtils.SOLO.waitForText(activityMyTracks.getString(R.string.send_google_title));
|
EndToEndTestUtils.SOLO.waitForText(activityMyTracks.getString(R.string.export_dialog_title));
|
||||||
instrumentation.waitForIdleSync();
|
instrumentation.waitForIdleSync();
|
||||||
ArrayList<CheckBox> checkBoxs = EndToEndTestUtils.SOLO.getCurrentCheckBoxes();
|
ArrayList<CheckBox> checkBoxs = EndToEndTestUtils.SOLO.getCurrentCheckBoxes();
|
||||||
for (int i = 0; i < checkBoxs.size(); i++) {
|
for (int i = 0; i < checkBoxs.size(); i++) {
|
||||||
@@ -155,7 +155,7 @@ public class SendToGoogleTest extends ActivityInstrumentationTestCase2<TrackList
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
instrumentation.waitForIdleSync();
|
instrumentation.waitForIdleSync();
|
||||||
EndToEndTestUtils.getButtonOnScreen(activityMyTracks.getString(R.string.send_google_send_now),
|
EndToEndTestUtils.getButtonOnScreen(activityMyTracks.getString(R.string.menu_export),
|
||||||
true, true);
|
true, true);
|
||||||
|
|
||||||
instrumentation.waitForIdleSync();
|
instrumentation.waitForIdleSync();
|
||||||
|
|||||||